[Insight-users] Updating upstream inside GenerateOutputInformation()

Vaaksiainen vaaksiainen at gmail.com
Thu Mar 13 11:16:34 EDT 2014


Thanks a lot for your insight, Bradley :)

Being simple filter itself, I got it actually ready done and it seems to
work correctly (for me) in an application that builds the whole (branching)
ITK pipeline in run-time from a script file. I have to praise the
ITK-architecture for this, but yet I surely keep in mind this being
non-standard. Good thing the managing level is not a separate thread as in
e.g. DirectShow...

I just need to safe memory in FFT, so I can always cut the filter from the
final release :)

Best,

-V


2014-03-07 15:59 GMT+02:00 Bradley Lowekamp <blowekamp at mail.nih.gov>:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140313/0fe9d59a/attachment.html>


More information about the Insight-users mailing list