[Insight-users] fast_tracking() functin of VectorFuzzyConnectednessImageFilter()

Ying Zhuge zhuge at mipg.upenn.edu
Wed Jul 6 10:24:23 EDT 2005


Hi:

The function is used to track the fuzzy connectedness of each voxel to
seed points of a particular object.

-Ying

陵 邱 wrote:

> hi:
> this function is a member of VectorFuzzyConnectednessImageFilter.txx,
> my question is :
> is this function used to compute the fuzzyconnectedness object of each
> voxels in the image?is this equall to the Algotithms kVMRFOE in paper
> "Vectorial scale-based fuzzy connected image segmentation"?
> program code is as followed:
> template <class TInputImage, class TOutputImage>
> void
> VectorFuzzyConnectednessImageFilter<TInputImage,TOutputImage>
> ::Fast_Tracking(const int object)
> {
> std::vector<ListSeedType> chash;
> typename ListSeedType::iterator iter;
> IndexType current,max_index,index1,index2;
> AffinityVector vectorValue;
> unsigned short topIndex = 4096;
> ImageRegionConstIterator<AffinityImageType> it;
> it =
> ImageRegionConstIterator<AffinityImageType>(m_AffinityImage,m_AffinityImage->GetRequestedRegion());
> chash.resize(topIndex+1);
> for(int i=0;i<=topIndex;i++)
> chash[i].clear();
> unsigned short initialValue=0;
> m_FuzzyConnImage->FillBuffer( initialValue );
> /** object tracking...*/
> while(!m_ObjectSeeds[object].empty())
> {
> current = m_ObjectSeeds[object].back();
> m_ObjectSeeds[object].pop_back();
> m_FuzzyConnImage->SetPixel(current,topIndex);
> chash[topIndex].push_front(current);
> }
> SizeType size;
> size = m_AffinityImage->GetLargestPossibleRegion().GetSize();
> for(int i = 0;i<static_cast<int>(ImageDimension);i++)
> {
> max_index[i] = static_cast<typename IndexType::IndexValueType>(size[i])-1;
> }
> while((topIndex>0) && (chash[topIndex].size() !=0))
> {
> current = chash[topIndex].back();
> chash[topIndex].pop_back();
> while((topIndex>0) && (chash[topIndex].size() == 0))
> {
> topIndex--;
> }
> unsigned short pmax,pmin,dimensionValue;
> pmax = m_FuzzyConnImage->GetPixel(current);
> for(unsigned int i = 0;i<ImageDimension;i++)
> {
> index1 = current;
> if(index1[i] < max_index[i])
> {
> index1[i]++;
> vectorValue = m_AffinityImage->GetPixel(current);
> dimensionValue = (vectorValue[i]);
> pmin = (pmax < dimensionValue ? pmax: dimensionValue);
> unsigned short value = m_FuzzyConnImage->GetPixel(index1);
> if (pmin > value)
> {
> if (value == 0)
> {
> chash[pmin].push_front(index1);
> }
> else
> {
> for( iter = chash[value].begin();iter !=chash[value].end();iter++)
> {
> index2 = *iter;
> if(index2 == index1)
> {
> chash[value].erase(iter);
> break;
> }
> }
> chash[pmin].push_front(index1);
> }
> if (pmin>topIndex)
> {topIndex = pmin;}
> m_FuzzyConnImage->SetPixel(index1,pmin);
> }
> }
> index1 = current;
> if(index1[i]>0)
> {
> index1[i]--;
> vectorValue = m_AffinityImage->GetPixel(index1);
> dimensionValue = vectorValue[i];
> pmin = (pmax < dimensionValue ? pmax: dimensionValue);
> unsigned short value = m_FuzzyConnImage->GetPixel(index1);
> if (pmin > value)
> {
> if (value == 0)
> {
> chash[pmin].push_front(index1);
> }
> else
> {
> for( iter = chash[value].begin();iter !=chash[value].end();iter++)
> {
> index2 = *iter;
> if(index2 == index1)
> {
> chash[value].erase(iter);
> break;
> }
> }
> chash[pmin].push_front(index1);
> }
> if (pmin>topIndex)
> {topIndex = pmin;}
> m_FuzzyConnImage->SetPixel(index1,pmin);
> }
> }
> }
> }
> }
>
> ------------------------------------------------------------------------
> DO YOU YAHOO!?
> 雅虎邮箱超强增值服务-2G超大空间、pop3收信、无限量邮件提醒
> <http://cn.mail.yahoo.com/mail_alert/promo1.html>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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