[Insight-users] Re: On segmentation & connectedness

Luis Ibanez luis.ibanez@kitware.com
Fri, 11 Oct 2002 14:50:24 -0400


Hi cspl,

The current implementation of the itk::ConfidenceConnectedImageFitler
uses the FloodFillFunctionConditionalIterator class.

This class consider neighbors only the closest pixels in every dimension.
That is:

 2 connectedness in 1D
 4 connectedness in 2D
 6 connectedness in 3D
 8 connectedness in 4 D
...
2N connectedness in N-D.


The code that decides the connectivity is in lines 162 to 207 in
Insight/Code/Common/itkFloodFilledFunctionConditionalConstIterator.txx

it is basically:

  for ( each dimension )
       for( j=-1; j<=2; j+=2 )            // try the neighbor at each side


Probably the best way to modify this code and make several connectivities
possible is to use the SmartNeighborhood iterator in order to have access
to the neighbor pixels.

You may want to modify the code in this iterator in order to get
26 connectedness....


Please let us know if you need further details,


Thanks

  Luis


BTW you sent your email to "insight-users-request" the right mailing list
is "insight-users".

==================================================

cspl wrote:

Dear Mr.Luis,

 

I am working on Segmentaion.I used  the following class to get 
segmentation o/p.
itk::ConfidenceConnectedImageFilter.
I am getting for one image not volume.If I have to get for a volume how 
connect 26 .
I think now it is 8 connected How to specify 26 connected in 
volume.Please give me suggestion.

 

I have written code as follows.

 


 typedef itk::ConfidenceConnectedImageFilter<myImage,myImage> FilterType;
  FilterType::Pointer filter = FilterType::New();
  filter->SetInput(image1);

 

 FilterType::IndexType seed; seed[0] = vol->width/2;seed[1] 
=vol->height/2 ;
 filter->SetSeed(seed);
 filter->SetMultiplier(2.5);
 filter->SetReplaceValue(255);
 filter->SetNumberOfIterations(1);
 
  try
    {       filter->Update();
 
    }
  catch (itk::ExceptionObject& e)
    {
    AfxMessageBox(e.GetDescription());

 

    }
 
 image1 = filter->GetOutput();
 

 

}

 

Please see the o/p of a single slice .I attached herewith o/p of a one 
image.

 

Thanking you,

 

Regards,
Ramakrishna


------------------------------------------------------------------------