From 409306c81c1b93f0cef233d0f94d95e5f4d00b6a Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 1 Feb 2018 16:32:09 +0100 Subject: [PATCH] close #56 Remove ITK_Review dependency Change in clitkBLUTDIRGenericFilter from itk::LabelGeometryImageFilter to itk::LabelStatisticsImageFilter --- registration/clitkBLUTDIRGenericFilter.cxx | 12 +++++++----- registration/clitkBLUTDIRGenericFilter.h | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/registration/clitkBLUTDIRGenericFilter.cxx b/registration/clitkBLUTDIRGenericFilter.cxx index 6c80fd9..60cd30d 100644 --- a/registration/clitkBLUTDIRGenericFilter.cxx +++ b/registration/clitkBLUTDIRGenericFilter.cxx @@ -30,6 +30,7 @@ It is distributed under dual licence #include "clitkBLUTDIRGenericFilter.h" #include "clitkBLUTDIRCommandIterationUpdateDVF.h" #include "itkCenteredTransformInitializer.h" +#include "itkLabelStatisticsImageFilter.h" #if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) # include "itkTransformToDisplacementFieldSource.h" #else @@ -373,11 +374,12 @@ namespace clitk fixedMask->SetImage(labels); // Find the bounding box of the "inside" label - typedef itk::LabelGeometryImageFilter GeometryImageFilterType; - typename GeometryImageFilterType::Pointer geometryImageFilter=GeometryImageFilterType::New(); - geometryImageFilter->SetInput(labels); - geometryImageFilter->Update(); - typename GeometryImageFilterType::BoundingBoxType boundingBox = geometryImageFilter->GetBoundingBox(1); + typedef itk::LabelStatisticsImageFilter StatisticsImageFilterType; + typename StatisticsImageFilterType::Pointer statisticsImageFilter=StatisticsImageFilterType::New(); + statisticsImageFilter->SetInput(labels); + statisticsImageFilter->SetLabelInput(labels); + statisticsImageFilter->Update(); + typename StatisticsImageFilterType::BoundingBoxType boundingBox = statisticsImageFilter->GetBoundingBox(1); // Limit the transform region to the mask for (unsigned int i=0; i