[Insight-users] Registration

CSPL affable at hd2 . dot . net . in
Fri, 26 Sep 2003 17:57:28 +0530


Dear Mr.Luis,

Thank you for reply.I am using the same way as you mentioned. I used
CenteredAffineTransform and CenteredTransformInitializer to initialize
transform.
I am enclosing the code snippet and image details.

My  FixedImage is 256 X 256 X 120; spacing is 0.8593X 0.8593 X  1.6.
MovingImage is 128 X 128 X 95; spacing is 1.802125 X 1.802125 X 3.60425

*********
metric->SetNumberOfSpatialSamples( 1000);
metric->SetNumberOfHistogramBins( 50 );

unsigned int Factors1[ 3 ] = { 8, 8, 1 };
unsigned int Factors2[ 3 ] = { 4, 4, 1 };

FixedImagePyramidType::Pointer fixedImagePyramid =
FixedImagePyramidType::New();
fixedImagePyramid->SetStartingShrinkFactors( Factors1 );
registration->SetFixedImagePyramid( fixedImagePyramid );

MovingImagePyramidType::Pointer movingImagePyramid =
MovingImagePyramidType::New();
movingImagePyramid->SetStartingShrinkFactors( Factors2 );
registration->SetMovingImagePyramid( movingImagePyramid );

TransformType::Pointer transform = TransformType::New();
typedef itk::CenteredTransformInitializer<TransformType, FixedImageType,
MovingImageType >  TransformInitializerType;
TransformInitializerType::Pointer initializer =
TransformInitializerType::New();
initializer->SetTransform(   transform );   //transform is
CenteredAffineTransform
initializer->SetFixedImage(  FixedImage );
initializer->SetMovingImage( MovingImage );
initializer->MomentsOn();
initializer->InitializeTransform();

const double translationScale = 1.0 / m_translateScale;
optimizerScales.Fill( 1.0 );

for( int i = 0; i <= 11; i++ )
{
 optimizerScales[ i ] =  1.0 /1;
}
optimizerScales[ 9 ]  =  translationScale;
optimizerScales[ 10 ] =  translationScale;
optimizerScales[ 11 ] =  translationScale;
optimizerScales[ 12 ] =  translationScale;
optimizerScales[ 13 ] =  translationScale;
optimizerScales[ 14 ] =  translationScale;

optimizer->SetScales( optimizerScales );
optimizer->SetMaximumStepLength(4 );
optimizer->SetMinimumStepLength(0.005 );
optimizer->SetMaximize( TRUE);
registration->SetOptimizer( optimizer ); //optimizer is object of
RegularStepGradientDescentOptimizer object

registration->SetNumberOfLevels( 5);
optimizer->SetNumberOfIterations( 250);
************
Fixed volume is the extracted brain part of the original MR volume.
Moving is the spect volume

Our requirement is to register moving with the fixed, The registered spect
is transformed and fused with the original MR so that spect fuses with the
brain and not with the other tissues.


Output images are given linked to
http://www . comsols . com/Registration-images . htm
Please tell me where i am giving wrong inputs.

Thanking you,
Regrads,
SriValli.




----- Original Message -----
From: "Luis Ibanez" <luis . ibanez at kitware . com>
To: "CSPL" <affable at hd2 . dot . net . in>
Cc: "ITKUsers" <insight-users at itk . org>
Sent: Thursday, September 25, 2003 11:59 AM
Subject: Re: [Insight-users] Registration


>
> Hi CSPL
>
> Please us the CenteredTransformInitializer,
>
http://www . itk . org/Insight/Doxygen/html/classitk_1_1CenteredTransformInitial
izer.html
>
>
> It has a ImageMomentCalculator inside   :-)
>
http://www . itk . org/Insight/Doxygen/html/classitk_1_1ImageMomentsCalculator . h
tml
>
>
> Just invoke "MomentsOn()" before calling "InitializeTransfrom()".
>
>
> Regards,
>
>
>    Luis
>
>
> -------------------
> CSPL wrote:
> > Dear Mr.Luis,
> >
> > Thank you for your suggestion regarding CenteredAffineTransform..
> > In itkSofetwareGuide.pdf it is given that transform can be initialized
in
> > two ways.One is using TransformInitializar and the other one is
> > ImageMomentsCalculator.We undestood that using ImageMomentsCalculator is
> > best for MultiModality registration.
> > It is also given in PDF that,
> > The center of mass of the moving image is passed as the
> > rotational center of the transform while the vector between the centers
of
> > mass of the fixed
> > and moving images is passed as the initial translation of the transform.
> >
> > But , the problem is ,  GetCenterOfGravity () function in
> > ImageMomentsCalculator  is returning itkVector type.
> > But,The SetCenter() in transform is not taking return type of
> > GetCenterOfGravity()  function .We could not compile the code.
> > We have wriiten code as
> > transform->SetCenter(MovingCalc. GetCenterOfGravity ());
> > where transform is CenteredAffine object and MavingCalc is
> > ImageMomentsCalculator object.
> >
> > We are getting the following error:
> > error C2664: 'SetCenter' : cannot convert parameter 1 from 'class
> > itk::Vector<double,3>' to 'const class itk::Point<double,3> .
> >  Reason: cannot convert from 'class itk::Vector<double,3>' to 'const
class
> > itk::Point<double,3>'
> >         No constructor could take the source type, or constructor
overload
> > resolution was ambiguous
> >
> >
> > Can you please suggest regarding this problem.
> >
> > Thanking you,
> >
> > Regards,
> > SriValli.
> > ----- Original Message -----
> > From: "Luis Ibanez" <luis . ibanez at kitware . com>
> > To: "CSPL" <affable at hd2 . dot . net . in>
> > Cc: "ITKUsers" <insight-users at itk . org>
> > Sent: Friday, September 19, 2003 7:52 AM
> > Subject: Re: [Insight-users] Registration
> >
> >
> >
> >>HI Srivalli,
> >>
> >>
> >>Did you used the CenteredTransformInitializer   ?
> >>
> >>
> >
> >
http://www . itk . org/Doxygen/html/classitk_1_1CenteredTransformInitializer . htm
> > l
> >
> >>As indicated in the SoftwareGuide
> >>http://www . itk . org/ItkSoftwareGuide . pdf
> >>
> >>in the section on Centered Transforms
> >>Section 8.5.1, pdf-page 263.
> >>
> >>
> >>
> >>
> >>Did you verified the pixel spacing of both images ?
> >>
> >>
> >>Did you plot the output of the metric as the
> >>                       optimization is progressing ?
> >>
> >>
> >>The information in your message may not be enough to
> >>give you any useful advice....
> >>
> >>
> >>Regards,
> >>
> >>
> >>    Luis
> >>
> >>
> >>--------------
> >>CSPL wrote:
> >>
> >>>Hi All,
> >>>
> >>>We are trying to perform registration.
> >>>
> >>>Fixed volume is the extracted brain part of the original MR volume.
> >>>Moving is the spect volume
> >>>
> >>>Our requirement is to register extracted brain with spect and then fuse
> >>>the registered spect with the original MR so that spect fuses with the
> >>>brain and not with other tissues.
> >>>
> >>>We are using following itk classes for registration and transform
> >>
> > proces:
> >
> >>>1. MultiResolutionImageRegistrationMethod
> >>>2.MattesMutualInformationImageToImageMetric
> >>>3.LinearInterpolateImageFunction
> >>>4.RecursiveMultiResolutionPyramidImageFilter
> >>>5.CenteredAffineTransform
> >>>6.RegularStepGradientDescentOptimizer
> >>>7.ResampleImageFilter
> >>>
> >>>Input parameters for the above classes are:
> >>>no of iterations = 200;
> >>>TranslateScale = 1000;
> >>>optimizer Scales = 1;
> >>>Optimizer maximum step length = 0.1;
> >>>Optimizer minimum step length = 0.01;
> >>>SpatialSamples = 1000;
> >>>Bins = 50;
> >>>No of Levels = 3;
> >>>SetMinimize = TRUE;
> >>>
> >>>The fusion output is showing the spect fused with the lower part of the
> >>>MR brain and not exactly the brain tissue.
> >>>
> >>>Can someone help us and let us know our mistake.
> >>>
> >>>Regards,
> >>>Srivalli
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>
>
>
>