[Insight-users] Initialize optimizer for registration
Luis Ibanez
luis.ibanez at kitware.com
Wed May 11 10:51:25 EDT 2005
Hi Laurent,
You are right the Image class doesn't have a GetSize() method.
The reason is that the size depends on the regions that you are
considering.
What you should do in this case is:
ImageType::SizeType size = image->GetLargestPossibleRegion().GetSize();
You will find multiple examples of this use in the ITK Software Guide
http://www.itk.org/ItkSoftwareGuide.pdf
and the associated examples in
Insight/Examples/Registration
Regards,
Luis
-----------------------------------
laurent.paul at club-internet.fr wrote:
> Hi all!
>
> I try to register two volumes.
> I use VersorRigid3DTransform, CenteredVersorTransformInitializer, VersorRigid3DTransformOptimizer, MeanSquaresImageToImageMetric, LinearInterpolateImageFunction and ImageRegistrationMethod.
> My problems are following:
>
> 1)I'd want to get the size and spacing of volume to initialize the optimizer as
> optimizerScales[3] = 1.0 /(10.0 * spacing[0] * size[0] );
> optimizerScales[4] = 1.0 /(10.0 * spacing[1] * size[1] );
> optimizerScales[5] = 1.0 /(10.0 * spacing[2] * size[2] );
>
> That's the way you adviced in a previous message on mailing list.
> I manage to get the sapcing with the GetSpacing() method, but there's no the equivalent GetSize() method (except in the class ImageRegion).
> Have I use the ImageRegion class to get the size of my volume?
>
> 2)Which image spacing and size have I to get? I think it should be the fixed image but I'm not sure. Can you light me?
>
> Thank you!
>
> Laurent.
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list