[Insight-developers] Const-Correctness problem in itk::ImageToImageMetric?

Luis Ibanez luis.ibanez at kitware.com
Sat Jul 29 17:17:01 EDT 2006


Hi Kent,

Yes, this is a deficiency in ITK.

All the SetInput() methods should take only const pointers
to DataObjects, and all the GetOutput() methods should only
return const pointers to DataObjects.

Note that the difficulty for fully carrying const-correctness
is the fact that the methods that manage the pipeline in the
DataObjects and ProcessObjects are not const-correct, and
therefore they prevent the rest of the API in these objects
to be const-correct.

For general filters it will take a refactoring of the pipeline
to make them satisfy const-correctness.



Please fell free to convert the input of the Metrics to
const pointers.



   Thanks



     Luis



-------------------
Kent Williams wrote:
> This came up when I was working on setting masks for image registration.
> 
> Is there a reason that itk::ImageToImageMetric::SetFixedImageMask takes 
> a non-const pointer to an Image mask type?  Given that the class is 
> never going to modify the Mask, shouldn't it be const?
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 




More information about the Insight-developers mailing list