[Insight-users] Polymorphism while using Registration Framework

Stefan König blogdde at googlemail.com
Tue Aug 9 06:53:29 EDT 2011


Hmm ok, this was an error by taking the wrong objects.

but there is another one remaining:

Error	1	error C2664:
'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetTransform'
: cannot convert parameter 1 from
'itk::Transform<TScalarType,NInputDimensions> *' to
'itk::Transform<TScalarType,NInputDimensions,NOutputDimensions> *'

	m_pRegistrator->SetTransform(trans->getTransformation());

my return value is
        itk::Transform<double, Dimension>::Pointer

and the SetTransform inside the documentation of
itkImageRegistrationMethod.h tells me, that the parameter should be a
"	TransformType *  	_arg	" which is linked to itk::Transform.

whats wrong here

Stefan

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



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


More information about the Insight-users mailing list