[Insight-users] Lack of memory for segmentation; SetNumberOfThreads

Atwood, Robert C r.atwood at imperial.ac.uk
Tue Jan 24 11:26:02 EST 2006


Hi,
I have finally got round to trying this. However, the implication I get
from the suggestion is that the entire pipleline will be run N times if
one of the filters is set to stream in N chunks.
I have a pipline like (minimized code snippet, Volmedian is
itkMedianImageFilter  and Curvflowdiff is itkCurvatureFlowImageFilter)

itk::SimpleFilterWatcher volmwatcher(Volmedian,"VolMedian");
itk::SimpleFilterWatcher pfwatcher(Curvflow,"PostFilter");

Volmedian->SetNumberOfThreads(nchunks);

Volmedian->SetInput(ExistingImage);
Curvflow->SetInput(Volmedian->GetOutput());
Writer->SetInput(Curvflow->GetOutput());

Writer->Update(); /* in a try/catch block */ 


The output of the SimpleFilterWatcher indicates that the number of
threads for the volume median is nchunks (8) as requested, but the
number of threads for the post-filter (Curvflow) is 2 (it seems to use
the number of processors, it goes to 4 on a similar machine with
'hyperthreading' enabled)


Is this what should happen? Did I misunderstand? From the watcher
otuput, it seems that the entire volume median filter completes
executing before the post-filter starts, or is this a misunderstanding
of the output again? 

Thanks in advance for clarifying these matters.

Robert

(sections of the output .. There is a lot of output ... )

-------- End MedianImageFilter "VolMedian" MedianImageFilter (0x8452538)

  .....

  Thread Count: 8
  Global Maximum Number Of Threads: 0
  Radius: [1, 1, 1]

-------- Start CurvatureFlowImageFilter "PostFilter"
CurvatureFlowImageFilter (0x8459780)
 
.....

-------- End CurvatureFlowImageFilter "PostFilter"
CurvatureFlowImageFilter (0x8459780)

....
   Debug: Off
    Observers: 
      none
    Thread Count: 2
    Global Maximum Number Of Threads: 0
.....



_________________Original message quote regarding running out of memory
___________

Miller, James V (Research) 
Fri Nov 18 09:16:50 EST 2005
 
There are a number of strategies for managing memory.
....
2) StreamingImageFilter.  You can place a StreamingImageFilter at the
end of
your pipeline (or anywhere within the pipeline) and tell the
StreamingImageFilter
to divide the problem into N sections.  The pipeline will then execute N
times, 
....


More information about the Insight-users mailing list