ClearMap.ImageProcessing.Differentiation#
Module to calculate various gradient and curvature measures
- gradient(source)[source]#
Returns the finite difference gradient vector at each point.
Arguments
- sourcearray
The data source.
Returns
- gradientarray
A (ndim,) + source.shape array of the finte differences alon each axis.
- gradient_abs(source)[source]#
Returns the absolute magnitude of the gradient vector at each point.
Arguments
- sourcearray
The data source.
Returns
- absarray
Sum of the absolute values of the gradient vector entries.
- gradient_square(source)[source]#
Returns the square sum of the gradient vector entries.
Arguments
- sourcearray
The data source.
Returns
- absarray
Sum of the absolute values of the gradient vector entries.
- hessian(source, sink=None, sigma=None)[source]#
Returns the hessian matrix at each location calculatd via finite differences.
Arguments
- sourcearray
Input array.
- sinkarray
Output, if None, a new array is allocated.
Returns
- hessianarray:
5d array with the hessian matrix in the first two dimensions.
- hessian_eigensystem(source, sink=None, sigma=None, eigenvectors=3)[source]#
Hessian eigensystem of source data
Arguments
- sourcearray
Input array.
- sinkarray
Output, if None, a new array is allocated.
- sigmafloat or None
If not None, a Gaussian filter with std sigma is applied initialliy.
Returns
- sinkarray
The three eigenvalues and up to 3 eigenvectors of the Hessian matrix of the source.
- hessian_eigenvalues(source, sink=None, sigma=None)[source]#
Hessian eigenvalues of source data
Arguments
- sourcearray
Input array.
- sinkarray
Output, if None, a new array is allocated.
- sigmafloat or None
If not None, a Gaussian filter with std sigma is applied initialliy.
Returns
- sinkarray
The three eigenvalues of the Hessian matrix of the source.
- lambda123(source, sink=None, gamma12=1.0, gamma23=1.0, alpha=0.25, sigma=None, threshold=None)[source]#
Generalized tubness measure of source data.
Arguments
- sourcearray
Input array.
- sinkarray
Output, if None, a new array is allocated.
- gamma12, gamma23, alphafloat
Parameters for the tubeness measure.
- sigmafloat or None
If not None, a Gaussian filter with std sigma is applied initialliy.
Returns
- sinkarray
The tubness measure.
Note
Reference: Sato et al. Three-dimensional multi-scale line filter for segmentation and visualization of curvilinear structures in medical images, Medical Image Analysis 1998, pp 143–168.
- tubeness(source, sink=None, threshold=None, sigma=None)[source]#
Tubeness mesure of source data
Arguments
- sroucearray
Input array.
- sinkarray
Output, if None, a new array is allocated.
- thresholdfloat or None
If float, the tubeness is thresholded at this level.
- sigmafloat or None
If not None, a Gaussian filter with std sigma is applied initialliy.
Returns
- sink3-D array
Tubness output.
Note
The tubness is the geometric mean of the two smallest eigenvalues.
Sub-packages and modules#
Module to calculate various curvature and tube measures in 3D
Module to compute curvature measures based on Hessian Matrix
Cython code for Hessian eigenvalue calculation.