[Insight-users] How to reduce the needed RAM for distance map creation?

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 15 21:25:28 EDT 2009


Hi Lynx,


1) Yes, you can release the memory of the distance filter once
    the subsequent filters have been updated. You do this by calling

             distanceFilter->ReleaseDataFlagOn();

     before you call Update() in the filters downstream.


2) You could use the FastMarching filter for computing an approximation
    to the distance map, if you don't mind having to provide a seed point...


3) You may want to try also the MaurerSignedDistanceMap filter.
    We know that it run about 10 times faster than the Danielson filter....
    I'm not sure how it will do with memory allocations...


  Regards,


        Luis



------------------------------------------------------------------------------------------------
On Wed, Aug 12, 2009 at 12:41 PM, <lynx.abraxas at freenet.de> wrote:

> On 10/08/09 17:19:02, lynx.abraxas at freenet.de wrote:
> > Anyway, with the 4.4GB dataset I get the following:
> >
> > time ~/itk/watershed07/watershed07 zs_gauss-0.5-9_ru_16bit.raw
> zs_gauss-0.5-9_ru_ws_113101.tif 1 1 3 1 0 1 1550 1549 950
> > signed danielson distance map...
> > Morphological watershed...
> > Creating output...
> > terminate called after throwing an instance of 'itk::ExceptionObject'
> >   what():
>  /home/ttd/localusr/include/InsightToolkit/Common/itkImportImageContainer.txx:188:
> > Failed to allocate memory for image.
>
> Since  I  can now use 8-bit encoding for my binarised data and cropping I'm
> at
> 1.2GB of data. I noticed by  inserting  Update()  that  the  creation  of
>  the
> distance map is consuming a lot of memory (around 50 times as much as the
> size
> of the input dataset). I assume that depends on the actual length of
>  occuring
> distances in the evaluation. It seems that after a slow steady increas to
> 12GB
> RAM usage there was a sudden  need  of  so  much  more  RAM  that  my
>  program
> terminated within the update period of top. (And so I never saw it use up
> more
> than 26% of RAM.)
> Is there any way I can reduce the needed memory further? I can't crop more
> nor
> would  I  like  to  bin  the  data. I know that commercial programs can
> create
> distance maps (perhaps less accurate) with much less memory consumption.
> Is there any way I can estimate the maximum memory needed and also the time
> to
> finish computing?
>
> Can  I  free the memory the distance map filter needed when it has finished
> so
> there is more RAM again for the following filters?
>
> Regards,
> Lynx
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> 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/20090815/74bcf8a4/attachment-0001.htm>


More information about the Insight-users mailing list