protoclass.extraction.HaralickExtraction¶
-
class
protoclass.extraction.
HaralickExtraction
(base_modality, distance=1, patch_size=(9, 9, 3), levels=256)[source]¶ Haralick extraction from standalone modality.
Parameters: base_modality : object
The base modality on which the normalization will be applied. The base modality should inherate from StandaloneModality class.
distance : int, optional (default=1)
The distance used to compute the cooccurence matrix
patch_size : int or tuple, optional (default=(9, 9, 3))
The size of the sliding used to extract patches later used to compute the cooccurence matrix.
levels : int, optional (default=256)
The input image should contain integers in [0, levels-1], where levels indicate the number of grey-levels counted (typically 256 for an 8-bit image). This argument is required for 16-bit images or higher and is typically the maximum of the image. As the output matrix is at least levels x levels, it might be preferable to use binning of the input image rather than large values for levels.
Attributes
base_modality_ (object) The base modality on which the normalization will be applied. The base modality should inherate from StandaloneModality class. roi_data_ (ndarray, shape flexible) Corresponds to the index to consider in order to fit the data. Methods
fit
(modality[, ground_truth, cat])Compute the images images. load_from_pickles
(filename)Function to load a normalization object. save_to_pickles
(filename)Function to save a normalizatio object using pickles. transform
(modality[, ground_truth, cat])Extract the data from the given modality. Methods
__init__
(base_modality[, distance, ...])fit
(modality[, ground_truth, cat])Compute the images images. load_from_pickles
(filename)Function to load a normalization object. save_to_pickles
(filename)Function to save a normalizatio object using pickles. transform
(modality[, ground_truth, cat])Extract the data from the given modality. -
fit
(modality, ground_truth=None, cat=None)[source]¶ Compute the images images.
Parameters: modality : object of type TemporalModality
The modality object of interest.
ground-truth : object of type GTModality or None
The ground-truth of GTModality. If None, the whole data will be considered.
cat : str or None
String corresponding at the ground-truth of interest. Cannot be None if ground-truth is not None.
-
load_from_pickles
(filename)¶ Function to load a normalization object.
Parameters: filename : str
Filename to the pickle file. The extension should be .p.
Returns: bpp : object
Returns the loaded object.
-
save_to_pickles
(filename)¶ Function to save a normalizatio object using pickles.
Parameters: filename : str
Filename to the pickle file. The extension should be .p.
Returns: None
-
transform
(modality, ground_truth=None, cat=None)[source]¶ Extract the data from the given modality.
Parameters: modality : object of type StandaloneModality
The modality object of interest.
ground-truth : object of type GTModality or None
The ground-truth of GTModality. If None, the whole data will be considered.
cat : str or None
String corresponding at the ground-truth of interest. Cannot be None if ground-truth is not None.
Returns
——
data : ndarray, shape (n_sample, n_feature)
A matrix containing the features extracted. The number of samples is equal to the number of positive label in the ground-truth.
-