[Insight-developers] SmartPointer->RawPointer in GetInput() GetOutput() changed

Luis Ibanez luis.ibanez@kitware.com
Mon, 13 May 2002 16:52:33 -0400


Hi,

The changes in GetInput() and GetOutput()
have been made all over the toolkit.

These methods now return raw pointers
instead of SmartPointers.

The output of the methods can still be
received by a SmartPointer but you may
want to change that to raw pointers too.

Like:

     ImageType::Pointer image = filter->GetOutput();

should now be:

     ImageType * image = filter->GetOutput();

unless you are planning to destroy the filter
after the GetOutput() call, in which case the
smart pointer is still needed to prevent the
output image from dying along with its filter.

A lot of Get*() methods returning SmartPointers
were untouched in this first pass because it
wasn't clear if they will support the change.
They may be updated in a second pass.

A const-correcteness visit is also on the list
of things to do.

Note that for GetInput() the result must be
received in a const raw pointer, like:

const ImageType * image = filter->GetInput();

GetOutput() will also be made const soon and
it will return a const raw pointer as well.
A variant non-const (protected) version will
be added to be used inside filters only.



       Luis