[Insight-users] Polymorphism while using Registration Framework

Stefan König blogdde at googlemail.com
Tue Aug 9 04:55:00 EDT 2011


Hey,

i've got a problem by building my own workflow using itk, i'm trying
to build generic class to use the registration part,

i'm doing something like this.

itk::ImageRegistrationMethod<FixedImageType, MovingImageType>::Pointer
m_pRegistrator = getAConcreteFromElsewhere();

m_pRegistrator->SetOptimizer(optimizer->getITKOptimizer());

getITKOptimizer()'s signature: itk::Optimizer::Pointer
getITKOptimizer() (later optimizer should hold several other objects,
which inherit from optimizer)

but that wont work,

Error	1	error C2664:
'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetOptimizer'
: cannot convert parameter 1 from 'itk::Optimizer *' to
'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::OptimizerType
*

why this doesn't work? are there other good ways to get a solution for
this problem?

thanks for your help
Stefan


More information about the Insight-users mailing list