Resampling the moving image?

View: New views
4 Messages — Rating Filter:   Alert me  

Resampling the moving image?

by motes motes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am current reading section 8.3 Features of the Registration
Framework of the itkSoftwareGuide.

The image registration method returns a set of final parameters that
maps the fixed image into the moving image space:

  F = original fixed image.
  M = original moving image.
  T = final transform parameters

  T(F) = M' = currently best known alignment wih the moving image.

So when T is applied to F a "best" approximate to the M is computed.


 Its possible to use T to compute (in the resampling process RS) the
"registered" image R which is the original moving image M mapped into
the fixed image space:

 RS = resampler
 RS(M,T) = R


But I don't understand how that works. Assume that a translation
transform T = (1,5)   is returned from the image registration process.
This means that translating all points in F with (x,y) = (1,5) gives a
pretty good approximation to M.



Now in the resampler is T simply negated meaning that T=(-1,-5) is
applied instead of T=(1,5)?

I don't think it makes much sense to apply T directly to M since that
would just further move M.

But I guess I am misunderstanding some basic stuff here.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Re: Resampling the moving image?

by Luis Ibanez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Motes,

If you have a Fixed image "F" and a Moving image "M",
and the output of your registration process is the transform
"T",

Then applying "T" to the *points* of the image F will give you
the coordinates of the corresponding points in the image M.

Following your example,
if the transform turns out to be a translation:

                                      T = (1,5)

That means that if we take a point P from the Fixed image
space, and P has coordinates P=(x,y), then we can find the
coordinates of its corresponding point Q in the Moving image
by the following operation:

                        Q = T(P) = ( x+1, y+5 )

The expression T(F) could be interpreted as "mapping all
the points from the fixed image".

T is indeed the transform that is used for resampling the
Moving image M into the coordinates of the Fixed image F.


The way resampling works, is by:

    A)  visiting all the pixels of the Fixed image,
    A.1) for each pixel, compute its physical coordinates
           in the space of the Fixed image
    A.2) Use the transform T to compute the corresponding
            point Q = T(P) in the moving image space
    A.3) convert Q from the physical coordinates of the moving
            image into the grid coordinates of the moving image
    A.4)  Apply an interpolator as needed.

Please note that in the resampling process we DO NOT
NEGATE the transform T.    We use exactly the SAME
transform that is the result of the registration process.

That transform is always the one that maps points from
the physical space of the Fixed image, into the physical
space of the Moving image.


The best way to understand this is to truly try to
writer a resampler from scratch. This exercise
will make evident to you, why is that the direction
of the Transform must go from the Fixed image space
to the Moving image space.


       Regards,


              Luis


---------------------------------------------------------------------------------
On Wed, Nov 4, 2009 at 6:55 AM, motes motes <mort.motes@...> wrote:

> I am current reading section 8.3 Features of the Registration
> Framework of the itkSoftwareGuide.
>
> The image registration method returns a set of final parameters that
> maps the fixed image into the moving image space:
>
>  F = original fixed image.
>  M = original moving image.
>  T = final transform parameters
>
>  T(F) = M' = currently best known alignment wih the moving image.
>
> So when T is applied to F a "best" approximate to the M is computed.
>
>
>  Its possible to use T to compute (in the resampling process RS) the
> "registered" image R which is the original moving image M mapped into
> the fixed image space:
>
>  RS = resampler
>  RS(M,T) = R
>
>
> But I don't understand how that works. Assume that a translation
> transform T = (1,5)   is returned from the image registration process.
> This means that translating all points in F with (x,y) = (1,5) gives a
> pretty good approximation to M.
>
>
>
> Now in the resampler is T simply negated meaning that T=(-1,-5) is
> applied instead of T=(1,5)?
>
> I don't think it makes much sense to apply T directly to M since that
> would just further move M.
>
> But I guess I am misunderstanding some basic stuff here.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Re: Resampling the moving image?

by motes motes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Nov 8, 2009 at 7:47 PM, Luis Ibanez <luis.ibanez@...> wrote:

> Hi Motes,
>
> If you have a Fixed image "F" and a Moving image "M",
> and the output of your registration process is the transform
> "T",
>
> Then applying "T" to the *points* of the image F will give you
> the coordinates of the corresponding points in the image M.
>
> Following your example,
> if the transform turns out to be a translation:
>
>                                      T = (1,5)
>
> That means that if we take a point P from the Fixed image
> space, and P has coordinates P=(x,y), then we can find the
> coordinates of its corresponding point Q in the Moving image
> by the following operation:
>
>                        Q = T(P) = ( x+1, y+5 )
>
> The expression T(F) could be interpreted as "mapping all
> the points from the fixed image".
>
> T is indeed the transform that is used for resampling the
> Moving image M into the coordinates of the Fixed image F.
>
>
> The way resampling works, is by:
>
>    A)  visiting all the pixels of the Fixed image,
>    A.1) for each pixel, compute its physical coordinates
>           in the space of the Fixed image
>    A.2) Use the transform T to compute the corresponding
>            point Q = T(P) in the moving image space
>    A.3) convert Q from the physical coordinates of the moving
>            image into the grid coordinates of the moving image
>    A.4)  Apply an interpolator as needed.
>

Ok but that is the exact same thing that goes on in the registration
method in the metric so I don't see any difference between how the
transform is applied in the registration method and how its used in
the resampler.

Is it because the moving image is in fact passed to the resampler as
input and is now treated as the fixed image?

I have tried to compute a know transformation of the fixed image using
the BSplineWarping1.cxx where I specify the fixed image as input for
both the fixed image and the moving image. The result is a deformed
version of the fixed image which I use as the moving image in the
registration process.

When the registration process is complete I take the final transform
parameters and apply those to the original fixed image. Basically I
just  run the BSplineWarping1.cxx example again but with the paramters
produced in the registration method. Below is the result:

http://37133.vs.webtropia.com/apache2-default/test/grid.jpg

Now this looks wierd. When I apply the transform from the registration
process to the fixed image I get something that looks like the
"inverted" version of the moving image.

Should the result not look like the deformed image?
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Re: Resampling the moving image?

by Luis Ibanez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Motes,

When you say that you "apply the transform" to the fixed image,
do you mean that you are resampling the Fixed image by using
the Transform ?

If so,
there is no surprise that the outcome looks like the inverse transform.

Once again,
the Transform that ITK computes is intended to represent the mapping
of points from the Fixed image coordinate system, to the Moving image
coordinate system, because that is the mapping that is required for
resampling the Moving image intensity values into the space of the Fixed
image.

You should not resample, the Fixed image,
you should resample the Moving image.


   Regards,


      Luis


-------------------------------------------------
On Thu, Nov 12, 2009 at 6:16 PM, motes motes <mort.motes@...> wrote:

> On Sun, Nov 8, 2009 at 7:47 PM, Luis Ibanez <luis.ibanez@...> wrote:
>> Hi Motes,
>>
>> If you have a Fixed image "F" and a Moving image "M",
>> and the output of your registration process is the transform
>> "T",
>>
>> Then applying "T" to the *points* of the image F will give you
>> the coordinates of the corresponding points in the image M.
>>
>> Following your example,
>> if the transform turns out to be a translation:
>>
>>                                      T = (1,5)
>>
>> That means that if we take a point P from the Fixed image
>> space, and P has coordinates P=(x,y), then we can find the
>> coordinates of its corresponding point Q in the Moving image
>> by the following operation:
>>
>>                        Q = T(P) = ( x+1, y+5 )
>>
>> The expression T(F) could be interpreted as "mapping all
>> the points from the fixed image".
>>
>> T is indeed the transform that is used for resampling the
>> Moving image M into the coordinates of the Fixed image F.
>>
>>
>> The way resampling works, is by:
>>
>>    A)  visiting all the pixels of the Fixed image,
>>    A.1) for each pixel, compute its physical coordinates
>>           in the space of the Fixed image
>>    A.2) Use the transform T to compute the corresponding
>>            point Q = T(P) in the moving image space
>>    A.3) convert Q from the physical coordinates of the moving
>>            image into the grid coordinates of the moving image
>>    A.4)  Apply an interpolator as needed.
>>
>
> Ok but that is the exact same thing that goes on in the registration
> method in the metric so I don't see any difference between how the
> transform is applied in the registration method and how its used in
> the resampler.
>
> Is it because the moving image is in fact passed to the resampler as
> input and is now treated as the fixed image?
>
> I have tried to compute a know transformation of the fixed image using
> the BSplineWarping1.cxx where I specify the fixed image as input for
> both the fixed image and the moving image. The result is a deformed
> version of the fixed image which I use as the moving image in the
> registration process.
>
> When the registration process is complete I take the final transform
> parameters and apply those to the original fixed image. Basically I
> just  run the BSplineWarping1.cxx example again but with the paramters
> produced in the registration method. Below is the result:
>
> http://37133.vs.webtropia.com/apache2-default/test/grid.jpg
>
> Now this looks wierd. When I apply the transform from the registration
> process to the fixed image I get something that looks like the
> "inverted" version of the moving image.
>
> Should the result not look like the deformed image?
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users