andreabassi78 / napari-psf-simulator

widget for PSF simulation with aberrations
BSD 3-Clause "New" or "Revised" License
25 stars 1 forks source link

Ask help for choosing a correct refective index in psf_generator #4

Closed ZhenhongDu closed 1 year ago

ZhenhongDu commented 1 year ago

Dear Professor, I want to use the core function psf_generator.py to generate a detection PSF of a light-sheet microscopy. I'm a little confused about the choice of refractive index n0 in this line n0 in psf_generator. The objective lens we use is an air-objective(n0 = 1). But our sample is immersed in a refractive index matching fluid(n1 = 1.522), which means that light is propagating in air first and then focused in a sample through the refractive index matching fluid. Should I use n1 as the refractive index used in the class PSF_simulator? Different RI values produced a totally different 3D PSF.

andreabassi78 commented 1 year ago

Hi @dzh929, you should use the Slab Aberration tool, where n0 is the index of refraction of the objective (1 in your case), n1 is the index of refraction of the sample/ medium, and you should specify the propagation length in the medium (thickness). Please note that the code is not validated for high NAs. This will be included in a few months.
The line you indicate is confusing: n is the refractive index for the objective, but the in-line comment indicates "object" because it was written before including aberrations (n objective was n object). Hope this clarifies.

ZhenhongDu commented 1 year ago

Dear Professor, Thanks for your kind and quick guide @andreabassi78 , it helped me a lot. This had bothered me for a while and I'm glad to finally have it fixed. However, I still had some questions about the generation of light-sheet illumination 3D point spread function.

  1. I don not know how to choose a proper value for waistx and waist_ratio. Could I get some references from the literature.

  2. The PSF of the light sheet is determined by the product of the PSF of the illumination and the PSF of the detection. In general, the voxel size is anisotropic. The pixel size in the x direction is different from the pixel size in the z direction, which means I can not use 'add_lightsheet_pupil' function to generate the illumination psf that is used to multiply the detection psf. The orientation defined in the program appears to be the same as the diagram. image

    Remacha, E., Friedrich, L., Vermot, J., & Fahrbach, F. (2020). How to define and optimize axial resolution in light-sheet microscopy: a simulation-based approach. Biomedical Optics Express, 11 1, 8-26.

  3. In addition, I think the link below misses an argument self.k_theta https://github.com/andreabassi78/napari-psf-simulator/blob/a512166f60f7f7067bf3653e6022bf1af03b57fa/src/napari_psf_simulator/psf_generator.py#L255

  4. According to the line blow https://github.com/andreabassi78/napari-psf-simulator/blob/a512166f60f7f7067bf3653e6022bf1af03b57fa/src/napari_psf_simulator/psf_generator.py#L121 n_1 sin(θ_1 + alpha) = n_0 sin(θ_0 + alpha) Is the α set to 0 for a general case? Indicating that the slab is flat.

Thanks for your guide! And sorry to bother you.

Your sincerely Zhenhong Du

ZhenhongDu commented 1 year ago

After using the Slab Aberration tool, there is a significant defocus of the center in the Z-direction of detection psf, as shown in the figure below

    gen0 = PSF_simulator(NA_EM, n0, em_wvl, Nxy, Nz,
                        dr=dxy, dz=dz)
    gen0.add_slab_scalar(n1, thickness, alpha)
    gen0.generate_pupil()
    gen0.generate_3D_PSF()

To generate a real light-sheet psf, I changed the center of the illumination psf in z direction. Is this operation reasonable?

image

andreabassi78 commented 1 year ago

Hi @dzh929, sorry for taking so long. Unfortunately, I still don't have a simple way to calculate the actual defocus in case of slab aberration, and the software just subtracts the main defocus due to the presence of the glass. It seems that you find a reasonable solution. Did you move the light sheet "by eye" or did you calculate a displacement that you should have in theory for this slab?

andreabassi78 commented 1 year ago

After using the Slab Aberration tool, there is a significant defocus of the center in the Z-direction of detection psf, as shown in the figure below

    gen0 = PSF_simulator(NA_EM, n0, em_wvl, Nxy, Nz,
                        dr=dxy, dz=dz)
    gen0.add_slab_scalar(n1, thickness, alpha)
    gen0.generate_pupil()
    gen0.generate_3D_PSF()

To generate a real light-sheet psf, I changed the center of the illumination psf in z direction. Is this operation reasonable?

image

Light sheet mode is not included in the napery-PSF-simulator plugin. Yet, if you want to use the internal functions:

  1. waist_x is the waist of a gaussian beam focused on the pupil, waist_ratio is the ratio between the waist_x and waist_y.
  2. if you want an isotropic sampling, you could choose dxy = dz
  3. thanks, corrected in the current version available on guthub
  4. alpha=0 means flat