[Insight-developers] Writing filters : GenerateInputRequestedRegion() GenerateOutputInformation()

Luis Ibanez ibanez@cs.unc.edu
Sun, 18 Feb 2001 22:06:15 -0500 (EST)


Hi,

For those of us writing filters, it 
is important to note that methods:

GenerateOutputInformation() I

and

GenerateInputRequestedRegion() 

should in general be overloaded.


The default version of them existing in itkProcessObject 
implicitly assumes that inputs and outputs are images,
and that doesn't support ImageAdaptors.

For example:

ProcessObject::GenerateOutputInformation() 

will call CopyInputInformation() in an output.
if the output is an itkImage, the CopyInputInformation()
implicitly assumes thate the input is also an image
of the SAME type. That causes an erroneous down casting
and a subsequent seg fault if the input object is not
really an image.

itkUnaryImageFilter
itkBinaryImageFilter
itkTernaryImageFilter

have been updated to provide these two additional methods.



Luis