[Insight-users] Deformation Registration File Type

Luis Ibanez luis.ibanez at kitware.com
Sat Apr 3 18:01:08 EDT 2010


Hi Stephen,

Thanks for letting us know of your progress.

The effect that you are referring to is due to the fact that
Paraview actually expects vector fields to have three
components (3-dimensions), while the files that you are
creating right now only have 2 components.

The solution is simple:

you use first the "Calculator" filter in ParaView.


This is explained in detail in the ITK Software Guide

           http://www.itk.org/ItkSoftwareGuide.pdf

in Section 8.15:
"Visualizing Deformation Fields"
in pdf-page 501-503.


In particular you should read

Section 8.15.1:
"Visualizing 2D Deformation Fields"
in pdf-page 502.


and pay special attention to figure 8.54,
that shows the use of the calculator.

What you do with the calculator is
to compose the expression:

               dx . i  + dy . j  + dz . z

where dx,dy,dz are the components of the deformation
field, and i,j,z are the unit vectors, that in Paraview are
called "i hat", "j hat", "k hat".

In your case, you only have dx, dy, and must use zero
for dz.



     Regards,


          Luis


---------------------------------------------------------
On Fri, Apr 2, 2010 at 1:21 PM, Stephen Yip <stephen.fyip1 at gmail.com> wrote:
> Hi,
>
> Thank you for the useful suggestion. I do have a question though.
>
> Ok. I set my output vector field in DeformableRegsitration6 example as a mhd
> file. It ran smoothly without any complain, which is very nice. I then get 2
> output files for the vector field (one mhd and one raw files).
>
> I display the mhd file in ParaView. I found there is one component
> (x-component) of the vector, while the other one is missing (see
> attachment).
>
> Did I do anything wrong? or Did I overlook something important?
>
> It might be a little hard to see in the attachment. But I am pretty sure the
> vector field has x and y-component since the deformed image is nice. I just
> don't know where the other component goes.
>
> Thank you very much,
> Stephen
>
>
>
> On Thu, Apr 1, 2010 at 5:28 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>>
>> Hi Stephen,
>>
>> My mistake.
>>
>> PNG is not suitable here, because the images in question
>> have "float" pixel type.
>>
>> It is better, therefore, to use "MetaImage" as a fileformat,
>> by simply using .mhd as the filename extension.
>>
>> We have made these changes now in this file in the
>> CVS repository:
>>
>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Examples/Registration/DeformableRegistration1.cxx?root=Insight&r1=1.33&r2=1.34&sortby=date
>>
>>
>> We also added try/catch blocks, so that the next time
>> that there is an IO failure, you will get a more informative
>> message.
>>
>>
>> Finally,
>> we also modified the use of .hdr in the
>> FEMRegistration filter itself:
>>
>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Algorithms/itkFEMRegistrationFilter.txx?root=Insight&r1=1.59&r2=1.60&sortby=date
>>
>>
>>            Regards,
>>
>>
>>                   Luis
>>
>>
>> ---------------------------------------------------
>> On Tue, Mar 30, 2010 at 12:16 PM, Stephen Yip <stephen.fyip1 at gmail.com>
>> wrote:
>> > Hi Luis,
>> >
>> > I changed "hdr" to "png". But then I got the following error message.
>> >
>> > "This application has requested the Runtime to terminate it in an
>> > unusual
>> > way. Please contact the application's support team for more
>> > information."
>> >
>> > stephen
>> >
>> > On Sat, Mar 27, 2010 at 12:36 PM, Luis Ibanez <luis.ibanez at kitware.com>
>> > wrote:
>> >>
>> >> Hi Stephen,
>> >>
>> >> Please read the source code of the example.
>> >>
>> >> You will find the ".hdr" extensions in lines:
>> >>
>> >>
>> >> 269:     std::string ofn="fixed.hdr";
>> >>
>> >> 274:     ofn="moving.hdr";
>> >>
>> >>
>> >> Simply replace this extensions with the ones
>> >> that you want to use.
>> >>
>> >> ------
>> >>
>> >> Being able to read the source code, and
>> >> being allowed to modify it, is one of the
>> >> essential reasons for the superiority of
>> >> Open Source software.
>> >>
>> >>
>> >>       Take advantage of it.      :-)
>> >>
>> >>
>> >>
>> >>   Regards,
>> >>
>> >>
>> >>
>> >>         Luis
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------
>> >> On Fri, Mar 26, 2010 at 10:39 AM, Stephen Yip <stephen.fyip1 at gmail.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I just played with the DeformableRegistration1.cxx example. It
>> >> > worked.
>> >> > But I
>> >> > got hdr files as my outputs. I am wondering how I can change the file
>> >> > types
>> >> > from hdr to something else.
>> >> >
>> >> > Thank you
>> >> > Stephen
>> >> >
>> >> >
>> >> > _____________________________________
>> >> > 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
>> >> >
>> >> >
>> >
>> >
>
>


More information about the Insight-users mailing list