loaders

class pyraug.data.loaders.BaseDataGetter[source]

This is the Base data loader from which all future loaders must inherit.

class pyraug.data.loaders.ImageGetterFromFolder[source]

This loader allows you to load imagining data directly from a folder and convert it to np.ndarray. The data must be all located in a folder where each file is an image.

Handled types are (‘.pt’, ‘.nii’, ‘nii.gz’, ‘bmp’, ‘jpg’, ‘jpeg’, ‘png’)

classmethod is_handled_file(im_path)[source]

Checks if the path provided leads to an handable file

Parameters

im_path (str, os.Pathlike) – The path to the image

Returns

If True, the file exists and is an handable file

Return type

(bool)

classmethod load_image(im_path)[source]

Loads an image and returns an array.

Handled types are (‘.pt’, ‘.nii’, ‘nii.gz’, ‘bmp’, ‘jpg’, ‘jpeg’, ‘png’)

Parameters

im_path (str, os.Pathlike) – The path to the image

Returns

The loaded image of shape n_channels x [optional depth] x height x width

Return type

(np.array)