-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Spacing transform does not update pixdim
#6832
New issue
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
Comments
yes, the image's original |
Does it mean we don't need to modify it or we may enhance it in the future? |
We don't have a good reason to modify it at the moment, a single source of truth for the original and current pixdim seems to be consistent and easy to maintain.. |
According to the issue, this PR addresses on the meta dictionary `data['pixdim']` of NIfTI images does not update after applying the `spacing` or `spacingd`. To align with `affine`, we update `data['pixdim']` and keep the original metainfo in `data['original_pixdim']`. Additionally, this PR also update the metainfo `key_{meta_key_postfix}['pixdim']` in NIfTI images, consistent with `spaced_data_dict['image_meta_dict']['pixdim']` in issue Project-MONAI#6832. Signed-off-by: Wei_Chuan, Chiang <[email protected]> Co-authored-by: einsyang723 <[email protected]> Co-authored-by: IamTingTing <[email protected]>
According to the issue, this PR addresses on the meta dictionary `data['pixdim']` of NIfTI images does not update after applying the `spacing` or `spacingd`. To align with `affine`, we update `data['pixdim']` and keep the original metainfo in `data['original_pixdim']`. Additionally, this PR also update the metainfo `key_{meta_key_postfix}['pixdim']` in NIfTI images, consistent with `spaced_data_dict['image_meta_dict']['pixdim']` in issue Project-MONAI#6832. Signed-off-by: Wei_Chuan, Chiang <[email protected]> Co-authored-by: einsyang723 <[email protected]> Co-authored-by: IamTingTing <[email protected]>
Discussed in #6831
Originally posted by agaldran August 7, 2023
Hello,
Sorry about the naive question, I am trying to wrap my head around transforms and meta_dicts. Right now I have the following operations:
which returns a shape and voxel sizes of
[281, 313, 182]
and(0.50,0.50,0.75)
respectively. Now, if I run:I am expecting to see approx half the voxels in the Z direction, as the original spacing was 0.75 and I am asking for twice that spacing. For the other directions, nothing should be changed^* . This is what I get:
So, although the number of voxels are as expected, the spacing remains the same. I cannot find any other key in the meta data dictionary that tells me what is the current spacing for this volume. Am I doing something wrong here?
The text was updated successfully, but these errors were encountered: