Fw: [Insight-users] 3D Registration using my own data (.raw and .mha files)

Luis Ibanez luis.ibanez at kitware.com
Thu May 3 13:46:15 EDT 2007


Hi Lars,

Thanks for sending the additional information of your images.

They look Ok, for the most part...

The spacing of the image N492_MRT1.mha looks very suspicious,
a spacing of 1x1x1 usually indicates that the real spacing was
not known and the values were filled up with some "innocuous"
choice.


Note that you *DO NOT* need to have the two images with the
same number of pixels. The ITK registration framework will
manage that correctly, as long as the origin, and spacing
values truly represent the physical reality of the data.

So, there is no need for resampling the data before performing
the registration.



     Regards,



        Luis




--------------------
Lars Nygard wrote:
> Hi Luis,
>  
> Thanks for you mails, they really cleared things up for me. I have
> the registration program working with the data on the website. However
> when I use my own data I still get the same error. I think I also have found
> the reason, theyre of different sizes (see header files) and elementspacing. 
> I just found out about this. Do you think that this is the problem? I probably 
> need to resample the image first so that both have the same dimensions.
> regards,
> Lars Nygard
>  
>  
> The header files for my own data are:
> 
> N492_MRA.mha:
>  
> NDims = 3
> DimSize = 512 512 245
> ElementType = MET_USHORT
> ElementSpacing = 0.410156 0.410156 0.599998
> ElementByteOrderMSB = True
> ElementDataFile = N492_MRA.raw
> -------------------------------------
>  
> N492_MRT1.mha:
>  
> NDims = 3
> DimSize = 256 256 180
> ElementType = MET_USHORT
> ElementSpacing = 1.000000 1.000000 1.000000
> ElementByteOrderMSB = True
> ElementDataFile = N492_MRT1.raw
> -----------------------------------------------------------
> ----- Original Message ----
> From: Luis Ibanez <luis.ibanez at kitware.com>
> To: Lars Nygard <lnygard at yahoo.com>
> Cc: insight-users at itk.org
> Sent: Wednesday, May 2, 2007 12:57:55 AM
> Subject: Re: [Insight-users] 3D Registration using my own data (.raw and .mha files)
> Hi Lars,
> 
> What is the size (in pixels) of the images:
>            1)  N492_MRT1.mha  ?
>            2)  N492_MRA.mha   ?
> 
> Also, note that you are passing insufficient arguments to this
> program, and that two of the arguments that you are passing are
> PNG image filenames, where a format capable of storing 3D image
> is expected.
> 
>         PNG can only store 2D images.
> 
> The arguments that this program expects are:
> 
>      1) Fixed image (in a 3D file format)
>      2) Moving image (in a 3D file format)
>      3) Filename for the output resampled
>         registered moving image (in a 3D file format)
>      3) Filename for the difference between
>         fixed image and moving image Before
>         registration (in a 3D file format)
>      4) Filename for the difference between
>         fixed image and moving image After
>         registration (in a 3D file format)
>      5) Filename for 1 slice of the difference
>         between fixed image and moving image
>         Before registration (in a 2D file format)
>      6) Filename for 1 slice of the difference
>         between fixed image and moving image
>         After registration (in a 2D file format)
> 
> According to your email, you are missing the argument (3),
> and you are passing wrong file formats for (what should have
> been) arguments (4) and (5).
> A correct command line should look like:
> 
>      ImageRegistration8
>        fixedImage.mhd
>        movingImage.mhd
>        registeredMovingImage.mhd
>        differenceBefore.mhd
>        differenceAfter.mhd
>        sliceDifferenceBefore.png
>        sliceDifferenceAfter.png
> 
> Please read the description of this example in the
> ITK Software Guide:
> 
>        http://www.itk.org/ItkSoftwareGuide.pdf
> in the "Image Registration" chapter.
> 
> You will also find a list of the fileformats supported
> in ITK in the Chapter "Reading and Writing Images" in
> the ITK Software Guide.
> 
> Regards,
> 
>     Luis
> 
> --------------------
> Lars Nygard wrote:
> 
>>Hallo,
>>
>>Im trying to use example eight in the registration part (ImageRegistration8.cxx) to
>>register a 3D MR Angiography (moving) to an 3D MR T1 image (fixed).
>>When I run it i get an error message (see bottom). Is there anybody who can give me
>>a hint on what's happening. 
>>I haven't been able to run ImageRegistration8.cxx example with the normal data because
>>I can't connect to the ftp site ( ftp://public.kitware.com/pub/itk/Data/BrainWeb).
>>Does anybody know where I can download the files brainweb165a10f17.mha and
>>brainweb165a10f17Rot10Tx15.mha??
>>Ok thanks.
>>greets
>>Lars Nygard
>>
>>error message
>>------------------------------------------------------------------------------------------------------------------
>>C:\Documents and Settings\nygard\Desktop\Insight Toolkit\Examples\Registration\I
>>mageRegistration8\debug>ImageRegistration8 N492_MRT1.mha N492_MRA.mha diffbefore
>>.png deffafter.png slicebefore.png sliceafter.png
>>
>>ExceptionObject caught !
>>itk::ExceptionObject (0130F7A0)
>>Location: "class itk::CovariantVector<double,3> *__thiscall itk::ImportImageCont
>>ainer<unsigned long,class itk::CovariantVector<double,3> >::AllocateElements(uns
>>igned long) const"
>>File: c:\documents and settings\nygard\desktop\insight toolkit\source\insighttoo
>>lkit-3.2.0\code\common\itkImportImageContainer.txx
>>Line: 188
>>Description: Failed to allocate memory for image.
>>
>>
>>      
>>_________________________________________________________
>>Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
>>notisblokk. http://no.mail.yahoo.com
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> 
> ----- Forwarded Message ----
> From: Luis Ibanez <luis.ibanez at kitware.com>
> To: Lars Nygard <lnygard at yahoo.com>
> Cc: insight-users at itk.org
> Sent: Wednesday, May 2, 2007 12:57:55 AM
> Subject: Re: [Insight-users] 3D Registration using my own data (.raw and .mha files)
> 
> 
> Hi Lars,
> 
> 
> What is the size (in pixels) of the images:
> 
>            1)  N492_MRT1.mha  ?
> 
>            2)  N492_MRA.mha   ?
> 
> 
> 
> Also, note that you are passing insufficient arguments to this
> program, and that two of the arguments that you are passing are
> PNG image filenames, where a format capable of storing 3D image
> is expected.
> 
> 
>         PNG can only store 2D images.
> 
> 
> The arguments that this program expects are:
> 
> 
>      1) Fixed image (in a 3D file format)
>      2) Moving image (in a 3D file format)
>      3) Filename for the output resampled
>         registered moving image (in a 3D file format)
>      3) Filename for the difference between
>         fixed image and moving image Before
>         registration (in a 3D file format)
>      4) Filename for the difference between
>         fixed image and moving image After
>         registration (in a 3D file format)
>      5) Filename for 1 slice of the difference
>         between fixed image and moving image
>         Before registration (in a 2D file format)
>      6) Filename for 1 slice of the difference
>         between fixed image and moving image
>         After registration (in a 2D file format)
> 
> 
> According to your email, you are missing the argument (3),
> and you are passing wrong file formats for (what should have
> been) arguments (4) and (5).
> 
> A correct command line should look like:
> 
> 
>      ImageRegistration8
>        fixedImage.mhd
>        movingImage.mhd
>        registeredMovingImage.mhd
>        differenceBefore.mhd
>        differenceAfter.mhd
>        sliceDifferenceBefore.png
>        sliceDifferenceAfter.png
> 
> 
> 
> Please read the description of this example in the
> ITK Software Guide:
> 
> 
>        http://www.itk.org/ItkSoftwareGuide.pdf
> 
> in the "Image Registration" chapter.
> 
> 
> You will also find a list of the fileformats supported
> in ITK in the Chapter "Reading and Writing Images" in
> the ITK Software Guide.
> 
> 
> 
> Regards,
> 
> 
>     Luis
> 
> 
> 
> --------------------
> Lars Nygard wrote:
> 
>>Hallo,
>>
>>Im trying to use example eight in the registration part (ImageRegistration8.cxx) to
>>register a 3D MR Angiography (moving) to an 3D MR T1 image (fixed).
>>When I run it i get an error message (see bottom). Is there anybody who can give me
>>a hint on what's happening. 
>>I haven't been able to run ImageRegistration8.cxx example with the normal data because
>>I can't connect to the ftp site ( ftp://public.kitware.com/pub/itk/Data/BrainWeb).
>>Does anybody know where I can download the files brainweb165a10f17.mha and
>>brainweb165a10f17Rot10Tx15.mha??
>>Ok thanks.
>>greets
>>Lars Nygard
>>
>>error message
>>------------------------------------------------------------------------------------------------------------------
>>C:\Documents and Settings\nygard\Desktop\Insight Toolkit\Examples\Registration\I
>>mageRegistration8\debug>ImageRegistration8 N492_MRT1.mha N492_MRA.mha diffbefore
>>.png deffafter.png slicebefore.png sliceafter.png
>>
>>ExceptionObject caught !
>>itk::ExceptionObject (0130F7A0)
>>Location: "class itk::CovariantVector<double,3> *__thiscall itk::ImportImageCont
>>ainer<unsigned long,class itk::CovariantVector<double,3> >::AllocateElements(uns
>>igned long) const"
>>File: c:\documents and settings\nygard\desktop\insight toolkit\source\insighttoo
>>lkit-3.2.0\code\common\itkImportImageContainer.txx
>>Line: 188
>>Description: Failed to allocate memory for image.
>>
>>
>>      
>>_________________________________________________________
>>Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
>>notisblokk. http://no.mail.yahoo.com
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
> 
> 
> 
>       
> _________________________________________________________
> Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
> notisblokk. http://no.mail.yahoo.com
> 


More information about the Insight-users mailing list