[Insight-users] Re: itkThresholdSegmentationLevelSetFunction
Joshua Cates
cates at sci.utah.edu
Mon, 22 Mar 2004 10:47:02 -0700 (MST)
Hi Lucas,
Looks like you may have found a bug in the construction of the
Threshold..Filter. The propagation value is set to -1 only at
construction, so try setting this weight to a positive value before
updating the filter.
---
Note that the apparent behavior of a level-set filter also changes
depending on the values in your initialization. The disadvantage of the
negative-inside convention adopted for ITK level-sets is that it is
exactly opposite to the positive-inside representation typically used for
binary segmentations.
As an example, take the very common case where a binary segmentation is
used as the initialization for a level-set filter. Say you have labeled
"inside" pixels with 1 and "outside" pixels with 0. The isosurface of
interest is somewhere between 0 and 1, say 0.5 ( filter->SetIsovalue(0.5)
). When the level-set solver is initialized, it will take all values <
0.5 to be inside the model and all values > 0.5 to be outside the model,
effectively inverting your initial segmentation, and causing the model to
shrink where it would otherwise be expected to grow.
Josh.
On Mon, 22 Mar 2004, Lucas Lorenzo wrote:
> Hi Josh,
>
> I'd like to ask you a question about the
> itkThresholdSegmentationLevelSetFunction. I do not know if you wrote
> this class but anyway, maybe you can answer my question.
>
> Till now, I've been working with the
> GeodesicActiveContourShapePriorLevelSetImageFilter which outputs an
> image with negative values inside the object to be segmented and
> positive outside.
> The ThresholdSegmentationLevelSetImageFilter has an output with
> opposite characteristics, that is, positive inside the object and
> negative outside. Its Initialize member function looks like this:
>
> 00141 virtual void Initialize(const RadiusType &r)
> 00142 {
> 00143 Superclass::Initialize(r);
> 00144
> 00145 this->SetAdvectionWeight( NumericTraits<ScalarValueType>::One
> );
> 00146 this->SetPropagationWeight(
> NumericTraits<ScalarValueType>::One );
> 00147 this->SetCurvatureWeight( NumericTraits<ScalarValueType>::One
> );
> 00148 this->SetShapePriorWeight(
> NumericTraits<ScalarValueType>::One );
> 00149 }
>
> In the case of the itkThresholdSegmentationLevelSetFunction, these
> variables are set in the Initialize member function like this:
>
> 00092 virtual void Initialize(const RadiusType &r)
> 00093 {
> 00094 Superclass::Initialize(r);
> 00095
> 00096 this->SetAdvectionWeight(
> NumericTraits<ScalarValueType>::Zero);
> 00097 this->SetPropagationWeight(-1.0 *
> NumericTraits<ScalarValueType>::One);
> 00098 this->SetCurvatureWeight(NumericTraits<ScalarValueType>::One);
> 00099 }
>
>
> My question is: is the -1 factor in line 97 (look bold line above) the
> reason why the sign of the output is the opposite.
> Thanks
>
> Lucas
>
>
> Lucas Lorenzo
>
> University of Utah
> Nora Eccles Harrison CardioVascular Research and Training Institute
> Fellows Room
> 95 South 2000 East
> Salt Lake City, UT 84112-5000
>
> e-mail: lucas at cvrti.utah.edu
> telephone: 801-587-9536