]> Creatis software - clitk.git/commitdiff
close #56 Remove ITK_Review dependency
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 1 Feb 2018 15:32:09 +0000 (16:32 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 1 Feb 2018 15:32:09 +0000 (16:32 +0100)
 Change in clitkBLUTDIRGenericFilter from itk::LabelGeometryImageFilter to itk::LabelStatisticsImageFilter

registration/clitkBLUTDIRGenericFilter.cxx
registration/clitkBLUTDIRGenericFilter.h

index 6c80fd911859199d28b36f618e2d01472c0d8eaa..60cd30db0bc21024e3c187d642062be4b4bb88fe 100644 (file)
@@ -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<ImageLabelType> GeometryImageFilterType;
-        typename GeometryImageFilterType::Pointer geometryImageFilter=GeometryImageFilterType::New();
-        geometryImageFilter->SetInput(labels);
-        geometryImageFilter->Update();
-        typename GeometryImageFilterType::BoundingBoxType boundingBox = geometryImageFilter->GetBoundingBox(1);
+        typedef itk::LabelStatisticsImageFilter<ImageLabelType, ImageLabelType> 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<InputImageType::ImageDimension; i++)
index 18e1600ee9f12827730873a177325ebb3d00a338..419af6a6f8e43319cf142a8fba746f718d956e4d 100644 (file)
@@ -57,7 +57,6 @@
 #include "itkLightObject.h"
 #include "itkImageToImageMetric.h"
 #include "itkInterpolateImageFunction.h"
-#include "itkLabelGeometryImageFilter.h"
 #include "itkImageDuplicator.h"
 #include "itkExtractImageFilter.h"