[Insight-users] Polymorphism while using Registration Framework

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


Additional, why this won't work?

	typedef itk::Transform< double, Dimension > TransformType;
	TransformType::Pointer foo = createANonAbstractObject();
	m_pRegistrator->SetTransform(foo);

I know, TransformType is abstract, but creating a pointer and using it
with polymorphism should be possible?

2011/8/9 Stefan König <blogdde at googlemail.com>:
> 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
>



-- 
HELL YEAH, IT'S ROCKET SCIENCE!
www.part-time-scientists.com


More information about the Insight-users mailing list