[Insight-users] Updating upstream inside GenerateOutputInformation()

Vaaksiainen vaaksiainen at gmail.com
Fri Mar 7 04:44:55 EST 2014


Hi community,

I've learned the way of writing image size changing ITK filters, but in the
past always figured out the output size based on the input size and not its
content.

Now that I want to employ the content ("auto crop"ish), I realize
GenerateOutputInformation() is called before upstream is updated...

so

is it 'legal' to call Update() on upstream inside
GenerateOutputInformation().

So like this:

::GenerateOutputInformation()
{
InputImage * image = dynamic_cast<InputImage*>(ProcessObject::GetInput(0));
image->UpdateOutputInformation();
image->PropagateRequestedRegion();
image->UpdateOutputData();
...
}

I've found AutoCropLabelMapFilter already, but I'd still like to hear
comment.

The filter needs to connect finite number of downstream filters correctly.

Best regards,
-V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140307/abe8fd27/attachment.html>


More information about the Insight-users mailing list