-
Notifications
You must be signed in to change notification settings - Fork 240
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
Unexpected transformation when using RandomAffine/RandomElasticDeformation #1214
Comments
Hello so if you rotate the slice plan, then you end up with a much smaller field of view (within the slice) Affine and elastic deformation are in 3D and your data are almost in 2D.
(you may adapt the axis set to zero depending on the axis of you slices) for RandomElasticDeformation I do not know if one can constrain it to 2D deformation only) |
I agree with @romainVala.
Yes, you can e.g. set max. displacement to 0 along the shorter dimension. By the way, how did you generate that volume? I suspect the voxel spacing is not correct. |
Thank you! I changed as your suggestion but the error are till same. I even set all the degree to 0 such as: tio.RandomAffine(degree=(0,0,0)) but nothing change. |
I used the resampling preprocessing step of the nnUNet project to resample the volume data to the same (1x1x1 mm) spacing. I also tried to use your "tio.ToCanonical()" first but the error still occurred whenever I use ElasticDeformation and Affine. |
Can you please share the image and a minimal working example? |
Is there an existing issue for this?
Problem summary
Hi, thank you for your work!
I got a problem and hope you can help. My model has 2 input images and two corresponding masks for the segmentation task. I want two images transformed the same (and also masks). The image and mask inputs shape are all (1, 8, 224,224). I tried to use other transformation such as Flip, Noise, Blur, Motion,... and they worked. However, whenever I tried to use RandomAffine or RandomElasticDeformation, the image are transformed unexpectedly (I used 3Dslicer to visualize), and their output shapes are still correct. Do you have any idea for this?
This is before transformation:
And this is after transformation:
Code for reproduction
Actual outcome
nothing
Error messages
No response
Expected outcome
nothing
System info
No response
The text was updated successfully, but these errors were encountered: