[Insight-users] Problems using itk::VectorFuzzyConnectednessImageFilter

Ying Zhuge zhuge at mipg.upenn.edu
Sun Nov 14 17:58:50 EST 2004


Hi christian,
I am sorry for the confusing documentation.

1. SetObjects should be SetNumberof Objects
2. There is no SetSelectedObject any more. If you are intrested in 
particular object, then you need to set the number of objects to 1 and 
set proper parameters ( mean, std, seeds, plus  threshold by using 
SetThreshold) for that object. The output is the binary scene where 
voxels having connectivity values greater than threshold are 1.

3. I have no idea. It sounds weird because the testing program works fine...

Ying

Christian Bauer wrote:

>Hi!
>
>I have problems using the itk::VectorFuzzyConnectednessImageFilter. I'm
>currently using itk 1.8.
>
>I wrote the following code and noticed three problems:
>1) There's no method SetObjects for setting the number of objects as explained
>at the end of Detailed Description of the class; there's a method
>SetNumberOfObjects instead.
>2) There's no method SetSelectedObject as explained in the documentation. I
>wasn't able to find another appropriate method.
>3) When i try to set the properties of the different objects i'm just able to
>set the mean and variance of all object. But when i try to set the seed for the
>second object a segmentation violation occurs - i'm just able to set the seed
>for the first object. I also tried to add another seed to the first object.
>There's no problem with that.
>
>typedef itk::Vector< signed short, 1 > PixelType;
>typedef itk::Image< PixelType, 2 > ImageType;
>typedef unsigned char BinaryPixelType;
>typedef itk::Image< BinaryPixelType, 2 > BinaryImageType;
>
>typedef itk::ImageFileReader< ImageType > ReaderType;
>ReaderType::Pointer reader = ReaderType::New();
>reader->SetFileName( argv[1] );
>ImageType::Pointer scene = reader->GetOutput();
>scene->Update();
>
>int numberOfObjects = 3;
>int objectOfInterest = 1;
>
>std::vector< ImageType::IndexType > seed;
>std::vector< itk::Vector<double, 1> > mean;
>std::vector< itk::Matrix<double, 1, 1> > variance;
>
>... init of seed, mean and variance
>
>typedef itk::VectorFuzzyConnectednessImageFilter< ImageType, BinaryImageType >  
>FuzzySegmentationFilterType;
>  FuzzySegmentationFilterType::Pointer fuzzysegmenter =
>FuzzySegmentationFilterType::New();
>
>fuzzysegmenter->SetInput( scene );
>fuzzysegmenter->SetNumberOfObjects( numberOfObjects );
>//fuzzysegmenter->SetSelectedObject( objectOfInterest );
>for (int i=0; i<numberOfObjects; i++)
>  {
>  fuzzysegmenter->SetObjectsMean( mean[i], i );
>  fuzzysegmenter->SetObjectsMatrix( variance[i], i );
>  fuzzysegmenter->SetObjectsSeed( seed[i], i );
>  }
>
>fuzzysegmenter->Update();
>
>Any suggestions?  Thanks in advance...
>
>Christian
>
>
>_______________________________________________
>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