Referential related to Affine transform #693
Replies: 2 comments 3 replies
-
|
Edit: TL;DR: The arguments are being used to create an inverse LPS transform. Hi, @romainVala. Nice research. SimpleITK uses LPS. I've experimented and googled a bit. I just found this sentence in this SimpleITK notebook:
So I guess the parameters passed to This is what I would expect:
But the opposite happens as explained above.
But the opposite happens as explained above. It has taken me a while to understand, but I think I do now. Does all this make sense? |
Beta Was this translation helpful? Give feedback.
-
|
I've modified import torchio as tio
scales = (
0.5, 0.5, # make smaller
)
degrees = (
0, 0,
0, 0,
10, 10, # move nose to the left
)
translation = (
50, 50, # move right
0, 0,
50, 50, # move up
)
colin = tio.datasets.Colin27()
transform = tio.RandomAffine(
scales=scales,
degrees=degrees,
translation=translation,
)
transformed = transform(colin)
print(transformed.history)
transformed.t1.plot()I'll open a PR. I need to think about how and whether the documentation should be updated. I hope you can provide some feedback about that :) |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I try to understand what is the referential used when I do a Affine transform
So I just test successive "unitary" transform (tx, ty, tz, rx, ry, rz), save the results to see what really happend
If the translation and rotation are relative to a RAS referential, I would expect,
a positive tx, would move my volume to the subject right
ty -> move to subject Anterior
tz -> move the volume toward Superior -(top)
For rotation I use the "thumb rule" to get the expected direction
Rx -> should move the anterior part toward the top
Ry -> should move the left part toward the top
Rz -> should move the anterior part toward the left
When I compare to what I obtain in a viewer, I get opposite direction only for tz, and Rz
which mean a referential of RAI ... which does not make sense ...
what do I miss ?
Looking at the code, it seems you do not do any kind of conversion from RAS to LPS when you apply a given affine, (which is apply with sitk ...) so I would expect to have a LPS referential
but I probably get again confused, with this confusing notions ...
Beta Was this translation helpful? Give feedback.
All reactions