int main( int argc, char * argv [] )
{
if ( argc < 2 )
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputBinaryImageFile ";
return EXIT_FAILURE;
}
typedef ImageMaskSpatialObject::ImageType ImageType;
typedef ImageType::RegionType RegionType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
try
{
reader->Update();
}
{
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New();
maskSO->SetImage ( reader->GetOutput() );
RegionType boundingBoxRegion = maskSO->GetAxisAlignedBoundingBoxRegion();
std::cout << "Bounding Box Region: " << boundingBoxRegion << std::endl;
return EXIT_SUCCESS;
}