niftynet.evaluation.region_properties module¶

class
RegionProperties
(seg, img, measures, num_neighbors=6, threshold=0, pixdim=(1, 1, 1))[source]¶ Bases:
object
This class enables the extraction of image features (Harilick features) and basic statistics over a segmentation

centre_of_mass
()[source]¶ Calculates the centre of mass of the segmentation using the threshold to binarise the initial map
Returns:

volume
¶ this provides a decorator to cache function outputs to avoid repeating some heavy function computations

surface
¶ this provides a decorator to cache function outputs to avoid repeating some heavy function computations

glcm
()[source]¶ Creation of the grey level cooccurrence matrix. The neighbourhood distance is set to 1 in this instance. All neighborhood shifts are calculated for each modality
Returns: multi_mod_glcm list of m (number of modalities) matrices of size bin x bin x neigh

harilick_matrix
()[source]¶ this function populates the matrix of harilick features for each image modality and neighborhood shift and average over the neighbours
Returns:

call_asm
()[source]¶ Extracts the angular second moment features from the harilick matrix of features. Length of the output is the number of modalities
Returns:

call_contrast
()[source]¶ Extracts the contrast feature from the harilick matrix of features
Returns:

call_correlation
()[source]¶ Extracts the correlation feature from the harilick matrix of features
Returns:

call_sum_square
()[source]¶ Extracts the sum square feature from the harilick matrix of features
Returns:

call_sum_average
()[source]¶ Extracts the sum average feature from the harilick matrix of features
Returns:

call_idifferent_moment
()[source]¶ Extracts the inverse difference of moment feature from the harilick matrix of features
Returns:

call_sum_entropy
()[source]¶ Extracts the sum entropy features from the harilick matrix of features
Returns:

call_difference_variance
()[source]¶ Extracts the difference variance from the harilick matrix of features
Returns:

call_difference_entropy
()[source]¶ Extracts the difference entropy features from the harilic matrix of features
Returns:

call_sum_variance
()[source]¶ Extracts the difference entropy features from the harilick matrix of features
Returns:

call_imc1
()[source]¶ Extracts the first information measure of correlation from the harilick matrix of features
Returns:

call_imc2
()[source]¶ Extracts the second information measure of correlation from the harilick matrix of features
Returns:

harilick
(matrix)[source]¶ Creates the vector of harilick features for one glcm matrix. Definition of the Harilick features can be found in
Textural features for image classification Robert Harilick K, Shanmugam and Its’Hak Dinstein in IEEE Transactions on systems, man and cybernetics Vol SMC3 issue 6 pp610621Parameters: matrix – glcm matrix on which to calculates the Harilick features Returns:

angular_second_moment
(matrix)[source]¶ Calculates the angular second moment
Parameters: matrix – Returns:

homogeneity
(matrix)[source]¶ Calculates the homogeneity over the glcm matrix
Parameters: matrix – Returns:

correlation
(matrix)[source]¶ Calculates the correlation over the glcm matrix
Parameters: matrix – Returns:

inverse_difference_moment
(matrix)[source]¶ Calculates the inverse difference moment over the glcm matrix
Parameters: matrix – Returns:

sum_average
(matrix)[source]¶ Calculates the sum average over the glcm matrix
Parameters: matrix – Returns:

sum_entropy
(matrix)[source]¶ Calculates the sum entropy over the glcm matrix
Parameters: matrix – Returns:

sum_variance
(matrix)[source]¶ Calculates the sum variance over the glcm matrix
Parameters: matrix – Returns:

difference_variance_entropy
(matrix)[source]¶ Calculates the difference of variance entropy over the glcm matrix
Parameters: matrix – Returns:

information_measure_correlation
(matrix)[source]¶ Calculates the two measures of information measure of correlation over the glcm matrix
Parameters: matrix – Returns: ic_1, ic_2

sum_square_variance
(matrix)[source]¶ Calculates the sum of square variance over the glcm matrix
Parameters: matrix – Returns:

sav
()[source]¶ Calculates the Surface area / Volume ratio in terms of Probabilistic Count, Binarised count, Probabilistic Volume, Binarised Volume
Returns:

compactness
()[source]¶ Calculates the compactness S^1.5/V in terms of probabilistic count, binarised count, probabilistic volume, binarised volume
Returns:

weighted_mean_
()[source]¶ Calculates the weighted mean of the image given the probabilistic segmentation. If binary, mean and weighted mean will give the same result
Returns:

std_
()[source]¶ calculates the standard deviation of the image over the binarised segmentation
Returns:

quantile_25
()[source]¶ calculates the first quartile of the image over the binarised segmentation
Returns:
