We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Saving a Dicom image into Nifti, and load the nifti, we should get the same data representation.
To Reproduce
import itk from monai.transforms import Compose, EnsureChannelFirstD, LoadImageD, SaveImageD img_dir = "tests/testing_data/CT_DICOM" data_dict = {"img": img_dir} keys = data_dict.keys() xforms = Compose( [ LoadImageD(keys, reader="itkreader", pixel_type=itk.UC), EnsureChannelFirstD(keys), ] ) img_dict = xforms(data_dict) # load dicom with itk save_xform = SaveImageD(keys, meta_keys="img_meta_dict", output_dir=".") save_xform(img_dict) # save to nifti new_xforms = Compose( [ LoadImageD(keys, reader="itkreader"), EnsureChannelFirstD(keys), ] ) out = new_xforms({"img": "CT_DICOM/CT_DICOM_trans.nii.gz"}) # load nifti with itk print(img_dict["img"].shape) print(out["img"].shape) print(img_dict["img_meta_dict"]["affine"]) print(out["img_meta_dict"]["affine"]) print(img_dict["img_meta_dict"]["spatial_shape"]) print(out["img_meta_dict"]["spatial_shape"])
inconsistent output:
(1, 4, 16, 16) (1, 16, 16, 4) [[ 0.488281 0. 0. -125. ] [ 0. 0.488281 0. -128.100006 ] [ 0. 0. 68.33333333 -99.480003 ] [ 0. 0. 0. 1. ]] [[ -0.48828101 0. 0. 125. ] [ 0. -0.48828101 0. 128.1000061 ] [ 0. 0. 68.33333588 -99.48000336] [ 0. 0. 0. 1. ]] [ 4 16 16] [16 16 4]
this is an integration issue of nibabel writer <=> itk reader
The text was updated successfully, but these errors were encountered:
wyli
Successfully merging a pull request may close this issue.
Describe the bug
Saving a Dicom image into Nifti, and load the nifti, we should get the same data representation.
To Reproduce
inconsistent output:
this is an integration issue of nibabel writer <=> itk reader
The text was updated successfully, but these errors were encountered: