[Insight-developers] const inputs in Image Filters

Luis Ibanez luis.ibanez@kitware.com
Mon, 25 Mar 2002 17:59:32 -0500


Jim,


Miller, James V (CRD) wrote:

>Well, I guess the big question is: when are people going to have
>const images?
>
Every time they write a function/method that receives
an image and does not expect to modify the image !!!

>I haven't had a need for them in any of the code I have written with 
>ITK. So my opinion is biased away from supporting const images.
>
It seems that all this time writing small test programs for
our collection of 280 test files have make us believe that
the normal use of ITK will be to write applications of 100
lines that open a file, read an image, run one filter and
write the output image to a file.  

I certainly hope that this will not be the normal use of ITK !

We should keep in mind the real use of the toolkit for applications
that do something useful. Any serious application will be made of
more than just the main() {}.

If it is done correctly, any real application will have a large amount
of non-ITK classes with their respective methods and it is to expect
that parameters passed to these functions will use "const" correctly.

ITK filters will be a minor component of a full fledged application
and it will be a bit embarrassing to have to tell to these programmers
that they have to down cast their const-correct applications because
ITK is lax in const typing.

Keeping const-correctness is not harder than respecting any other type.
It is not harder than using Traits correctly.
 

   Luis