[Insight-developers] Optimized ImageToImageMetric::SetFixedImageRegion signature

Tom Vercauteren tom.vercauteren at m4x.org
Tue Aug 18 13:40:10 EDT 2009


Hi,

In the non-optimized case, ImageToImageMetric::SetFixedImageRegion is
defined as follows (through a itkSetMacro):

  void SetFixedImageRegion( const FixedImageRegionType reg );

In the optimized case, it is manually defined as:

  void SetFixedImageRegion( FixedImageRegionType reg );


This causes some warning in msvc when a class inherits from
ImageToImageMetric and needs to override SetFixedImageRegion:

    virtual function overrides
'itk::ImageToImageMetric<TFixedImage,TMovingImage>::SetFixedImageRegion',
previous versions of the compiler did not override when parameters
only differed by const/volatile qualifiers


Just to make sure: Since the optimized registration code is in review,
there is no backward compatibility problem if I change the signature
of SetFixedImageRegion to match the one from the non-optimized code,
right?

Also, I realized that doxygen gets confused by the itkSetMacro.
Looking at ImageToImageMetric::SetFixedImageRegion it reports a
non-const argument:

  http://www.itk.org/Doxygen/html/classitk_1_1ImageToImageMetric.html#7d192f58b6309c49ee01e47755faff03

However the doxygen version is based on the non-optimized code:

  http://www.itk.org/Doxygen/html/itkImageToImageMetric_8h-source.html

and correctly shows the const in the itkSetMacro definition:

  http://www.itk.org/Doxygen/html/itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa

Regards,
Tom


More information about the Insight-developers mailing list