[Insight-users] Binary Image segmentation
John Hiller
john.hiller53 at gmail.com
Mon Sep 26 11:31:27 EDT 2011
Hi again,
Ok, I've verified that using:
itk::VotingBinaryIterativeHoleFillingImageFilter
works by viewing the output in paraview. The holes I didn't want
disappeared, the filter cleaned the segmented for me.
My current problem is now vtk is suddenly not showing the output of the
above filter fro some reason.
First I segment with confidence connected and then I feed the output of
confidence connected into the hole filling filter and when I go to see the
output, its just a black screen. Partial code below, I have a display
function elsewhere making using of the connector, the image type is constant
throughout (signed short and 2D):
if(inSegmentedWindow) {
////get relevant data from previous segmentation
//confidenceConnected->SetInput( confidenceConnected->GetOutput() );
HoleFillingFilterType::Pointer fillingFilter = HoleFillingFilterType::New();
ImageTypeSS2::SizeType indexRadius;
indexRadius[0] = 2; // radius along x
indexRadius[1] = 2; // radius along y
fillingFilter->SetRadius( indexRadius );
fillingFilter->SetBackgroundValue( 0 );
fillingFilter->SetForegroundValue( 255 );
fillingFilter->SetMajorityThreshold( 2 );
fillingFilter->SetMaximumNumberOfIterations( 20 );
fillingFilter->SetInput( confidenceConnected->GetOutput() );
connector->SetInput(fillingFilter->GetOutput());
}
else {
confidenceConnected->ClearSeeds();
//gather relevant data from reader
confidenceConnected->SetInput( reader->GetOutput() );
inSegmentedWindow = true;
//define compulsory threshold parameters for region-growing filter, the
lower the multiplier the more similarities are needed in region
confidenceConnected->SetMultiplier( 1.0 );
confidenceConnected->SetNumberOfIterations( 4 );
confidenceConnected->SetReplaceValue(255);
confidenceConnected->SetInitialNeighborhoodRadius( 4 );
//add the seeds that were chosen
ImageTypeSS2::IndexType index;
for(seedsItr = seeds.begin(); seedsItr != seeds.end(); ++seedsItr) {
index[0] = (*seedsItr).second.x;
index[1] = (*seedsItr).second.y;
confidenceConnected->AddSeed( index );
}//end for
connector->SetInput(confidenceConnected->GetOutput());
}
Please help, this is my last problem if I can overcome it.
Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110926/f18b93f3/attachment.htm>
More information about the Insight-users
mailing list