train_tools.data_utils.custom.LoadImage

Module Contents

class train_tools.data_utils.custom.LoadImage.CustomLoadImage(reader=None, image_only: bool = False, dtype: monai.config.DtypeLike = np.float32, ensure_channel_first: bool = False, *args, **kwargs)[source]

Bases: monai.transforms.LoadImage

Load image file or files from provided path based on reader. If reader is not specified, this class automatically chooses readers based on the supported suffixes and in the following order:

  • User-specified reader at runtime when calling this loader.

  • User-specified reader in the constructor of LoadImage.

  • Readers from the last to the first in the registered list.

  • Current default readers: (nii, nii.gz -> NibabelReader), (png, jpg, bmp -> PILReader), (npz, npy -> NumpyReader), (nrrd -> NrrdReader), (DICOM file -> ITKReader).

[!Caution] This overriding replaces the original ITK with Custom UnifiedITKReader.

readers = [][source]
class train_tools.data_utils.custom.LoadImage.CustomLoadImaged(keys: monai.config.KeysCollection, reader: monai.data.image_reader.ImageReader | str | None = None, dtype: monai.config.DtypeLike = np.float32, meta_keys: monai.config.KeysCollection | None = None, meta_key_postfix: str = DEFAULT_POST_FIX, overwriting: bool = False, image_only: bool = False, ensure_channel_first: bool = False, simple_keys=False, allow_missing_keys: bool = False, *args, **kwargs)[source]

Bases: monai.transforms.LoadImaged

Dictionary-based wrapper of CustomLoadImage.

meta_keys[source]
meta_key_postfix[source]
overwriting = False[source]