protoclass.data_management.GTModality

class protoclass.data_management.GTModality(path_data=None)[source]

Class to handle GT modality.

Parameters:

path_data : str, list of str, or None, optional (default=None)

The folder in which the data are stored.

Attributes

path_data_ (str or list of str) Location of the data.
data_ (ndarray, shape (GT, Y, X, Z)) The different volume of the GT volume. The data are saved in GT, Y, X, Z ordered.
n_serie_ (int) The number of ground-truth volume. Refer to cat_gt_ to know the information associated to each volume.
cat_gt_ (list of str) Categorical labels associated with each ground-truth volume read.

Methods

extract_gt_data(label[, output_type]) Extract data corresponding to a given label.
is_read() Function to know if the data have been read.
read_data_from_path(cat_gt[, path_data]) Read GT images which correspond to a 3D volume, a volume for different information.
update_histogram() Method to compute histogram and statistics.
__init__(path_data=None)[source]

Methods

__init__([path_data])
extract_gt_data(label[, output_type]) Extract data corresponding to a given label.
is_read() Function to know if the data have been read.
read_data_from_path(cat_gt[, path_data]) Read GT images which correspond to a 3D volume, a volume for different information.
update_histogram() Method to compute histogram and statistics.
extract_gt_data(label, output_type='index')[source]

Extract data corresponding to a given label.

Parameters:

label : str

Label of the ground-truth to extract.

output_type : str, optional (default=’index’)

Type of the desired output. The choices are.

  • If ‘index’, the index corresponding to the positive class will

be returned. - If ‘data’, the full ground-truth data will be returned.

Returns:

output : ndarray

The output data. Depends of the arguments output_type

is_read()

Function to know if the data have been read.

Returns:

is_read : bool

If True, the data have been read at least once.

read_data_from_path(cat_gt, path_data=None)[source]

Read GT images which correspond to a 3D volume, a volume for different information.

Parameters:

cat_gt : list of str

Categorical label affected to each ground-truth volume read.

path_data : str, list or None, optional (default=None)

Path to the temporal data. It will overrides the path given in the constructor.

Returns:

self : object

Returns self.

Notes

This function overwrite the function of MultisequenceModality since that a GT can contain only one sequence as well.

update_histogram()[source]

Method to compute histogram and statistics.