cbi_toolbox.simu.imaging¶
The imaging module provides simulations of different imaging systems and acquisition techniques for microscopy.
Conventions:
arrays follow the ZXY convention, with
Z : depth axis (axial, focus axis)
X : horizontal axis (lateral)
Y : vertical axis (lateral, rotation axis when relevant)
sinograms follow the TPY convention, with
T : angles (theta)
P : captor axis
Y : rotation axis
-
cbi_toolbox.simu.imaging.fps_opt(obj, psf, pad=False, **kwargs)[source]¶ Simulate the FPS-OPT (focal plane scanning) imaging of an object
- Parameters
obj (array [ZXY]) – the object to be imaged
psf (array [ZXY] or array [XY]) – the PSF of the system, or projected PSF along the Z axis
pad (bool, optional) – pad the vield of view to see all contributions (required if the sample is not contained in the inner cylinder of the object), by default False
**kwargs – to be passed to the radon call
- Returns
the imaged sinogram
- Return type
array [TPY]
- Raises
ValueError – if the PSF is not 2D or 3D
-
cbi_toolbox.simu.imaging.fss_opt(obj, psf, illu, pad=False, **kwargs)[source]¶ Simulate the FSS-OPT (focal sheet scanning) imaging of an object
- Parameters
obj (array [ZXY]) – the object to be imaged
psf (array [ZXY] or array [XY]) – the PSF of the system
illu (array [ZXY]) – the illumination function of the SPIM
pad (bool, optional) – pad the vield of view to see all contributions if used, illu will be required to be bigger (required if the sample is not contained in the inner cylinder of the object), by default False
**kwargs – to be passed to the radon call
- Returns
the imaged sinogram
- Return type
array [TPY]
- Raises
ValueError – if the PSF dimensions do not fit the illumination if the illumination function has an incorrect shape
-
cbi_toolbox.simu.imaging.noise(image, photons=200, background=3, seed=None, in_place=False)[source]¶ - Simulate the acquisition noise of the camera:
noise = shot noise
- Parameters
image (array [ZXY]) – the clean image
photons (int, optional) – the max level of photons per pixel, by default 150
background (int, optional) – the background level of photons per pixel, by default 3
seed (int, optional) – the seed for rng, by default None
- Returns
the noisy image
- Return type
array [ZXY]
-
cbi_toolbox.simu.imaging.opt(obj, psf, theta=None, pad=False)[source]¶ Simulate the OPT imaging of an object
- Parameters
obj (array [ZXY]) – the object to be imaged, ZX must be square
psf (array [ZXY]) – the PSF of the imaging system, Z dimension must match object ZX
theta (array, optional) – array of rotation angles (in degrees), by default None If None, uses numpy.arange(180).
pad (bool, optional) – extend the field of view to see all contributions (needed if the object is not contained in the inner cylinder to the array), by default False
- Returns
the imaged sinogram
- Return type
array [TPY]
- Raises
ValueError – if the PSF dimension does not match the object
-
cbi_toolbox.simu.imaging.spim(obj, psf, illu, pad=False)[source]¶ Simulate the SPIM imaging of an object
- Parameters
obj (array [ZXY]) – the object to be imaged
psf (array [ZXY]) – the PSF of the imaging objective
illu (array [ZXY]) – the illumination function of the SPIM
pad (bool, optional) – pad the vield of view to see all contributions, by default False
-
cbi_toolbox.simu.imaging.widefield(obj, psf, pad=False)[source]¶ Simulate the widefield imaging of an object
- Parameters
obj (array [ZXY]) – the object to be imaged
psf (array [ZXY]) – the PSF of the imaging system
pad (bool, optional) – extend the field of view to see all contributions, by default False if False, the image will have the same size as the object
- Returns
the widefield image
- Return type
numpy.ndarray