[Insight-users] Problems deriving from itkMultiResolutionImageRegistrationMethod
Koen Van Leemput
koen.vanleemput@hus.fi
Fri, 25 Oct 2002 09:50:37 +0300
Hi,
I'm trying to derive a class from itk::MultiResolutionImageRegistrationMe=
thod=20
that allows inspection of metric values at specified positions and specif=
ied=20
resolution levels. A simple public member function SampleMetricValue that=
=20
does exactly this could look as follows:
/** Sample the metric at specified position and resolution level. */
MeasureType SampleMetricValue( const ParametersType & parameters, const
=09unsigned int level )
{
if( level >=3D this->GetNumberOfLevels() )
{
itkExceptionMacro(<<"Specified level does not exist!");
}
// Prepare pyramids
this->PreparePyramids();
// Set current level
this->SetCurrentLevel( level );
// Initialize the interconnects between components for this level
this->Initialize();
// Measure
try
{
return this->GetMetric()->GetValue( parameters );
}
catch( itk::ExceptionObject & err )
{
std::cout << "Caught an exception: " << std::endl;
std::cout << err << std::endl;
throw err;
}
// Should never get here
return 0.0;
}
However, itk::MultiResolutionImageRegistrationMethod does not provide the=
=20
member functions GetNumberOfLevels() and SetCurrentLevel(unsigned long), =
and=20
both m_NumberOfLevels and m_CurrentLevel are private. Hence, I'm stuck :-=
(
Could someone of the developers add GetNumberOfLevels() and=20
SetCurrentLevel(unsigned long) (or make m_CurrentLevel protected; the fac=
t=20
that Initialize() is protected is not of much help without access to=20
m_CurrentLevel) to itk::MultiResolutionImageRegistrationMethod?=20
Thanks,
Koen
=20