[Insight-users] Re: FuzzyConnectedness

Yinpeng Jin yj76@columbia.edu
Mon, 21 Oct 2002 11:36:09 -0400


The implementation of SimpleFuzzy in ITK is actually the "faster" algorithm
in the paper
(Fuzzy Connectedness and Object Definition:  Theory, Algorithms, and
Applications in Image Segmentation",  J. Udupa and S. Samarasekera)
because:
the fuzzy scene was scaled/stored as unsigned short, therefore it is
equivalent to apply a theshold approximatedly 1/65536 when doing the
computation
as mentioned in the paper.
it might not be wise to manually added in a theshold before you know what
kind of "connectedness" you have for your target object.
for example, if you apply a threshold 0.1 during the computing of fuzzy
scene, you won't be able to claim all those parts that has fuzzy
connectedness value smaller than 0.1
later on. that is why "The result segmented image is somehow not correct.
some areas are segmented good, others are not."
The running speed of fuzzy connectedness does not only depends on the size
of the data, but also depends on the size of the target object as well as
how good the estimation
of mean and variance are.
As far as I know, there are also a lot of other preprocessing techniques to
improve the computation speed of fuzzy-connectedness.
Jay or peoples in his group are much more experienced than I am.

BTW:
m_FuzzyScene has the value of [0 65536] (by definition they are [0,1], but
scaled to [0 65536] in the program in order to be stored as "unsigned
short").
so if the user DO want to apply an threshold when computing the fuzzy scene,
the threshold need to be multiplied by 65536.

hope this explanation helps.
yinpeng.



> ===========================================
>  > >
>  > > Zein Salah wrote:
>  > >
>
>  > > > Thanks Luis, I have discovered it by debugging my program.
>  > > >
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > *_Interesting Note:_*
>  > > >
>  > > >
>  > > >
>  > > > I have read the paper (In the paper (Fuzzy Connectedness and Object
>  > > > Definition:  Theory, Algorithms, and Applications in Image
>  > > > Segmentation",  J. Udupa and S. Samarasekera), page 259, it is
stated
>  > > > that there are two version of the algorithm. One requires on some
>  > > > machine about 20 min for an image of 256x256x64, and the other
> version
>  > > > requires only 2 minutes  for the same image.
>  > > >
>  > > > I have tried to discover which version is implemented in the ITK
>
> filter.
>
>  > > > I think it is the slow algorithm.
>  > > >
>  > > > However I tried to modify the code in the
>  > > > itkSimpleFuzzyConnectednessImageFilterBase.txx file to the faster
>  > > > implementation
>  > > >
>  > > > I just added an if statement, just like the fast algorithm in the
>
> paper.
>
>  > > > The filter with this modification required _1.5 minute_ instead of
>
> about
>
>  > > > _40 minutes_. Here is what I have done:
>  > > >
>  > > >
>  > > >
>  > > > the original code:
>  > > >
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > template <class TInputImage, class TOutputImage>
>  > > > void
>  > > > SimpleFuzzyConnectednessImageFilterBase<TInputImage,TOutputImage>
>  > > > ::GenerateData()
>  > > > {...
>  > > >
>  > > > ...
>  > > >
>  > > > ...
>  > > >
>  > > > while(! m_Queue.empty()) {
>  > > > current = m_Queue.front();
>  > > > m_Queue.pop();
>  > > >
>  > > > fmax = (unsigned short)(FindStrongPath(current));
>  > > > if(fmax > m_FuzzyScene->GetPixel(current)) {
>  > > > m_FuzzyScene->SetPixel(current,fmax);
>  > > > PushNeighbors(current);
>  > > > }
>  > > >
>  > > > }
>  > > >
>  > > >
>  > > >
>  > > > MakeSegmentObject();
>  > > > }
>  > > >
>  > > >
>  > > >
>  > > > The new code is:
>  > > >
>  > > >
>  > > >
>  > > > template <class TInputImage, class TOutputImage>
>  > > > void
>  > > > SimpleFuzzyConnectednessImageFilterBase<TInputImage,TOutputImage>
>  > > > ::GenerateData()
>  > > > {...
>  > > >
>  > > > ...
>  > > >
>  > > > ...
>  > > >
>  > > > while(! m_Queue.empty()) {
>  > > > current = m_Queue.front();
>  > > > m_Queue.pop();
>  > > >
>  > > >
>  > > >
>  > > > // this is just what I did, something like what the paper suggests
>  > > > if ( m_FuzzyScene->GetPixel(current) < _1.0_ ) {
>  > > >
>  > > > fmax = (unsigned short)(FindStrongPath(current));
>  > > > if(fmax > m_FuzzyScene->GetPixel(current)) {
>  > > > m_FuzzyScene->SetPixel(current,fmax);
>  > > > PushNeighbors(current);
>  > > > }
>  > > > }
>  > > > }
>  > > >
>  > > >
>  > > >
>  > > > MakeSegmentObject();
>  > > > }
>  > > >
>  > > >
>  > > >
>  > > > The resulter segmented image is somehow not correct. some areas are
>  > > > segmented good, others are not. I have expreimnted with different
>
> values
>
>  > > > intead of of the _0.1_, The result did not improve.
>  > > >
>  > > >
>  > > >
>  > > > Do you have an idea what could the problem be? Could you please
test
>
> the
>
>  > > > new code on 3D- images. Perhaps you can see the results and compare
>
> the
>
>  > > > times.
>  > > >
>  > > > What could be done to get the correct value for this if-statement.
>  > > >
>  > > >
>  > > >
>  > > >
>  > > >
>  > > > Thanks,
>  > > >
>  > > > Zein
>
>
>