[Insight-developers] problem with ProcessObject::GenerateOutputInformtion()

Lydia Ng lng at statsci.com
Mon Nov 27 21:50:39 EST 2000


Hi,

In a process object the UpdateOutputInformation()
method update the information describing the output data
( eg LargestPossibleRegion, spacing etc ). 
By default, ProcessObject::UpdateOutputInformation() calls 
ProcessObject::GenerateOutputInformation() which in turn
calls Image::CopyInformation() via

	output->CopyInformation( input )

When the input and output images are of different types
CopyInformation() causes an access violation in VC++.
This is due to the method trying to cast the input into the
output type.

This suggest that if filter has different input and output
types we need to override the GenerateOutputInformation().

For lots of simple filters, I suspect the GenerateOutputInformation()
function would be much the same. It would be good if there was a default
implementation of it in FilterImageToImage.

What do other people think?

Lydia 

 






More information about the Insight-developers mailing list