Fwd: Re: [Insight-users] 3D deformable registration

Luis Ibanez luis.ibanez at kitware.com
Sun May 20 09:36:52 EDT 2007


Hi Vijay,

It is very likely that the program is throwing an exeption
related to the file format that you choose to use.

You can add a try/catch block around the writer->Update()
statement in order to identify the source of the problem.

You may want also to use MetaImages as output file format
instead of Analyze.


   Regards,


      Luis


------------------
vijay kumar wrote:
> Hi Luis,
> As advised by you, I am trying out the BSplineDeformable registration 
> method. For this purpose, I copied DeformableRegistration8.cxx to my 
> directory, compiled it and ran the program. It crashed, and gave me a 
> Microsoft OS related error message:
>  
> "DefomableReg.exe has encounterd a problem and needs to close.... Please 
> tell Microsoft about this problem..."
>  
> I didn't modify the program at all, I ran it as follows:
>  
> DeformableReg.exe c:\data\input1.hdr c:\data\input2.hdr 
> c:\data\output.hdr c:\data\diff1.hdr c:\data\diff2.hdr 
> c:\data\deformField.vtk
>  
> I put print statements to locate where it crashed. It is at this point:
>  
> ========================================
> typedef signed short OutputPixelType;
> typedef itk::Image< OutputPixelType, ImageDimension > OutputImageType;
> typedef itk::CastImageFilter<
> FixedImageType,
> OutputImageType > CastFilterType;
> typedef itk::ImageFileWriter< OutputImageType > WriterType;
>  
> WriterType::Pointer writer = WriterType::New();
> CastFilterType::Pointer caster = CastFilterType::New();
> writer->SetFileName( argv[3] );
> caster->SetInput( resample->GetOutput() );
> writer->SetInput( caster->GetOutput() );
> try
> {
> std::cout << std::endl << "Check 1" << std::endl;
> writer->Update();
> std::cout << std::endl << "Check 2" << std::endl;
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return -1;
> }
> ========================================
>  
> Before the crash, I get the following output in the terminal window:
> Starting Registration
> Probe Tag    Starts    Stops     Time
> Registration    1         1          109.249
> Check 1
>  
> As you can see it crashes at the point between 'Check 1' and 'Check 2'. 
> That is at
> writer->Update();
>  
> My input files are Analyze images of type float.  So, I changed the 
> InputPixelType from 'signed short' to 'float'. Likewise I changed the 
> the OutputPixelType too. However, it crashes even use the original 
> (signed short) definitions.
>  
> Could you please advise me on this? I am really stuck on this.
>  
> Thank you very much.
>  
> Regards,
> Vijay
> 
> */Luis Ibanez <luis.ibanez at kitware.com>/* wrote:
> 
> 
>     Hi Vijay,
> 
>     I would suggest you to explore the use of the BSplineDeformable
>     registration method.
> 
>     This method fits better with the standard registration framework of ITK,
>     and *it will* manage without problems images of different number of
>     pixels as well as different pixel spacing.
> 
>     You will find instructions on how to use this method in the ITK
>     Software Guide:
> 
> 
>     http://www.itk.org/ItkSoftwareGuide.pdf
> 
> 
>     towards the end of the "Image Registration" chapter.
> 
> 
> 
>     Regards,
> 
> 
> 
>     Luis
> 
> 
> 
>     --------------------------
>     vijay kumar wrote:
>      > Hi Luis,
>      > I know you are very busy, but could you respond to this query of
>     mine? I
>      > am waiting for your response to proceed further. Which deformable
>      > registration method would you suggest for me to register two 3D
>     images
>      > of dissimilar sizes. Image1: [X1,Y1,Z1]; Image2: [X2,Y2,Z2],
>     where X1,
>      > Y1 and Z1 are not equal to X2, Y2 and Z2 respectively. If ITK
>     doesn't
>      > have a suitable method, I shall then start exploring other
>      > options/programs. Otherwise, ITK is what I would like to use.
>      >
>      > Thank you very much.
>      >
>      > Regards,
>      > Vijay
>      >
>      > */vijay kumar /* wrote:
>      >
>      > Date: Thu, 3 May 2007 13:08:27 -0700 (PDT)
>      > From: vijay kumar
>      > Subject: Re: [Insight-users] 3D deformable registration
>      > To: Luis Ibanez
>      >
>      > Hi Luis,
>      > Thank you for your detailed response and suggestions. I looked into
>      > DeformableRegistration11.cxx and also into the parameter file -
>      > FiniteElementRegistration3.txt. From what I see, the parameter file
>      > expects both input 3D images to be of the same size. In my case, the
>      > images are of size (160x256x256) and (256x256x200), with voxel sizes
>      > of (1.0x1.0x1.0 mm) and (1.21x1.21x1.23 mm). As you mentioned, the
>      > voxel sizes are obtained from the Analyze header. How about the
>      > image sizes? In the section called 'Information about the image
>      > inputs' there is option for only one set of Nx, Ny and Nz. Does this
>      > mean that I have to scale the images to the same size before I use
>      > deformable registration? If so, that may be messy. I was under the
>      > assumption that deformable registration would take care of reslicing.
>      >
>      > Thank you.
>      >
>      > Regards,
>      > Vijay
>      >
>      > */Luis Ibanez /* wrote:
>      >
>      >
>      > Hi Vijay,
>      >
>      > If you are interested in a 3D version of the FEM deformable
>      > registration example, you may want to look at the example:
>      >
>      > Insight/Examples/Registration/
>      > DeformableRegistration11.cxx
>      >
>      > and the associated input file:
>      >
>      >
>      > Insight/Examples/Data/
>      > FiniteElementRegistration3.txt
>      >
>      >
>      > The example: DeformableRegistration11.cxx is the 3D version
>      > DeformableRegistration1.cxx
>      >
>      >
>      >
>      > The pixel dimensions (pixel spacing) are taken from the
>      > meta information of the image. There is no need for you
>      > to put it in the parameters file.
>      >
>      >
>      >
>      > The values of Elasticity and RhoC must be found through
>      > experimentation.
>      >
>      > As a rule of Thumb, high elasticity implies that a very
>      > strong force applied to the material will produce very
>      > small deformations. Therefore, you could start running
>      > experiments with large values of elasticity. If you find
>      > that the deformation field has vectors with very small
>      > magnitudes, then you know that the Elasticity can be
>      > reduced. If you find that the deformation vectors are too
>      > large (e.g. the anatomical tissue gets displaced too far)
>      > then you will know that the Elasticity is too low.
>      >
>      > Note that you may have to play with the orders of magnitude
>      > of the Elasticity.
>      >
>      >
>      > The RhoC factor is used for computing the Mass matrix,
>      > and its final effect is to multiply the forces applied
>      > to the model. Therefore, large values of RhoC will result
>      > on larger deformations, while small values of Rhoc will
>      > result in smaller deformations.
>      >
>      >
>      >
>      >
>      > Regards,
>      >
>      >
>      >
>      > Luis
>      >
>      >
>      >
>      > ------------------
>      > vijay kumar wrote:
>      > > Hi,
>      > > I would like to register two 3D images that are of different
>      > sizes ([nx1
>      > > ny1 nz1] & [nx1 ny2 nz2] voxels) and different voxel
>      > dimensions. I
>      > > modified DeformableRegistration1.cxx to accept 3D images, but
>      > I have
>      > > questions about the parameters file
>      > > (FiniteElementRegistrationParameters1.txt):
>      > >
>      > > 1. How do I specify the sizes of both images? The section -
>      > Information
>      > > about image inputs has the option to specify only one set of
>      > sizes. How
>      > > do I specify the second set?
>      > >
>      > > 2. How do I include voxel dimensions? Or, will the program
>      > get this
>      > > info from the image header?
>      > >
>      > > 3. How do we determine appropriate E, RhoC and Alpha values?
>      > Are there
>      > > some guidelines for their choice?
>      > >
>      > > Thanks,
>      > > Vijay
>      > >
>      > >
>      > >
>      > >
>      >
>     ------------------------------------------------------------------------
>      > > Ahhh...imagining that irresistible "new car" smell?
>      > > Check out new cars at Yahoo! Autos.
>      > >
>      > >
>      > >
>      > >
>      > >
>      >
>     ------------------------------------------------------------------------
>      > >
>      > > _______________________________________________
>      > > Insight-users mailing list
>      > > Insight-users at itk.org
>      > > http://www.itk.org/mailman/listinfo/insight-users
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      > Ahhh...imagining that irresistible "new car" smell?
>      > Check out new cars at Yahoo! Autos.
>      >
>      >
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      > Ahhh...imagining that irresistible "new car" smell?
>      > Check out new cars at Yahoo! Autos.
>      >
>      >
> 
> 
> ------------------------------------------------------------------------
> Don't pick lemons.
> See all the new 2007 cars 
> <http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE0OGRsc3F2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3Y2Fycw--> 
> at Yahoo! Autos. 
> <http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE0OGRsc3F2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3Y2Fycw--> 
> 


More information about the Insight-users mailing list