[Insight-users] Streaming and
itk::RecursiveMultiResolutionPyramidImageFilter
Karthik Krishnan
karthik.krishnan at kitware.com
Fri Mar 2 14:43:20 EST 2007
Hi Daniel,
Nice catch. The Streaming filter doesn't look like it supports generation of
multiple outputs. Jim Miller would be able to say more on it. Seems like it
should be an easy fix though. It just needs to copy the outputs from each
updated tile into the streaming filter's output. It does so just for the
first output right now in lines 150-174 of itkStreamingImageFilter.txx. I
suppose that should loop over the number of outputs.
Please log this as a bug report at itk.org/Bug
Also, there is are a few lines that I think are unnecessary in the filter ??
(lines 114-120) where the output is allocated. Doesn't the superclass take
care of that ? (In any case leaving them causes no harm, data isn't really
allocated twice).
Daniel, you may also want to check the RecursiveMultiResolutionPyramid
filter to see if each of its internal filters release their data, ie set
their ReleaseDataFlagOn(). It is possible to reduce bulk memory usage by
having each filter release its bulk data downstream when the filter
downstream is done with it. The default is to have each filter maintain a
copy of its output.
as in
smoother->SetInput(..)
smoother->ReleaseDataFlagOn();
shrinker->SetInput(smoother->GetOutput())
shrinker->ReleaseDataFlagOn();
HTH
--
karthik
On 3/2/07, Daniel Maleike <d.maleike at dkfz-heidelberg.de> wrote:
>
> Hi list,
>
> at the moment I'm stuck at my memory limits. I need a multi-resolution
> pyramid for some algorithm and the calculation takes up too much memory
> during the update (and just during the update, afterwards it's fine
> again).
>
> I found the note "This filter supports streaming" in the documentation of
> itk::RecursiveMultiResolutionPyramidImageFilter and would like to use
> that.
>
> I tried to reuse the code from
> itkRecursiveMultiResolutionPyramidImageFilterTest.cxx, which uses the
> itk::StreamingImageFilter to do what I want, but it calculates only ONE of
> several outputs of the multi-resolution filter.
>
> For my application I need all outputs of the multi-resolution filter, so I
> adapted the test code to this:
>
>
>
>
> typedef itk::RecursiveMultiResolutionPyramidImageFilter<ImageType,
> ImageType> MRFilterType;
> MRFilterType::Pointer m_MRFilter = MRFilterType::New();
>
> typedef itk::StreamingImageFilter<ImageType, ImageType> MRStreamerType;
> MRStreamerType::Pointer m_MRStreamer = MRStreamerType::New();
>
> //...
>
> m_MRFilter->SetInput( input ); // is a valid image
> m_MRFilter->SetSchedule( mrSchedule ); // good schedule, works without
> streaming
>
> for (unsigned int idx = 0; idx < numResolutions - 1; ++idx) //
> numResolutions corresponds to the above schedule
> {
> m_MRStreamer->SetInput( idx, m_MRFilter->GetOutput(idx) );
> }
>
> m_MRStreamer->SetNumberOfStreamDivisions( 8 );
> m_MRStreamer->Update();
>
>
>
>
> Unfortunately the StreamingImageFilter has only one output after calling
> Update().
>
> Streaming is new for me and I only have some basic understanding of the
> internals of the ITK pipeline, so maybe I just missed something very
> obvious. Or is it that the StreamingImageFilter just works with one input
> and one output? I could not find any usage example except the test.
>
> Could anyone help me or point me to some documentation / source code?
>
> Kind regards
> Daniel
>
> PS: I'm using ITK 3.0 on Linux
>
> --
> Dipl.-Inform. Med. Daniel Maleike Phone: +49 6221
> 42 2326
> Deutsches Krebsforschungszentrum Im Neuenheimer Feld 280, 69120
> Heidelberg
> Div. Medical and Biological Informatics (E130)
> http://mbi.dkfz-heidelberg.de
> _______________________________________________
> 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/20070302/dfcd525d/attachment.htm
More information about the Insight-users
mailing list