[Insight-users] Deleting and extracting region from an Image

Miller, James V (Research) millerjv at crd.ge.com
Tue Apr 12 08:45:43 EDT 2005


You can use a BinaryThresholdImageFilter configured to only grab the 
the label of interest. The RelabelComponentImagefilter will label the 
largest region as 1. So you can set the thresholds at 1 to pull out 
that structure.

Something like...

typedef itk::BinaryThresholdImageFilter<ImageType, ImageType> ThresholdType;
ThresholdType::Pointer threshold = ThresholdType::New();

threshold->SetInput( relabel->GetOutput() );
threshold->SetLowerThreshold( 1 );
threshold->SetUpperThreshold( 1 );
threshold->SetInsideValue( 1 );
threshold->SetOutsideValue( 0 );

This will create a binary image with ones indicating the pixels in the
largest region and zeros everywhere else.




-----Original Message-----
From: insight-users-bounces at itk.org
[mailto:insight-users-bounces at itk.org]On Behalf Of sandarak at wp.pl
Sent: Tuesday, April 12, 2005 4:51 AM
To: insight-users at itk.org
Subject: [Insight-users] Deleting and extracting region from an Image


Hello!

After running RelabelComponentImageFilter I'm getting an Image with
several regions. How can I extract the largest region to a new image,
preserving original image size and origin.

thanks in advance

Michal Postrozny

_______________________________________________
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