[Insight-developers] const inputs in Image Filters

Luis Ibanez luis.ibanez@kitware.com
Mon, 25 Mar 2002 16:24:24 -0500


Hi,

A set of changes in ImageFilters are about to be checked in.

The basic change is the introduction of ConstSmartPointers
and const Iterators for managing Input Images.

The Process/Data objects remain unchanged so the vector
of inputs is still a vector of non-const smart pointers.

Most of the changes have been done in the
GenerateInputInformation() method where the regions of
the input image are being set from the filters.  In all these
methods  a  const_cast<> is being used to override
const-correctness.

The GetInput() methods at the level of the ImageToImage
filter now return ConstPointers. The method itself cannot
be mande const because the DataObject itself will not support
that (unles we const_cast "this" too...)

Only a few filters actually need non-const pointers to the inputs
in their GenerateData() method. Among them, those building
mini-pipelines and the in-place ChangeInformation filter.




  Luis