]> Creatis software - clitk.git/blobdiff - tools/clitkVFResampleGenericFilter.cxx
Add preserve studyUID in clitkImage2Dicom
[clitk.git] / tools / clitkVFResampleGenericFilter.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 2cd6b7d..d287fec
@@ -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 CLITKVFRESAMPLEGENERICFILTER_CXX
 #define CLITKVFRESAMPLEGENERICFILTER_CXX
-/**
- -------------------------------------------------------------------
- * @file   clitkVFResampleGenericFilter.cxx
- * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
- * @date   23 Feb 2008 08:37:53
-
- * @brief
-
- -------------------------------------------------------------------*/
 
 #include "clitkVFResampleGenericFilter.h"
 
@@ -35,7 +26,7 @@ clitk::VFResampleGenericFilter::VFResampleGenericFilter():
 {
   InitializeImageType<2>();
   InitializeImageType<3>();
-  InitializeImageType<4>();
+  //  InitializeImageType<4>();
   mApplyGaussianFilterBefore = false;
   mDefaultPixelValue = 0.0;
   mInterpolatorName = "NN";
@@ -48,7 +39,9 @@ clitk::VFResampleGenericFilter::VFResampleGenericFilter():
 template<unsigned int Dim>
 void clitk::VFResampleGenericFilter::InitializeImageType()
 {
-  ADD_IMAGE_TYPE(Dim, float);
+  //typedef itk::Vector<float,Dim> v3f;
+  //ADD_IMAGE_TYPE(Dim, v3f);
+  ADD_DEFAULT_VEC_IMAGE_TYPES
 }
 //--------------------------------------------------------------------
 
@@ -75,7 +68,8 @@ template<unsigned int Dim, class PixelType, unsigned int DimCompo>
 void clitk::VFResampleGenericFilter::Update_WithDimAndPixelTypeAndComponent()
 {
   // Reading input
-  typedef itk::Vector<PixelType, DimCompo> DisplacementType;
+  //  typedef itk::Vector<PixelType, DimCompo> DisplacementType;
+  typedef PixelType DisplacementType;
   typedef itk::Image< DisplacementType, Dim > ImageType;
 
   typename ImageType::Pointer input = clitk::readImage<ImageType>(m_InputFilenames, m_IOVerbose);
@@ -98,17 +92,17 @@ clitk::VFResampleGenericFilter::ComputeImage(typename ImageType::Pointer inputIm
   static unsigned int dim = ImageType::ImageDimension;
   if (mOutputSize.size() != dim) {
     std::cerr << "Please set size with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
   if (mOutputSpacing.size() != dim) {
     std::cerr << "Please set spacing with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
   mOutputOrigin.resize(dim);
 
   if (mApplyGaussianFilterBefore && mSigma.size() != dim) {
     std::cerr << "Please set sigma with " << dim << " dimensions." << std::endl;
-    return NULL;
+    return ITK_NULLPTR;
   }
 
   // Some typedefs