Spacing transform only changes spacing in x- and y-axes, not in z-axis #8219
Unanswered
JaroKuiken
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @JaroKuiken,
output:
Hope it helps, thanks. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I have an MRI dataset where each patient has a scan volume of 720 slices of 100x720 (where each slice is a DICOM image), so a shape of (720, 100, 720). They have an isotropic voxel spacing ranging from around 0.2 to 0.4mm. I want to retain the spacing in the x- and y-axes, but change the spacing in the z-axis to 1.6mm. For this i have been trying to use the Spacing transform. I have been able to change the spacing in the x- and y-axes, which was clearly visible in both the resulting shape change of the images and when plotting them. So i know the transform does work on my images, but the spacing in the z-axis refuses to change somehow.
I think it might have to do with how i load my images. I tried to use the LoadImage by itself, but it kept complaining about the affines of slices within the same volume not being the same. So instead i used the LoadImage but with a custom ImageReader, based on: https://simpleitk.readthedocs.io/en/master/link_DicomSeriesReader_docs.html. This allowed me to still load the images with the LoadImage transform, which (i thought) meant that i could use all the MONAI transforms as well. However it turns out that some transforms, such as the Orientation and ScaleIntensityRangePercentiles do work, while changing the spacing in the z-axis using the Spacing transform does not.
The code im currently running:
Most of this all seems to go correctly, except for the Spacing transform. I would expect the shape of the 3D volume to become about 4-8x smaller in the z-axis, as im increasing the spacing by that much. However, the shape only changes in the x- and y-axes if i indicate that in the Spacing transform, but it never changes in the z-axis. I have looked at putting the values in the 'pixdim' value in every possible configuration, or the patient specific spacing values instead of -1, but the same issue stays. I am starting to think it might be related to my custom ImageReader, but i am also not sure what the issue there would be. Does anyone know what the issue might be or how to solve it?
Beta Was this translation helpful? Give feedback.
All reactions