[Insight-users] invert deformable field

Luis Ibanez luis.ibanez at kitware.com
Thu, 12 Feb 2004 17:52:06 -0500


Hi Corinne,


Subsampling the input field by a small factor
will result in a quite large number of landmarks
that you probably don't need. It is likely that
memory allocation is failing at that point.


Here are some options:

[Option A]

Probably we should create a variant of this
class with a smarter sampling that instead of
using a regular grid, sets landmarks in the
regions of large deformation. That will make
a better use of the memory and the landmarks.

A simple option is that after the regular grid
resampling, we could visit all the generated
landmarks and eliminate all those having deformation
lower than a certain threshold. The KernelSpline
has the great advantage of not requiring the landmarks
to be in a regular grid.

You could do this elimination in the method
PrepareKernelBaseSpline() in the "while" loop
on lines 191-207. Simply check the magnitude
of "value" to be over the threshold before
creating a landmark with it.



[Option B]

Another interesting option is what Harald suggested
at some point which is to use this class as just
an initializer for a more refined method that will
iteratively increase the precision of the inverse
field. Some sort of redistribution of error could
do the job. That is, if F is the Forward field
and B is the estimation of the backward field, we
would expect for a point p in the destination
space to satisfy

         p ==  F(  B(  p  ) )

in practice of course, there will be some error

        Dp = p - F( B( P ) )

We could redistribute this error in B by cheking
which one of the neighbors of B( p ) will have
a forward mapping that is closer to p.

That is, in 2D for example, you locate q = B( p )
then check the points

     q1 = q + ( 1, 0)
     q2 = q + (-1, 0)
     q3 = q + ( 0,-1)
     q4 = q + ( 0, 1)

and find which one has a forward mapping closer to p.
So you test F(q1), F(q2), F(q3), F(q4), and once you
figure out which one is a better candidate, then
you modify the backward deformation B(p) at pixel p
by and ammount that will bring q closer to the best
candidate.  Note that you can refine one pixel at
a time or do an entire visit over B before comming
back to the same pixel.  You could also carry on
corrections, that is, take the correction of the
previous pixel as a first estimation of the correction
needed in the current pixel.



[Option C]

A third option is to not follow the evolution of
the forward field by walkig along the deformations
but just by staying in the same pixel. In this
approach you simply take for the same pixel all
the previous forward deformation vector and fit
a curve to them, then extrapolate for the next
time step. That's probably simpler to implement
than the two approaches above,... but it may also
be less meaningful.



-----


I would suggest you to try first the approach
of reducing the number or landmakrs with  a
deformation threshold (let say eliminate all
the landmaks that deform their pixel image by
less than 1mm). This threshold of could will
be set by the user through a Set() method.




Please let us know if you find this to be useful
so we can do the equivalent modifications in the
repository.



Thanks,



    Luis


-------------------------------------

Corinne Mattmann wrote:

> Hi,
> 
> I would like to predict a future deformable field from several fields
> from the past. It is not too difficult to calculate the future shift in
> a pixel by going through the deformable fields, taking always the
> closest point (as a first approach). But then I just have the vector
> where I have to shift this pixel intensity to ("forward field"). However
> to use the warpImageFilter and to actually apply this field I need a
> "backward field". Therefore I have to invert the field I get.
> I tried using the DeformationFieldInverseImageFilter (is this what I
> need?) but I had to use a subsampling factor of 6 (for a 50x50x50 image)
> to get an acceptable speed which is not at all accurate enough for my
> images. When I chose a smaller value (4), the program crashed.
> Do you have any ideas how else I could get an inversed deformable field?
> Or is there even another possibility to predict a deformable field from
> several others?
> 
> Thanks very much,
> Corinne
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>