[Insight-developers] Const Missing in inputs for Process Object

Luis Ibanez luis.ibanez@kitware.com
Sat, 23 Mar 2002 16:23:28 -0500


Well,

as Will already said:    It is a can of worms...

All the layer of ProcessObject and DataObject is
very lax in const correctness. There are a lot of
methods that should be const and are not.

Things like RegionTesting methods and GetTime
methods should definitly be const.

However, even after fixing those there is a more
profound effect due to the Data/Process Object layer
because there is a lot of activity that happens behind
the scenes in particular related to the Regions and
Updates.  

We can expect an image to be "const" but its DataObject
subconscious part is plenty of activity.   const-correctness
will require to make methods like:

            SetRequestedRegion()     to be const

As far as the image is concerned, a change in the requested
region does not change the image but when it comes to
analyze the impact of this const at the DataObject level
things are pretty different. There is an frenetic activity
inside images and filters even though from the user's point
of view they seem to be passive.

It brings to memory the proposal for taking all the Region/
Process management out of the filters and the data containers.
Right now the images are taking care of slicing themselves
and moving the traffic of update information up and down
the pipeline.  It is possible that separating this two activities
could bring some benefits.  



     Luis


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

Bill Lorensen wrote:

>In place filters are coming shortly... Not sure what the const impact will be,
>
>Bill
>
>At 11:32 AM 3/23/02 -0500, Will Schroeder wrote:
>
>>Hi Luis-
>>
>>I think this is the right thing to do, except for maybe in-place filters that we'll add at some point. Good luck, this might be a can of worms.
>>
>>Will
>>
>>
>>At 11:23 AM 3/23/2002 -0500, Luis Ibanez wrote:
>>
>>>Hi,
>>>
>>>The array of inputs for Process Object is not const-correct.
>>>
>>>In principle there is no reason for a filter to modify its input
>>>so the input should be stored as ConstSmartPointers.
>>>
>>>Currently this is done using just SmartPointers.
>>>
>>>This constness-defect is propagated through all the Filters
>>>which  basically means that you cannot pass a const image
>>>as input to any filter.      :-/
>>>
>>>Does anybody see a conflict in making the array of m_Inputs
>>>in itk::ProcessObject   an array of SmartConstPointers   ?
>>>
>>>
>>> Luis
>>>
>>>_______________________________________________
>>>Insight-developers mailing list
>>>Insight-developers@public.kitware.com
>>>http://public.kitware.com/mailman/listinfo/insight-developers
>>>
>>_______________________________________________
>>Insight-developers mailing list
>>Insight-developers@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-developers
>>
>
>
>