[Insight-developers] Filters : GenerateData() : when to Allocate ?

Luis Ibanez ibanez@cs.unc.edu
Wed, 31 Jan 2001 11:58:20 -0500


Paul Hughett wrote:

> This particular protocol will work correctly only for point operations
> on images.  Some other possibilities that need to be handled correctly:
>
> neighborhood operations (convolution, dilation, etc): the source region
> needs to be enough bigger than the destination to account for the
> neighborhood of the operation
>

This has already been considered, for these cases the filter
should overload the following methods:

   GenerateInputRequestedRegion();
   UpdateOutputInformation();


The first one compute how large the input region should be
in order to produce the desired output region.

The second one, modifies position and spacing of the output image
if necessary.

Both consider that the filter takes the requested output region
as a given, and from that it asks for the necessary input region.

The problem arise when we connect a new image to the output of 
a filter, this output image doesn't have any memory allocated 
nor regions defined. The question then is : Who should call Allocate()
and who should define the corresponding regions on the output ?



Luis