Skip to content

Commit

Permalink
added a jupyter notebook to show psf & otf profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Meizhu-Liang committed Mar 24, 2023
1 parent 2c3ac91 commit 86a22f6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
58 changes: 27 additions & 31 deletions Jupyter_SIMulator.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The calculation can be GPU-accelerated if the CUPY (tested with cupy 8.3.0) is i
Currently applies to:
- conventional 2-beam SIM data with 3 angles and 3 phases
- 3-beam hexagonal SIM data with 7 phases, as described in the paper
- 3-beam hexagonal SIM data with 7 phases at right-angles
- 3-beam hexagonal SIM data with 5 phases at right-angles

----------------------------------

Expand Down Expand Up @@ -46,6 +46,7 @@ To install latest development version :
## Usage

1) Open napari and create the viewer.
2) ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/hex.avi)


2) Launch the widget in ***Plugin***
Expand Down
2 changes: 1 addition & 1 deletion src/napari_generic_simulator/Illumination.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def jones_vectors(self, astep):

def _ill_obj(self, x, y, pstep, astep):
"""Illumination intensity applied on the object"""
ill = self.xp.sum(self._ill_test_vec(x, y, pstep, astep), axis=1) # take real part and round to 15 decimals
ill = self.xp.sum(self._ill_obj_vec(x, y, pstep, astep), axis=1) # take real part and round to 15 decimals
return ill

def _ill_obj_vec(self, x, y, pstep, astep):
Expand Down
5 changes: 3 additions & 2 deletions src/napari_generic_simulator/baseSIMulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,13 @@ def raw_image_stack_brownian(self):
otf_x = self.xp.fft.fftn(self.xp.fft.fftshift(psf_x, axes=0)) # need to set plane zero as in-focus here
otf_y = self.xp.fft.fftn(self.xp.fft.fftshift(psf_y, axes=0)) # need to set plane zero as in-focus here
otf_z = self.xp.fft.fftn(self.xp.fft.fftshift(psf_z, axes=0)) # need to set plane zero as in-focus here
aotf = abs(self.xp.fft.fftshift(otf)) # absolute otf
aotf = abs(self.xp.fft.fftshift(otf)) # absolute otf, also modulus of otf (MTF)
self.aotffile = np.sum(aotf, axis=(1, 2))
if self.acc == 3:
aotf = cp.asnumpy(aotf)
m = max(aotf.flatten())

self.aotf = np.log(aotf + aotf.max() / 1000) # 3d aotx with log
self.aotf = np.log(aotf + aotf.max() / 1000) # 3d aotf with log
if self.acc == 3:
self.aotf = cp.asnumpy(self.aotf)

Expand Down

0 comments on commit 86a22f6

Please sign in to comment.