[Insight-users] Newbie question: change transform in multi-resolution registration

Patrik.Br. patrik.brynolfsson at gmail.com
Mon Jun 8 08:07:30 EDT 2009


Hi!Things worked out when I use

const FixedImageType* fixedImage  = registration->GetFixedImage();
const MovingImageType* movingImage = registration->GetMovingImage();

...not

FixedImageType::Pointer fixedImage = registration->getFixedImage

At least the code compiled alright. Is this the right way to go, or am I
still doing something wrong? I just wanted to post the solution if someone
else is wondering the same thing sometime. I hate finding half the solution
on forums.

//Patrik

2009/6/5 M.Staring (via Nabble)
<ml-user+231686-404828782 at n2.nabble.com<ml-user%2B231686-404828782 at n2.nabble.com>
>

> Hi Patrik,
>
> Instead of
>
> FixedImageType  fixedImage  = registration->GetFixedImage();
> MovingImageType movingImage = registration->GetMovingImage();
>
> use
>
> FixedImageType::Pointer  fixedImage  = registration->GetFixedImage();
> MovingImageType::Pointer movingImage = registration->GetMovingImage();
>
> Cheers,
>
> Marius
>
> > -----Original Message-----
> > From: insight-users-bounces at ...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3030574&i=0>
> > [mailto:insight-users-bounces at ...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3030574&i=1>]
> On Behalf Of Patrik.Br.
> > Sent: Friday, June 05, 2009 3:54 PM
> > To: insight-users at ...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3030574&i=2>
> > Subject: [Insight-users] Newbie question: change transform in
> > multi-resolution registration
> >
> >
> > Hello,
> >
> > I just started using ITK so bare with me. I would like to change the
> > transform in multi-resolution registration using an Observer.
> > I started from
> > the example "MultiResImageRegistration1" included in ITK, and
> > an observer is
> > already used to change some parameters in the optimizer so I
> > thought this
> > would be easy.
> >
> > I wanted to change from the TranslationTransform to the
> > CenteredRigid2DTransform, and added this to the last
> > registration level:
> >
> > const   unsigned int    Dimension = 2;
> >  typedef  float  PixelType;
> >  typedef itk::Image< PixelType, Dimension >  FixedImageType;
> >  typedef itk::Image< PixelType, Dimension >  MovingImageType;
> >
> >  typedef itk::CenteredRigid2DTransform< float > TransformType;
> >  TransformType::Pointer transform = TransformType::New();
> >
> >  typedef
> > itk::CenteredTransformInitializer<TransformType, FixedImageType,
> > MovingImageType > TransformInitializerType;
> >
> >  TransformInitializerType::Pointer initializer =
> > TransformInitializerType::New();
> >
> >  FixedImageType  fixedImage  =
> > registration->GetFixedImage(); // <--- This
> > is apparently not ok!
> >  MovingImageType movingImage = registration->GetMovingImage();
> >  initializer->SetTransform(    transform );
> >  initializer->SetFixedImage( fixedImage );
> >  initializer->SetMovingImage( movingImage);
> >  initializer->MomentsOn();
> >  initializer->InitializeTransform();
> >  transform->SetAngle( 0.0 );
> >
> >
> > registration->SetInitialTransformParameters(transform->GetPara
> > meters() );
> >
> > I get the error: error C2440: 'initializing' : cannot convert
> > from 'const
> > itk::Image<TPixel,VImageDimension> *' to
> > 'itk::Image<TPixel,VImageDimension>'
> >
> > What am I not doing right? I've been using matlab for a long
> > time, but C++
> > is kind of new to me. Any help appreciated!
> >
> > //Patrik
> > --
> > View this message in context:
> > http://n2.nabble.com/Newbie-question%3A-change-transform-in-mu
> > lti-resolution-registration-tp3030421p3030421.html
> > Sent from the ITK Insight Users mailing list archive at Nabble.com.
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.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
> >
> > No virus found in this incoming message.
> > Checked by AVG - www.avg.com
> > Version: 8.5.339 / Virus Database: 270.12.53/2156 - Release
> > Date: 06/05/09 06:24:00
> >
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
>
> ------------------------------
>  This email is a reply to your post @
> http://n2.nabble.com/Newbie-question%3A-change-transform-in-multi-resolution-registration-tp3030421p3030574.html
> You can reply by email or by visting the link above.
>
>

-- 
View this message in context: http://n2.nabble.com/Newbie-question%3A-change-transform-in-multi-resolution-registration-tp3030421p3042573.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list