-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Distance of a point x in the moving image to a point y in the fixed image #410
Comments
<removing incorrect response to avoid confusion> |
is the order correct? seems like should be
see fig 8 and 9 in ants2.pdf |
Sorry, you're the expert, Brian, so I defer to you. But are you referring to the order as specified in |
i'm thinking of both ,,, eg to take a point in an image from fixed to moving physical space then it does: x_world = point in fixed image anyway the point is to compose the operations |
Oh, dumb of me, you're right---the registration operation is in that direction. |
The
Q1: Is that correct? I also have the maps
If I understand you correctly, to get the coordinates with respect to the moving image of a point y in the fixed image, which is given to us by its index (i,j,k), we do
Q2: Is this correct? On the other hand, to get the coordinates with respect to the fixed image of the point x in the moving image, which is given to us by its index (i,j,k), we do
or ... you see, this is where I am not sure. It could also be
Q3: Which is correct? The way in which I understood the text is
which is, well, non of the above. |
registration is very much about getting details right and being very specific. so i find it hard to answer the questions above except to say that none of the short hand looks correct to me but perhaps i am misinterpreting your meaning. one point of confusion is that you are using index notation so i'm not sure what ijk means etc wrt physical space which is what we use in itk/ants to define registration operations. in both fwd and inverse maps, you need to compose, not add. fwd is y = A( W( x ) ) inv is x = InvW( InvA( y ) ) if you are doing this correctly, of course. i would recommend testing against the chicken example |
Dear Brain, thank you for your reply, it is greatly appreciated. Of course, we think in world coordinates when doing registrations. As
As an end-user, I have access to the function
and this is why I have "added" the values of The displacement field
if I know the index of y in the moving image. I am sorry, when the phrasing of my original question wasn't as clear as |
in ITK, we interpolate transforms s.t. we can always use physical space. even displacement fields. x = InvW( InvA( y ) ) is correct. if you write this out in detail, it would be something like: x = InvW( InvAMatrix * y + Invt ) so you need to interpolate InvW at the physical coordinate. invt is the translation. |
Ok, I understand. Is there a more generic way of getting all the "new" world coordinates |
Not sure if this helps, but I have used antsApplyTransformsToPoints in
ANTsR. It takes a matrix Nx3 where N is the number of voxels, and gives the
new coordinates. It works quite fast. I think it relies on the same tool
available in ANTs.
Dorian
…On Tue, Feb 14, 2017 at 10:11 AM, Thomas W. D. Möbius < ***@***.***> wrote:
Ok, I understand.
Is there a more generic way of getting all the "new" world coordinates
of all pixels/voxels of the moving image?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#410 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIqafeMkPuRI0pAEFnkBRWtEzT0F3x4Cks5rccQ-gaJpZM4L8QLV>
.
|
Hi,
I have a comprehension question about the
0GenericAffine.mat
and the1Warp.nii.gz
file after running:For an arbitrary point
x
in the moving image, and a differentarbitrary point
y
in the fixed image, I would like to calculate thedistance of
x
toy
, afterx
has been mapped to the fixed image.In particular, I wonder if I have understood the "Affine transformation
file" on page 6, and the explanations of the file
1Warp.nii.gz
on page4 of the manual
correctly.
Sorry for bothering you with some Python code. It is just one line,
which I am not sure whether I have understood the manual correctly.
Thank you in advance.
Here is the actual code of interest: For completeness, the two helper
functions
apply_affine
andgeneric2affine
are attached at the bottom.My question concerns the following line: does
warp[i,j,k]
containthe deformation
u(x)
ifx = world_moving((i,j,k))
?Where
apply_affine
andgeneric2affine
are the functions:The text was updated successfully, but these errors were encountered: