]> Creatis software - clitk.git/blobdiff - itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx
I dont want to verify inputs information, override VerifyInputInformation
[clitk.git] / itk / clitkAddRelativePositionConstraintToLabelImageFilter.txx
index a2bcbdcf6ef21e11b3a2768e931abf8d07a9466d..54f431109728bd8b31b4bdbd8b5d09cc9679e441 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to: 
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 // clitk
 #include "clitkCommon.h"
 #include <itkBinaryErodeImageFilter.h>
 #include <itkBinaryBallStructuringElement.h>
 #include <itkAddImageFilter.h>
-#include <itkDivideByConstantImageFilter.h>
+#if ITK_VERSION_MAJOR >= 4
+  #include <itkDivideImageFilter.h>
+#else
+  #include <itkDivideByConstantImageFilter.h>
+#endif
 
 // itk [Bloch et al] 
 #include "RelativePositionPropImageFilter.h"
@@ -359,10 +363,16 @@ GenerateData()
 
   // Divide by the number of relpos
   if (GetNumberOfAngles() != 1) {
+#if ITK_VERSION_MAJOR >= 4
+    typedef itk::DivideImageFilter<FloatImageType, FloatImageType, FloatImageType> DivideFilter;
+    typename DivideFilter::Pointer divideFilter = DivideFilter::New();
+    divideFilter->SetConstant2(GetNumberOfAngles());
+#else
     typedef itk::DivideByConstantImageFilter<FloatImageType, float, FloatImageType> DivideFilter;
     typename DivideFilter::Pointer divideFilter = DivideFilter::New();
-    divideFilter->SetInput(m_FuzzyMap);
     divideFilter->SetConstant(GetNumberOfAngles());
+#endif
+    divideFilter->SetInput(m_FuzzyMap);
     divideFilter->Update();
     m_FuzzyMap = divideFilter->GetOutput();
   }