[ITK Community] [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://public.kitware.com/pipermail/community/attachments/20140307/abe8fd27/attachment-0002.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list