#include "itkLabelImageToLabelMapFilter.h"
#include "itkLabelMapToLabelImageFilter.h"
#include "itkRegionOfInterestImageFilter.h"
#include "itkLabelImageToLabelMapFilter.h"
#include "itkLabelMapToLabelImageFilter.h"
#include "itkRegionOfInterestImageFilter.h"
typename ImageToMapFilterType::Pointer imageToLabelFilter = ImageToMapFilterType::New();
imageToLabelFilter->SetBackgroundValue(m_BackgroundValue);
imageToLabelFilter->SetInput(input);
typename ImageToMapFilterType::Pointer imageToLabelFilter = ImageToMapFilterType::New();
imageToLabelFilter->SetBackgroundValue(m_BackgroundValue);
imageToLabelFilter->SetInput(input);
// AutoCrop
typedef itk::AutoCropLabelMapFilter<LabelMapType> AutoCropFilterType;
typename AutoCropFilterType::Pointer autoCropFilter = AutoCropFilterType::New();
autoCropFilter->SetInput(imageToLabelFilter->GetOutput());
// AutoCrop
typedef itk::AutoCropLabelMapFilter<LabelMapType> AutoCropFilterType;
typename AutoCropFilterType::Pointer autoCropFilter = AutoCropFilterType::New();
autoCropFilter->SetInput(imageToLabelFilter->GetOutput());
m_labeImage = labelToImageFilter->GetOutput();
// Update the output size
m_Region = m_labeImage->GetLargestPossibleRegion();
m_labeImage = labelToImageFilter->GetOutput();
// Update the output size
m_Region = m_labeImage->GetLargestPossibleRegion();
m_labeImage->SetRequestedRegion(m_labeImage->GetLargestPossibleRegion());
typename CropFilterType::Pointer cropFilter = CropFilterType::New();
cropFilter->SetInput(m_labeImage);
m_labeImage->SetRequestedRegion(m_labeImage->GetLargestPossibleRegion());
typename CropFilterType::Pointer cropFilter = CropFilterType::New();
cropFilter->SetInput(m_labeImage);