How to overwrite spacing of ScalarImage ? #828
-
Hi, I have several 3D stacks and annotations that can be either in dicom or tiff format. The spacing are not necessarily correct inside the dicom or tiff files so when I try to access data with augmentation from the dataloader I end up with this error:
But I don't want to Resample my data as I know that the scaling are wrong and that one voxel in one image correspond to one voxel in one segmenttation. So I tried to overwrite the spacing of my images:
But then I get the bellow error:
So here is my question: how can I overwrite the spacing on a Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi In the mean time you can try to copy the affine from your image to you label with the transform |
Beta Was this translation helpful? Give feedback.
-
Actually you can trust dicom information, but I am not sure on the tiff one (this is not a volume format) |
Beta Was this translation helpful? Give feedback.
Hi
not sure how to explicitely set the affine (that will define the spacing). may be @fepegar has an idea how to achieve it ... ?
In the mean time you can try to copy the affine from your image to you label with the transform
CopyAffine
Thus you will have 2 coherent affine (and then spacing) but depending on the transform you used after this may not be enough (because having the correct affine is important, for instance for Resampling )