[Insight-developers] Minor bug in itkShapePriorSegmentationLevelSetImageFilter.txx?

Zachary Pincus zpincus at stanford.edu
Mon Mar 7 17:43:23 EST 2005


Hello,

I think I've found a minor bug in the shape prior segmentation level 
set base class that negatively influences its performance. I'm not sure 
-- this might be a design decision though.

Specifically, the ShapePriorSegmentationLevelSetImageFilter extracts 
the "active set" around the level set into a list to pass to a cost 
function, so the cost function can be evaluated over only the nodes in 
the narrow band. However, not all of the layers are copied into the 
list.

Specifically, the code is as follows 
(itkShapePriorSegmentationLevelSetImageFilter.txx line 168):

   for ( unsigned int k = 0; k < this->GetNumberOfLayers(); k++ )
     {
     for (layerIt = this->m_Layers[k]->Begin(); layerIt != 
this->m_Layers[k]->End(); ++layerIt)

Note however that the SparseFieldLevelSetImageFilter clearly notes that 
the NumberOfLayers parameter refers to the number of layers on each 
side of the level set, so the true size of m_Layers is ( 2 * 
NumberOfLayers + 1).

Thus, I suspect this is a bug, and k should be allowed to go up to 
this->m_Layers.size(). However, it could have been a design decision to 
only pass the first few layers to the cost function instead of all of 
them. (The layers are stored so that the closest layers, both inside 
and outside, are at the front of m_Layers. So the first n entries (for 
any odd n) in m_Layers is a proper active set covering both inside and 
outside the level set.)

Does anyone know if this is a bug, or a feature?
It could be a bug because fewer layers passed to the cost function = 
less accurate estimate of true cost.
It could be a feature because fewer layers passed to the cost function 
= faster estimate of cost.

If I don't hear anything in the next few days, I'll assume it's a bug 
and fix it.

Thanks,

Zach



More information about the Insight-developers mailing list