[Insight-users] get largest labeled region

LaMoOsH .. xlolla28x at hotmail.com
Mon May 16 16:27:24 EDT 2011


Hi everyone, i have two regions in my image .. 
it is a binary image .. 
i used label map to label these object .. 
how can i say that i want to pick the largest region among these two regions ?
i want to pic the largest to apply a some filters on it .. 
 
 
This is my code and dont know how to finish it  
 
typedef unsigned long LabelType; 
typedef itk::ShapeLabelObject< LabelType, 2 > LabelObjectType;
typedef itk::LabelMap< LabelObjectType > LabelMapType;
typedef itk::BinaryImageToShapeLabelMapFilter< OutputImageType, LabelMapType > ConverterType;
ConverterType::Pointer converter = ConverterType::New(); 
converter->SetInputForegroundValue( 255 );
LabelMapType::Pointer labelMap = converter->GetOutput();
for( unsigned int label=1; label<=labelMap->GetNumberOfLabelObjects(); label++ ) 
{
const LabelObjectType * labelObject = labelMap->GetLabelObject( label ); 
 
 
Thanks  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110516/e4b471a6/attachment.htm>


More information about the Insight-users mailing list