You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When use LoadImage, the metadata "space" is always RAS, not reflecting the real orientation.
To Reproduce
Here is a minimal code snippet to reproduce the behavior:
# download a example 3D brain MRI file from the internetimportrequestsurl="http://www.neuromorphometrics.com/1103_3.tgz"r=requests.get(url)
withopen("1103_3.tgz", "wb") asf:
f.write(r.content)
# unzip the file and prepare the dataimporttarfiletar=tarfile.open("1103_3.tgz")
tar.extractall(path="1103_3")
tar.close()
# load the image with monai and antsimportnibabelasnibnib.Nifti1Header.quaternion_threshold=-1e-06fromantsimportimage_readfrommonai.transformsimportLoadImageloader=LoadImage(image_only=False)
img_monai=loader("1103_3/Data/1103/3/NIFTI/1103_3.nii")
print(f"MONAI Reading: {img_monai[1]['space']}")
img_ants=image_read("1103_3/Data/1103/3/NIFTI/1103_3.nii")
print(f"ANTS Reading: {img_ants.orientation}")
Expected behavior
It's expected to print out RSP, but it printed out RAS as always.
MONAI Reading: RAS
ANTS Reading: RSP
Environment
Ensuring you use the relevant python executable, please paste the output of:
================================
Printing MONAI config...
================================
MONAI version: 1.3.0
Numpy version: 1.24.4
Pytorch version: 2.0.0+cu117
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 865972f7a791bf7b42efbcd87c8402bd865b329e
Optional dependencies:
Pytorch Ignite version: 0.4.13
ITK version: NOT INSTALLED or UNKNOWN VERSION.
Nibabel version: 5.2.0
scikit-image version: 0.21.0
scipy version: 1.10.1
Pillow version: 10.2.0
Tensorboard version: 2.14.0
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: 0.15.1+cu117
tqdm version: 4.66.1
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 5.9.0
pandas version: 2.0.3
einops version: 0.7.0
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.
The text was updated successfully, but these errors were encountered:
Describe the bug
When use
LoadImage
, the metadata "space" is always RAS, not reflecting the real orientation.To Reproduce
Here is a minimal code snippet to reproduce the behavior:
Expected behavior
It's expected to print out RSP, but it printed out RAS as always.
Environment
Ensuring you use the relevant python executable, please paste the output of:
The text was updated successfully, but these errors were encountered: