linumpy.intensity.attenuation#
Attenuation estimation and profile recovery models for OCT volumes.
Functions#
|
Estimates the attenuation coefficient using the Vermeer2013 model. |
|
Compute the local effective tissue attenuation using the extended Vermeer model. |
|
Estimates the attenuation coefficient using the Faber2004 model. |
|
Model the oct signal using a single-scattered photons and the confocal PSF. |
|
Split an A-line into contiguous masked segments. |
|
Compute the attenuation coefficient for each A-lines. |
|
Compute the attenuation coefficient using the log-gradient method. |
|
Compute a mask excluding tissue interfaces and boundaries. |
|
Find the tissue-water interface depth map using gradient magnitude. |
|
Compute heterogeneous attenuation coefficients for each A-line segment. |
Estimate and remove the flat agarose intensity profile from a volume. |
|
|
Estimate the signal from the 2D A-Line attenuation map. |
Module Contents#
- linumpy.intensity.attenuation.get_attenuation_vermeer2013(vol, dz=6.5e-06, mask=None, C=None)[source]#
Estimates the attenuation coefficient using the Vermeer2013 model.
- Parameters:
vol (ndarray) – 3D Reflectivity OCT data
dz (float) – Axial resolution (in microns/pixel)
mask (ndarray) – Tissue mask (optional). Every pixel above the mask will be attributed null attenuation, and pixel under the mask will be set to the last computed Aline attenuation.
- Returns:
Estimated attenuation coefficient map (same size as vol)
- Return type:
ndarray
Notes
This algorithm is inspired by an ultrasound attenuation compensation method.
References
Vermeer et al. Depth-resolved model-based reconstruction of attenuation coefficients in optical coherence tomography. Biomed. Opt. Exp., vol5, no1, pp332-337, 2013
- linumpy.intensity.attenuation.get_extended_attenuation_vermeer2013(vol, mask=None, k=10, sigma=5, sigma_bottom=3, dz=1, res=6.5, zshift=3, fill_holes=False)[source]#
Compute the local effective tissue attenuation using the extended Vermeer model.
- Parameters:
vol (ndarray) – OCT volume to process
mask (ndarray) – Optional tissue mask. If none is given the water/tissue interface will be detected from the data.
k (int) – Median filter kernel size (px) applied before the attenuation coefficient computation (applied in the XY direction).
sigma (int) – Gaussian filter kernel size (px) applied axially before the exponential signal fit used to extend the Alines for the extended Vermeer signal evalution.
sigma_bottom (int) – Gaussian filter kernel size (px) applied axially on the bottom slice signal before the extension fit.
fill_holes (bool) – If True, fill holes in the tissue mask before computing attenuation.
dz (int) – Number of axial pixel to consider when computing the bottom slice signal for the signal extension.
res (float) – Axial resolution in micron / pixel
zshift (int) – Number of pixel under the water-tissue interface to ignore while fitting the exponential function for signal extension.
- Returns:
Computed attenuation coefficients.
- Return type:
ndarray
- linumpy.intensity.attenuation.get_attenuation_faber2004(vol, mask=None, dz=6.5e-06, N=4)[source]#
Estimates the attenuation coefficient using the Faber2004 model.
- Parameters:
- Returns:
Estimated attenuation coefficient map (computes a single mu_t per A-line)
- Return type:
ndarray
Notes
This algorithm uses the confocal PSF and an single-scattering photon model.
Assumes a 4X objective setup for now.
References
Faber et al. Quantitative measurement of attenuation coefficients of weakly scattering media using optical coherence tomography. Opt. Express 12, 4353-4365 (2004).
- linumpy.intensity.attenuation.oct_signal_faber2004_model(z, mu_t=1.0, zR=200.0, z0=100.0)[source]#
Model the oct signal using a single-scattered photons and the confocal PSF.
- Parameters:
z ((N,) ndarray) – Depth Position along an A-line at which the signal must be computed (in micron)
mu_t (float or (N,) ndarray) – Attenuation coefficient (either a single value for the whole column or N values for each position)
zR (float) – Apparent Rayleigh length (in micron)
z0 (float) – Focal plane depth (in micron)
- Returns:
OCT backscattering signal estimated at each z positions
- Return type:
ndarray
Notes
This is based on the single-scattering photon model from Faber2004.
References
- linumpy.intensity.attenuation.split_aline(data, mask)[source]#
Split an A-line into contiguous masked segments.
- Parameters:
data (numpy.ndarray)
mask (numpy.ndarray)
- Return type:
- linumpy.intensity.attenuation.get_aline_attenuation(vol, k=1, mask=None)[source]#
Compute the attenuation coefficient for each A-lines.
- Parameters:
vol (ndarray) – Volume to analyze of size NxMxL
k (int) – Number of points to compute
mask (ndarray) – Tissue mask to limit the region where the fit is done.
- Returns:
Estimated attenuation of size NxMxk
- Return type:
ndarray
- linumpy.intensity.attenuation.get_gradient_attenuation(vol, mask=None, return_mask=False, low_thresh=0.0, fill_holes=False, sz=3, sxy=0, res=1.0)[source]#
Compute the attenuation coefficient using the log-gradient method.
- Parameters:
vol (numpy.ndarray)
mask (numpy.ndarray | None)
return_mask (bool)
low_thresh (float)
fill_holes (bool)
sz (int)
sxy (int)
res (float)
- Return type:
- linumpy.intensity.attenuation.get_interface_mask(vol, s=0, mask_tissue=True, mask_water_tissue_interface=True)[source]#
Compute a mask excluding tissue interfaces and boundaries.
- Parameters:
vol (numpy.ndarray)
s (int)
mask_tissue (bool)
mask_water_tissue_interface (bool)
- Return type:
- linumpy.intensity.attenuation.find_interface_from_gradient(vol, f=0.005, remove_smooth=False)[source]#
Find the tissue-water interface depth map using gradient magnitude.
- Parameters:
vol (numpy.ndarray)
f (float)
remove_smooth (bool)
- Return type:
- linumpy.intensity.attenuation.get_heterogeneous_attenuation(vol, mask=None, fill_holes=False)[source]#
Compute heterogeneous attenuation coefficients for each A-line segment.
- Parameters:
vol (numpy.ndarray)
mask (numpy.ndarray | None)
fill_holes (bool)
- Return type:
- linumpy.intensity.attenuation.get_flat_agarose_profile(vol: numpy.ndarray, return_mask_and_profile: Literal[False] = ...) numpy.ndarray[source]#
- linumpy.intensity.attenuation.get_flat_agarose_profile(vol: numpy.ndarray, return_mask_and_profile: Literal[True]) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Estimate and remove the flat agarose intensity profile from a volume.