X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkBLUTDIRGenericFilter.cxx;h=60cd30db0bc21024e3c187d642062be4b4bb88fe;hb=78bd7fb31b49e7b7557c062a691f622f6dec58a0;hp=9f7b84f456f36496f1be156400a0c43441dd2983;hpb=c234e07e4ef90bb8b08c75ca4f1b3a76055e7859;p=clitk.git diff --git a/registration/clitkBLUTDIRGenericFilter.cxx b/registration/clitkBLUTDIRGenericFilter.cxx index 9f7b84f..60cd30d 100644 --- a/registration/clitkBLUTDIRGenericFilter.cxx +++ b/registration/clitkBLUTDIRGenericFilter.cxx @@ -30,14 +30,11 @@ It is distributed under dual licence #include "clitkBLUTDIRGenericFilter.h" #include "clitkBLUTDIRCommandIterationUpdateDVF.h" #include "itkCenteredTransformInitializer.h" -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 -# include "itkTransformToDisplacementFieldSource.h" -# else -# include "itkTransformToDisplacementFieldFilter.h" -# endif +#include "itkLabelStatisticsImageFilter.h" +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) +# include "itkTransformToDisplacementFieldSource.h" #else -# include "itkTransformToDeformationFieldSource.h" +# include "itkTransformToDisplacementFieldFilter.h" #endif namespace clitk @@ -377,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 DisplacementType; typedef itk::Image< DisplacementType, InputImageType::ImageDimension > DisplacementFieldType; -#if ITK_VERSION_MAJOR >= 4 -# if ITK_VERSION_MINOR < 6 +#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6) typedef itk::TransformToDisplacementFieldSource ConvertorType; -# else +#else typedef itk::TransformToDisplacementFieldFilter ConvertorType; -# endif #endif typename ConvertorType::Pointer filter= ConvertorType::New(); filter->SetNumberOfThreads(1);