[Insight-users] General filtering question

Jim Miller millerjv at gmail.com
Sat Jun 10 11:18:00 EDT 2006


Andrew,

One way to do this is to structure you application to have a data-centric
view.  Here, the application maintains handles to images and creates
temporary pipelines of filter to process the data. These temporary pipelines
are thrown away after each processing.

Once you have read the data, you can disconnect the image from the reader by
doing:

ImageType::Pointer image = reader->GetOutput();
image->DisconnectPipeline()l

The variable image is now not connected to the pipeline.  You can pass this
image thru a pipeline,

{
FilterType::Pointer filter = FilterType::New();
filter->SetInput( image );
filter->Update();

image = filter->GetOutput();
image->DisconnectPipeline();
}

At the end of this block, the filter and the original input image will be
destroyed (providing there are no dangling references) and the variable
image will now contain your filtered output.

There are some other memory management schemes that you can employ.  Once a
filter finishes executing, it checks the state of the ReleaseDataFlag of its
inputs.  If this flag is set on an input, then its bulk data will be
released.  There are also a number of filters that can run in place, where
the output of the filter overwrites the input.

Jim

On 6/9/06, Hoole, Andrew <andrew.hoole at addenbrookes.nhs.uk> wrote:
>
>  Hi
>
>
>
> I understand how to set up a reader to read a file and then connect it to
> a filter to filter it in some way and finally to connect an image to the
> output of the filter which is then displayed or something but what I can't
> quite figure out is given this final image object which I display how can I
> do some further filtering on it so that the result ends up back in the same
> object which is being displayed and ensure that all the memory is managed
> nicely.
>
>
>
> Thanks for any help
>
>
>
> *Andrew Hoole *
>
> -------------------------------------------------------------------------
>
> Medical Physics, Box 152
>
> Cambridge University Hospitals NHS Trust
> Addenbrooke's Hospital
>
> Hills Rd
>
> Cambridge         Tel: (+44) (0)1223-216544
>
> CB2 2QQ           Fax: (+44) (0)1223-257137
>
> UK                    Email: andrew.hoole at addenbrookes.nhs.uk
>
> --------------------------------------------------------------------------
>
> The information contained in this EMAIL and any attachments is
> confidential and intended solely for the attention and use of the intended
> recipient. If you are not the intended recipient and have received this
> email in error you may not disclose, copy, distribute or retain this message
> or any part of it.
> See *Email disclaimer <*
> http://www.addenbrookes.org.uk/email_disclaimer.html*>*
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060610/c319d6e7/attachment-0001.htm


More information about the Insight-users mailing list