]> Creatis software - clitk.git/blobdiff - tools/clitkBSplineCoefficientsToValuesGenericFilter.txx
Adapt CMakeLists to include it from other projects
[clitk.git] / tools / clitkBSplineCoefficientsToValuesGenericFilter.txx
index 76be246de183d3019f38b3572d77fae92b61f486..0111db24da506afa39a3bec1286af876104002df 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
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+===========================================================================**/
 #ifndef clitkBSplineCoefficientsToValuesGenericFilter_txx
 #define clitkBSplineCoefficientsToValuesGenericFilter_txx
+#include <itkAffineTransform.h>
 
 /* =================================================
  * @file   clitkBSplineCoefficientsToValuesGenericFilter.txx
@@ -277,13 +278,17 @@ namespace clitk
       }
     
     typename OutputImageType::Pointer output = resampler->GetOutput();
-    writeImage<OutputImageType>(output, "/home/jef/tmp/output1.mhd", true);
+    //writeImage<OutputImageType>(output, "/home/jef/tmp/output1.mhd", true);
 
 
     // Matrix Transform
     if(m_ArgsInfo.matrix_given)
       {
+#if ITK_VERSION_MAJOR >= 4
+       typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
+#else
        typedef itk::TransformToDeformationFieldSource<OutputImageType, double> ConvertorType;
+#endif
        typename   ConvertorType::Pointer filter= ConvertorType::New();
        filter->SetOutputParametersFromImage(output);
        
@@ -297,7 +302,7 @@ namespace clitk
        filter->SetTransform(transform);
        filter->Update();
        typename OutputImageType::Pointer output2=filter->GetOutput();
-       writeImage<OutputImageType>(output2, "/home/jef/tmp/output2.mhd", true);
+       //writeImage<OutputImageType>(output2, "/home/jef/tmp/output2.mhd", true);
 
        // Add 
        typedef itk::AddImageFilter< OutputImageType, OutputImageType, OutputImageType > AddType;