diff --git a/monai/transforms/io/array.py b/monai/transforms/io/array.py index dc43475b63..5ee17e6268 100644 --- a/monai/transforms/io/array.py +++ b/monai/transforms/io/array.py @@ -99,6 +99,10 @@ class LoadImage(Transform): - Current default readers: (nii, nii.gz -> NibabelReader), (png, jpg, bmp -> PILReader), (npz, npy -> NumpyReader), (nrrd -> NrrdReader), (DICOM file -> ITKReader). + Please note that for png, jpg, bmp, and other 2D formats, readers often swap axis 0 and 1 after + loading the array because the `HW` definition for non-medical specific file formats is different + from other common medical packages. + See also: - tutorial: https://github.com/Project-MONAI/tutorials/blob/master/modules/load_medical_images.ipynb diff --git a/monai/transforms/io/dictionary.py b/monai/transforms/io/dictionary.py index 761c891e85..a1f088b498 100644 --- a/monai/transforms/io/dictionary.py +++ b/monai/transforms/io/dictionary.py @@ -51,6 +51,10 @@ class LoadImaged(MapTransform): - Current default readers: (nii, nii.gz -> NibabelReader), (png, jpg, bmp -> PILReader), (npz, npy -> NumpyReader), (dcm, DICOM series and others -> ITKReader). + Please note that for png, jpg, bmp, and other 2D formats, readers often swap axis 0 and 1 after + loading the array because the `HW` definition for non-medical specific file formats is different + from other common medical packages. + Note: - If `reader` is specified, the loader will attempt to use the specified readers and the default supported