linumpy.intensity.psf_model#
Confocal PSF model fitting and volume-based PSF estimation.
Functions#
|
Compute an average volume for a specific slice. |
|
Detect the focal plane depth in a volume. |
|
Evaluate the piece-wise OCT intensity profile model. |
|
Volume intensity normalization using GLM fit. |
|
Volume intensity normalization. |
|
Radiometric transformation function. |
|
Global radiometric objective function. |
|
Confocal PSF model using a gaussian beam. |
|
Compute the lateral resolution at each depth using the confocal PSF model. |
|
Estimates the confocal PSF assuming a gaussian beam. |
|
Compute a 3D PSF from a given uniform volume (e.g. agarose). |
|
Fit a confocal tissue intensity profile model to depth data. |
Module Contents#
- linumpy.intensity.psf_model.get_average_volume(data, z, mask=None, s=0)[source]#
Compute an average volume for a specific slice.
- Parameters:
- Returns:
Average volume.
- Return type:
ndarray
- linumpy.intensity.psf_model.find_focal_depth(vol)[source]#
Detect the focal plane depth in a volume.
- Parameters:
vol (ndarray) – Volume in which the focal plane is detected
- Returns:
The focal plane depth
- Return type:
- linumpy.intensity.psf_model.i_profile_piece_wise_model(z, I0, Imax, z0, zf, s, mu, k)[source]#
Evaluate the piece-wise OCT intensity profile model.
- Parameters:
- Return type:
- linumpy.intensity.psf_model.glm_volume_normalization(vol, average_vol)[source]#
Volume intensity normalization using GLM fit.
- Parameters:
vol (ndarray) – Volume to normalize
average_vol (ndarray) – Average volume representing the background or objective profile without tissue
- Returns:
Normalized volume
- Return type:
ndarray
- linumpy.intensity.psf_model.volume_normalization(vol, average_vol, epsilon=0.05)[source]#
Volume intensity normalization.
- Parameters:
vol (ndarray) – Volume to normalize
average_vol (ndarray) – Average volume representing the background or objective profile without tissue
epsilon (float (optional, 0 < epsilon < 1)) – Small constant to prevent zero-division
- Returns:
Normalized volume.
- Return type:
ndarray
- linumpy.intensity.psf_model.T_r(p, x, y)[source]#
Radiometric transformation function.
- Parameters:
- Returns:
Function evaluated at given positoin
- Return type:
int or ndarray
- linumpy.intensity.psf_model.f_r(x, data, z, pos, i_mean)[source]#
Global radiometric objective function.
- Parameters:
x (tuple) – Radiometic function parameters to evaluate. (Should be a (6,) tuple)
data ((slicecode.utils.FileUtils.data object)) – Data object used to iterate over volumes or images.
z (int) – Slice number over which the function is evaluated.
pos (ndarray) – Volume absolute positions computed with the shift_oct module
i_mean (float) – Average volume / image intensity across all tiles.
- Returns:
Objective function evaluation for parameters x.
- Return type:
Notes
This method is an implementation of [Sun2006](http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2818.2006.01687.x/full)
- linumpy.intensity.psf_model.confocal_psf(z, zf, zR, A=None)[source]#
Confocal PSF model using a gaussian beam.
- linumpy.intensity.psf_model.get_slice_resolutions_from_psf(zf, zr, nz=120, spacing=(6.5, 6.5, 6.5), N=512, lam=1.03)[source]#
Compute the lateral resolution at each depth using the confocal PSF model.
- linumpy.intensity.psf_model.estimate_psf(agarose, interface=None, dz=6.5, remove_saturation=False, mask_interface=False, zf=None, fit_attn=False)[source]#
Estimates the confocal PSF assuming a gaussian beam.
- Parameters:
agarose (ndarray) – Agarose volume
interface (ndarray) – Water-Tissue interface map
dz (float) – Z spacing in micron
remove_saturation (bool) – If True, remove saturated pixels before fitting.
mask_interface (bool) – If True, mask the tissue interface region before fitting.
zf (float, optional) – Fixed focal plane depth. If None, it is estimated.
fit_attn (bool) – If True, also fit the attenuation parameter.
- Returns:
float – Focal plane depth
float – Rayleigh length
float – Normalization constant
- Return type:
Notes
If no interface is given, the whole volume is used for the psf regression
- linumpy.intensity.psf_model.get_3d_psf(vol, interface, res=6.5, use_average_rayleigh=False, remove_interface=True, zf=None)[source]#
Compute a 3D PSF from a given uniform volume (e.g. agarose).
- Parameters:
vol (ndarray) – Agarose / Background volume to use for the PSF computation
interface (ndarray) – Water/Tissue interface depth map (in pixel)
res (float) – Z axis resolution (in micron / pixel)
use_average_rayleigh (bool) – Use average Rayleigh length instead of the Rayleigh map.
remove_interface (bool) – If True, mask the tissue interface before computing the PSF.
zf (ndarray, optional) – Fixed focal depth map. If None, it is estimated from data.
- Returns:
ndarray – PSF
ndarray – Focal depth map
ndarray – Rayleigh length map
- Return type: