ConfocalBlurGenerator3D#
- class deepinv.physics.generator.ConfocalBlurGenerator3D(psf_size, num_channels=1, device='cpu', dtype=torch.float32, list_param=['Z4', 'Z5', 'Z6', 'Z7', 'Z8', 'Z9', 'Z10', 'Z11'], NI=1.51, NA=1.37, lambda_ill=489e-9, lambda_coll=395e-9, pixelsize_XY=50e-9, pixelsize_Z=100e-9, pinhole_radius=1, max_zernike_amplitude=0.1, pupil_size=(512, 512))[source]#
Bases:
PSFGenerator
Generates the 3D point spread function of a confocal laser scanning microsope.
- Parameters:
psf_size (tuple) – give in the order (depth, height, width)
num_channels (int) – number of channels. Default to 1.
list_param (list[str]) – list of activated Zernike coefficients, defaults to
["Z4", "Z5", "Z6","Z7", "Z8", "Z9", "Z10", "Z11"]
NI (float) – Refractive index of the immersion medium. Defaults to 1.51 (oil),
NA (float) – Numerical aperture. Should be less than NI. Defaults to 1.37.
lambda_ill (float) – Wavelength of the illumination light (fluorescence excitation). Defaults to 489e-9.
lambda_coll (float) – Wavelength of the collection light (fluorescence emission). Defaults to 395e-9.
pixelsize_XY (float) – Physical pixel size in the lateral direction (height, width). Defaults to 50e-9.
pixelsize_Z (float) – Physical pixel size in the axial direction (depth). Defaults to 100e-9.
pinhole_radius (float) – Radius of pinhole in Airy units. Defaults to 1.
max_zernike_amplitude (float) – maximum amplitude of Zernike coefficients. Defaults to 0.1.
pupil_size (tuple[int]) – this is used to synthesize the super-resolved pupil. The higher the more precise, defaults to (512, 512). If an int is given, a square pupil is considered.
- Returns:
a DiffractionBlurGenerator object
- Examples:
>>> import torch >>> from deepinv.physics.generator import ConfocalBlurGenerator3D >>> generator = ConfocalBlurGenerator3D((21, 51, 51), list_param=['Z0']) >>> dict = generator.step() >>> filter = dict['filter'] >>> print(filter.shape) torch.Size([1, 1, 21, 51, 51]) >>> batch_size = 2 >>> n_zernike = len(generator.generator_ill.generator2d.list_param) >>> dict = generator.step(batch_size=batch_size, ... coeff_ill = 0.1 * torch.rand(batch_size, n_zernike, **generator.factory_kwargs), ... coeff_coll = 0.1 * torch.rand(batch_size, n_zernike, **generator.factory_kwargs)) >>> dict.keys() dict_keys(['filter', 'coeff_ill', 'coeff_coll'])
- step(batch_size=1, coeff_ill=None, coeff_coll=None, **kwargs)[source]#
Generate a batch of 3D confocal PSF with a batch of Zernike coefficients for illumination and collection
- Returns:
dictionary with keys ‘filter’: tensor of size (batch_size x num_channels x psf_size[0] x psf_size[1]) batch of psfs, ‘coeff_ill’: list of sampled Zernike coefficients in this realization of illumination, ‘coeff_coll’: list of sampled Zernike coefficients in this realization of collection,
- Return type: