[Insight-users] Getting GeodesicActiveContourLeveSetImageFilter Intermediate Outputs

Zachary Pincus zpincus at stanford.edu
Thu Mar 17 14:15:04 EST 2005


Hello Albert,

What precisely do you mean by the "iteration output" that you want to 
obtain? I assume you're referring to grabbing the level set at each 
iteration?

If so, here's the method I use. It may not be totally optimal, though.
This code snippit is in the method of my observer object that gets 
called each iteration. Earlier, a thresholder is set up to take a level 
set embedding function and threshold it into a binary inside/outside 
mask. (The standard output step for the level set filter.)
Note that I do *not* just connect the level set filter's GetOutput() to 
the input of the thresholder. This is because the level set filter is 
already in the middle of a pipeline update (which caused the 
iteration!), so performing another update is no good. Instead, I create 
a new image that shares the same pixels in memory, but has its own 
metadata and pipeline information. I then write those pixels out to 
disk with a pipeline. (Note that if you modify the pixels, this will 
badly break the level set filter. So make sure that InPlaceOff() is 
called if you use an InPlaceImageFilter subclass to process the level 
set...)

Code:
m_Image->SetRegions(m_Filter->GetOutput()->GetLargestPossibleRegion());
m_Image->SetPixelContainer(m_Filter->GetOutput()->GetPixelContainer()); 
m_Thresholder->SetInput(m_Image);
m_Thresholder->Modified();
m_Writer->SetInput(m_Thresholder->GetOutput());
m_Writer->SetFilename(filename);
m_Writer->Update();

Zach Pincus

Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine

On Mar 16, 2005, at 9:04 PM, Albert Huang wrote:

> Dear experts
>  
> I have been trying to visualize outputs from each iteration of the 
> Geodesic active contour segmentation with no success.  I have added an 
> observer and is able to get the RMS value for each iteration.  Is it 
> possible for me to grab the iteration output in the observer class?
>  
> Thanks in advance!
> Albert
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list