Differentiation¶
Module to calculate various curvature and tube measures in 3D |
|
Module to compute curvature measures based on Hessian Matrix |
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.
-
eigenvalues
(source, sink=None, sigma=None)[source]¶ Hessiean 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 along the first axis for each source.
-
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.
-
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 tubness 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.