[Insight-users] Speed

Matt McCormick matt at mmmccormick.com
Wed Feb 9 17:11:37 EST 2011


Gib Bogle <g.bogle at ...> writes:

> 
> I've tried BoxMeanImageFilter (which I note was contributed by Richard Beare). 
> Indeed it is much faster, in fact it took just 43 sec for my test image - a 
bit 
> more than twice as fast as my code.

I have looked at Richard's Box filter code before, and they are well done.

  It uses all the CPU cores.  It also uses a 
> lot of memory, and when I try a test with an image of twice the size (200 
frames 
> instead of 100) I'm told "This application has requested the Runtime to 
> terminate it in an unusual way."  I think it runs out of memory (I have only 
4GB 
> in this machine).  I guess each thread is requesting a big chunk of memory.
> 

You can stream the pipeline process by putting a filter like this at the end
http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html
Or using a ImageFileWriter to write a MetaImage, and set the number of stream 
divisions.  Then you will not run out of memory.

> I'm intrigued by the way these ITK filters automatically utilize multiple 
> processors, and I'm wondering if there is a way to set the number of threads 
> that will be invoked.  No doubt there's an IJ article on this topic ..

The default is to set the number of threads to the number of cores available 
(pretty nice).  You can set the value manually by setting the environmental 
variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.

Matt




More information about the Insight-users mailing list