[Insight-users] Problems deriving from itkMultiResolutionImageRegistrationMethod

Luis Ibanez luis.ibanez@kitware.com
Fri, 25 Oct 2002 10:56:55 -0400


Hi Koen,


Thanks for pointing this out.

As you suggested the methods:

     public:
       unsigned long GetNumberOfLevels();

     protected:
       void SetCurrentLevel( unsigned long );


have been added to the
MultiResolutionImageregistrationMethod class.

The member variables remain private.

Note that SetCurrentLevel() is protected since
a typical use of the MultiResolutionImageRegistration
should not change the current level.

Please let us know if you find any problem,

   Thank

     Luis



PS your class seems to be pretty useful for inspecting
the registration process. Would you like it to contribute
this code to the toolkit ?


==================================================================

Koen Van Leemput wrote:
> Hi,
> 
> I'm trying to derive a class from itk::MultiResolutionImageRegistrationMethod 
> that allows inspection of metric values at specified positions and specified 
> resolution levels. A simple public member function SampleMetricValue that 
> does exactly this could look as follows:
> 
> 
>   /** Sample the metric at specified position and resolution level. */
>   MeasureType SampleMetricValue( const ParametersType & parameters, const
>  	unsigned int level )
>     {
> 
>     if( level >= 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 
> member functions GetNumberOfLevels() and SetCurrentLevel(unsigned long), and 
> both m_NumberOfLevels and m_CurrentLevel are private. Hence, I'm stuck :-(
> 
> Could someone of the developers add GetNumberOfLevels() and 
> SetCurrentLevel(unsigned long) (or make m_CurrentLevel protected; the fact 
> that Initialize() is protected is not of much help without access to 
> m_CurrentLevel) to itk::MultiResolutionImageRegistrationMethod? 
> 
> Thanks,
> 
> Koen
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
> 
>