<br>Hi Ganesh,<br><br>The code that you are using is producing the <br>deformation field but it is not saving it into a file.<br><br>Please note that the code from this Insight Journal <br>paper was added to ITK a while ago.<br>
<br>You will find it now in<br><br>Insight/Code/Review/<br> itkDiffeomorphicDemonsRegistrationFilter.h<br> itkDiffeomorphicDemonsRegistrationFilter.txx<br><br>and<br><br>Insight/Testing/Code/Review<br> itkDiffeomorphicDemonsRegistrationFilterTest.cxx<br>
itkDiffeomorphicDemonsRegistrationFilterTest2.cxx<br><br><br><br>The deformation field is actually the output of the<br>DiffeomorphicDemons filter.<br><br>See line 299 of <br><br> itkDiffeomorphicDemonsRegistrationFilterTest.cxx:<br>
<br> warper->SetDeformationField( registrator->GetOutput() );<br><br><br>and line 206 of <br><br> itkDiffeomorphicDemonsRegistrationFilterTest2.cxx:<br>
<br> warper->SetDeformationField( registrator->GetOutput() );<br><br><br>Note also that both of these examples are *already*<br>deforming the moving image by applying to it the <br>deformation field via the WarpImageFilter.<br>
<br><br>If you want to save the Deformation field into a file,<br>you just need to add:<br><br>typedef itk::ImageFileWriter< FieldType > FieldWriterType;<br>FieldWriterType::Pointer fieldWriter = FieldWriterType::New();<br>
fieldWriter->SetFileName("deformationField.mhd");<br>fieldWriter->SetInput( demonsRegistration->GetOutput() );<br>fieldWriter->Update();<br><br><br><br> Regards,<br><br><br> Luis<br>
<br><br><br>---------------------------------------------------------------------------------<br><div class="gmail_quote">On Fri, Apr 16, 2010 at 11:00 AM, Ganesh Narayanasamy <span dir="ltr"><<a href="mailto:nganesh76@hotmail.com">nganesh76@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<br>Thanks for your suggestions. I have been using 3D-Slicer for viewing the images.<br>What I would like to do is use diffeomorphic demons algorithm developed by Vercauteren T et al. (<a href="http://www.insight-journal.org/browse/publication/154" target="_blank">http://www.insight-journal.org/browse/publication/154</a>) to register a pair of image volumes and apply the resulting deformation onto a 3rd image volume.<br>
The command used for registering images I1, I2 is:<br><br>>DemonsRegistration.exe -f I1.mha -m I2.mha -o OutputI1I2.mha -a 1 -l 0.5 -s 0.8 -i 50x50x50 -d 1<br><br>This command generates these output files:<br> WarpedGridImage.mha<br>
TransformJacobianDeteminant.mha<br> OutputI1I2.mha<br> ForwardWarpedGridImage.mha<br> and<br> metricvalues.xls<br><br>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?<br>
<br>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:<br><br>> WarpImageFilter1 I3.mha WarpedGridImage.mha Final.mha<br>
<br>Thank you,<div class="im"><br>Ganesh<br><br><font color="#1f497d" face="Verdana">************************************************************************</font><font color="#1f497d" face="Verdana"><br></font><font color="#1f497d" face="Verdana">
"What the mind of man can conceive and believe, It can achieve" - </font><font color="#1f497d" face="Verdana"><span>Napolean</span></font><font color="#1f497d" face="Verdana"> </font><font color="#1f497d" face="Verdana"><span>Hill</span></font><font color="#1f497d" face="Verdana"><br>
</font><font color="#1f497d" face="Verdana">
-Ganesh
Narayanasamy,Ph.D., PostDoc-University of Kentucky Cancer Center</font><font color="#1f497d" face="Verdana"><br></font><font color="#1f497d" face="Verdana">
Earlier work:
<a href="http://www.sciencedaily.com/releases/2007/05/070504133017.htm" target="_blank">http://www.sciencedaily.com/releases/2007/05/070504133017.htm</a></font><font color="#1f497d" face="Verdana"><br></font><font color="#1f497d" face="Verdana">
************************************************************************</font><br> <br></div>> Message: 2<br>> Date: Thu, 15 Apr 2010 21:36:36 -0400<div class="im"><br>> From: Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>><br>
</div>> Subject: Re: [Insight-users] Deformable transform<br>> To: Ganesh Narayanasamy <<a href="mailto:nganesh76@hotmail.com" target="_blank">nganesh76@hotmail.com</a>><br>> Cc: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
> Message-ID:<br>>         <<a href="mailto:g2gf7abd23c1004151836n31198261ze51659653f880167@mail.gmail.com" target="_blank">g2gf7abd23c1004151836n31198261ze51659653f880167@mail.gmail.com</a>><br>> Content-Type: text/plain; charset="iso-8859-1"<div>
<div></div><div class="h5"><br>> <br>> Hi Ganesh,<br>> <br>> You may want to use the<br>> <br>> <a href="http://www.itk.org/Doxygen/html/classitk_1_1WarpImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1WarpImageFilter.html</a><br>
> <br>> You may also find useful the "vv" application:<br>> <br>> <a href="http://www.creatis.insa-lyon.fr/rio/vv" target="_blank">http://www.creatis.insa-lyon.fr/rio/vv</a><br>> <br>
> It provides functionalities for visualizing the outcome of deformable<br>> registration, including the overlapping of the deformation field.<br>> <br>> <br>> Regards,<br>> <br>> <br>> Luis<br>
> <br>> <br>> ------------------------------------------------------------------<br>> On Mon, Apr 12, 2010 at 5:17 PM, Ganesh Narayanasamy<br>> <<a href="mailto:nganesh76@hotmail.com" target="_blank">nganesh76@hotmail.com</a>>wrote:<br>
> <br>> ><br>> > We have 2 sets of 3D-CT data, one from radiotherapy planning CT (call it as<br>> > image I1) and another one is a cone-beam CT on the treatment table (image<br>> > I2). Performing a deformable registration on these gives us a deformation<br>
> > field, say DF.<br>> > I would like to see how the individual structures have deformed between<br>> > image I1 and image I2. The structure that we are interested in (say, S1) is<br>> > masked from image I1 and DF should be applied on it. We would like to see<br>
> > how this structure has deformed in the image I2 (its new form is called say,<br>> > S2).<br>> > Error = || DF(S1) - S2 ||<br>> ><br>> > Can you help me in applying DF onto S1. Probably for a few out there, this<br>
> > is probably trivial. Should I write a new set of code or is there something<br>> > that is already available?<br>> ><br>> > Thanks,<br>> > Ganesh<br>> ><br><br>                                            <br></div>
</div><hr>The New Busy is not the old busy. Search, chat and e-mail from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3" target="_blank">Get started.</a></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>