[Insight-users] Deformable transform

Luis Ibanez luis.ibanez at kitware.com
Sun Apr 18 14:01:23 EDT 2010


Hi Ganesh,

The code that you are using is producing the
deformation field but it is not saving it into a file.

Please note that the code from this Insight Journal
paper was added to ITK a while ago.

You will find it now in

Insight/Code/Review/
     itkDiffeomorphicDemonsRegistrationFilter.h
     itkDiffeomorphicDemonsRegistrationFilter.txx

and

Insight/Testing/Code/Review
   itkDiffeomorphicDemonsRegistrationFilterTest.cxx
   itkDiffeomorphicDemonsRegistrationFilterTest2.cxx



The deformation field is actually the output of the
DiffeomorphicDemons filter.

See line 299 of

   itkDiffeomorphicDemonsRegistrationFilterTest.cxx:

  warper->SetDeformationField( registrator->GetOutput() );


and line 206 of

   itkDiffeomorphicDemonsRegistrationFilterTest2.cxx:

  warper->SetDeformationField( registrator->GetOutput() );


Note also that both of these examples are *already*
deforming the moving image by applying to it the
deformation field via the WarpImageFilter.


If you want to save the Deformation field into a file,
you just need to add:

typedef itk::ImageFileWriter< FieldType > FieldWriterType;
FieldWriterType::Pointer fieldWriter = FieldWriterType::New();
fieldWriter->SetFileName("deformationField.mhd");
fieldWriter->SetInput( demonsRegistration->GetOutput() );
fieldWriter->Update();



       Regards,


             Luis



---------------------------------------------------------------------------------
On Fri, Apr 16, 2010 at 11:00 AM, Ganesh Narayanasamy <nganesh76 at hotmail.com
> wrote:

>
> Thanks for your suggestions. I have been using 3D-Slicer for viewing the
> images.
> What I would like to do is use diffeomorphic demons algorithm developed by
> Vercauteren T et al. (
> http://www.insight-journal.org/browse/publication/154) to register a pair
> of image volumes and apply the resulting deformation onto a 3rd image
> volume.
> The command used for registering images I1, I2 is:
>
> >DemonsRegistration.exe -f I1.mha -m I2.mha -o OutputI1I2.mha -a 1 -l 0.5
> -s 0.8 -i 50x50x50 -d 1
>
> This command generates these output files:
>  WarpedGridImage.mha
>  TransformJacobianDeteminant.mha
>  OutputI1I2.mha
>  ForwardWarpedGridImage.mha
>  and
>  metricvalues.xls
>
> I can see that WarpedGridImage.mha is the deformation warping grid, but
> which one of these files is the deformation field ? Is there a way to
> convert these output mha files into tif format as 3D-Slicer cannot convert
> some of them?
>
> As stated above, I would like to apply the resulting deformation onto a 3rd
> image volume, say, I3 and this can be done using WarpImageFilter1.exe.
> Should the command be like:
>
> > WarpImageFilter1 I3.mha WarpedGridImage.mha Final.mha
>
> Thank you,
>
> Ganesh
>
> ************************************************************************
> "What the mind of man can conceive and believe, It can achieve" - Napolean
> Hill
> -Ganesh Narayanasamy,Ph.D., PostDoc-University of Kentucky Cancer Center
> Earlier work:
> http://www.sciencedaily.com/releases/2007/05/070504133017.htm
> ************************************************************************
>
> > Message: 2
> > Date: Thu, 15 Apr 2010 21:36:36 -0400
>
> > From: Luis Ibanez <luis.ibanez at kitware.com>
> > Subject: Re: [Insight-users] Deformable transform
> > To: Ganesh Narayanasamy <nganesh76 at hotmail.com>
> > Cc: insight-users at itk.org
> > Message-ID:
> > <g2gf7abd23c1004151836n31198261ze51659653f880167 at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
>
> >
> > Hi Ganesh,
> >
> > You may want to use the
> >
> > http://www.itk.org/Doxygen/html/classitk_1_1WarpImageFilter.html
> >
> > You may also find useful the "vv" application:
> >
> > http://www.creatis.insa-lyon.fr/rio/vv
> >
> > It provides functionalities for visualizing the outcome of deformable
> > registration, including the overlapping of the deformation field.
> >
> >
> > Regards,
> >
> >
> > Luis
> >
> >
> > ------------------------------------------------------------------
> > On Mon, Apr 12, 2010 at 5:17 PM, Ganesh Narayanasamy
> > <nganesh76 at hotmail.com>wrote:
> >
> > >
> > > We have 2 sets of 3D-CT data, one from radiotherapy planning CT (call
> it as
> > > image I1) and another one is a cone-beam CT on the treatment table
> (image
> > > I2). Performing a deformable registration on these gives us a
> deformation
> > > field, say DF.
> > > I would like to see how the individual structures have deformed between
> > > image I1 and image I2. The structure that we are interested in (say,
> S1) is
> > > masked from image I1 and DF should be applied on it. We would like to
> see
> > > how this structure has deformed in the image I2 (its new form is called
> say,
> > > S2).
> > > Error = || DF(S1) - S2 ||
> > >
> > > Can you help me in applying DF onto S1. Probably for a few out there,
> this
> > > is probably trivial. Should I write a new set of code or is there
> something
> > > that is already available?
> > >
> > > Thanks,
> > > Ganesh
> > >
>
>
> ------------------------------
> The New Busy is not the old busy. Search, chat and e-mail from your inbox. Get
> started.<http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3>
>
> _____________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100418/06af6972/attachment.htm>


More information about the Insight-users mailing list