[ITK Community] [Insight-users] Updating upstream inside GenerateOutputInformation()

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Mar 7 08:59:07 EST 2014


Hello,

Doing that is non-standard, unexpected and may break certain ways a normal pipeline can be used.

Generally, when I need to do this I just do it at the pipeline managing level not, inside the pipeline. This gives me more flexibility on how to manage streaming and other execution properties of the pipeline.

It's my view that this type of processing should be done at a level higher than the ITK-pipeline.

But if it work for you....

Hope that helps,
Brad

On Mar 7, 2014, at 4:44 AM, Vaaksiainen <vaaksiainen at gmail.com> wrote:

> 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
> 
> 
> _____________________________________
> 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

_____________________________________
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