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

Patrik.Br. patrik.brynolfsson at gmail.com
Fri Jun 5 09:53:30 EDT 2009


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->GetParameters() );

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-multi-resolution-registration-tp3030421p3030421.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list