[Insight-users] Segmentation pipeline = Full RAM

Karthik Krishnan karthik.krishnan at kitware.com
Tue Apr 22 09:53:48 EDT 2008


On Tue, Apr 22, 2008 at 9:22 AM, Cameron Burnett
<w_e_b_m_a_s_t_e_r_6_9 at hotmail.com> wrote:
>
> Hi,
>
> I'm using Confidence Connected region growing, and its currently proving to
> be quite annoying in terms of memory usage. Luis explained what my memory
> usage would be last time, but disregarding that I just want to know how to
> make the algorithm use a minimal amount of memory.
>

> So anyway, I realise that the whole point of the pileline architecture is to
> do the whole thing in 1 go so that its fast. The problem is.... its
> sooooooooo bad for memory usage. I tried doing it this way instead....
>
>   caster->SetInput( reader->GetOutput() );
>   caster->Update();
>   reader->Delete();
>    smoothing->SetInput( caster->GetOutput() );
>   smoothing->Update();
>   //etc.......

> Btw, the original method works (for 20 DICOM slices out of over 400). I've
> managed to get the segmentation working and it outputs a nice 3D VTK image.
> Not sure if its accurate yet though, but I'll get to that later.

You are referring to two different concepts here. Pipeline
architecture vs Streaming.

ITK filters support streaming (by updating regions in pieces and
processing the pieces part by part in parallel). You can process the
pieces serially as well by updating each piece yourself. This is done
by requesting a particular sub-region of the input. See the
documentation for SetRequestedRegion().

That said, not all filters can support streaming. RegionGrowing
filters cannot, since a region can be connected via a loop from one
piece to another.

Your should be check the following

1. Make sure the ReleaseDataFlag is ON for all the filters in your
pipeline. This forces data to be released on a filter after its output
has been consumed by the next filter/sink in the pipeline. This should
significantly reduce your memory usage.

2. Even if your whole pipeline cannot be updated in pieces, you can
update the portion of your pipeline that you need in pieces. (This is
already done for you, under the hood) For instance if you had.

Chances are, you forgot to pay attention to (1).

You can use the itk::MemoryProbe class in Review to identify the
memory eaters in your pipeline.

--
karthik


More information about the Insight-users mailing list