[Insight-users] deformation field from image registration (beginner question)

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 12 14:16:27 EDT 2008


Hi Ramesh,

The DeformableRegistration5.cxx example is a 2D example.

You can run it by using the following command line:

DeformableRegistration5.exe
   RatLungSlice1.mha RatLungSlice2.mha output.mha deformation.vtk


The RatLungSlice images are available in the directory


               Insight/Examples/Data


The deformation field saved in the file "deformation.vtk" is
a written as a 3D dataset having only a single slice in the Z
direction.

More precisely its image size is:  "128 x 128 x 1"


You can read this image directly into *ParaView 3.2* (Please
update your ParaView, if you are using a previous version).

Then you must do the following in order to visualize the
deformation field correctly:


   a) Load the "deformation.vtk" file


   b) Use the "Calculator" filter and
      compose the expression

      scalars_0*iHat + scalars_1*jHat + 0*kHat

      (which is equivalent to: x.i + y.j + z.k)


   c) Select the output of the calculator, and use the Glyph
      filter with the following settings:

            Glyph Type   =  Arrow

            Orient checkbox: set to ON

            Scale mode : set to "vector"



At this point you should see the vectors from the deformation
field.

Keep in mind that they point *from the Fixed* image pixel
to its corresponding Moving image pixel.


Please let us know if you find any problem.


    Thanks


        Luis


-----------------
Ramesh ITK wrote:
> I'm trying to obtain the deformation field between a fixed image and a 
> moving image using ITK and I'm having trouble trying to read/view the 
> output field.
> 
> The moving image is of a deformed object where different regions have 
> different transformations (like in an inhomogeneous material).
> 
> I tried using the example code - DeformableRegistration5.cxx and the 
> given data files (RatLungSlice1 & 2)
> It let me save the deformation field only in vtk or mhd/mha format.
> How do I obtain the vector of displacements over the region?
> 
> Paraview crashes when I try to open the mha file.
> When I try the mhd file it fails and gives the following message.
> /ERROR: In 
> c:\berk\releasebuilds\paraview3\vtk\common\vtkDataArrayTemplate.txx, 
> line 133
> vtkFloatArray (05B871A8): Unable to allocate 1858633728 elements of size 
> 4 bytes. /
> It also displays that the zrange is from -nan to nan
> 
> I also tried reading the *.raw  files using what was mentioned in 
> http://www.itk.org/pipermail/insight-users/2003-December/005865.html but 
> that didn't help much.
> 
> I'm not sure about the following things-
> Am I using the right example code to do what I am looking for?
> Does ITK give the vector displacement field for registration between two 
> images (with different transformation matrices at different regions)?
> Can the displacement field be output directly as a text file instead of 
> a visual format?
> 
> I'd appreciate it if someone could point me in the right direction.
> 
> Thanks,
> Ramesh
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list