This is an example using scopyon
(https://scopyon.readthedocs.io/).
In [1]:
import scopyon
When you want to show debug messages, set the logging level.
In [2]:
import logging
logging.basicConfig(level=logging.DEBUG)
Set the configuration first.
In [3]:
config = scopyon.DefaultConfiguration()
config.default.detector.exposure_time = 33.0e-3 # second
A field of microscopic view could be calculated as follows:
In [4]:
pixel_length = config.default.detector.pixel_length / config.default.magnification
L_2 = config.default.detector.image_size[0] * pixel_length * 0.5
Randomly generate positions of 250 molecules in two dimensions.
In [5]:
import numpy.random
rng = numpy.random.RandomState(123)
N1 = 150
N2 = 50
N3 = 50
inputs = rng.uniform(-L_2, +L_2, size=(N1 + N2 + N3, 2))
Form an image where N1
and N2
molecules are labeled.
In [6]:
img1 = scopyon.form_image(inputs[: N1 + N2], config=config, rng=rng)
Generate another image where N2
and N3
molecules are labeled.
In [7]:
img2 = scopyon.form_image(inputs[150: ], config=config, rng=rng)
Make a two-color image by merging two images.
In [8]:
img = scopyon.Image.RGB(red=img1, green=img2)
In [9]:
img