]> Creatis software - clitk.git/blobdiff - tools/clitkImageConvertGenericFilter.h
With ITKv5, change VectorResample and VectorCast Image Filter to Resample and Cast...
[clitk.git] / tools / clitkImageConvertGenericFilter.h
index aa8b2ba64b69496ee2580bc77f3ef3383bd5542b..a3174736ee7e878597fc143a1df88920f2fa8480 100644 (file)
@@ -32,7 +32,9 @@
 
 // itk include
 #include "itkCastImageFilter.h"
+#if ( ITK_VERSION_MAJOR < 5 )
 #include "itkVectorCastImageFilter.h"
+#endif
 
 
 namespace clitk {
@@ -74,6 +76,7 @@ namespace clitk {
     std::string GetOutputPixelTypeName() { return mOutputPixelTypeName; }
     void SetOutputPixelType(std::string p) { mOutputPixelTypeName = p; }
     void SetVV(bool b) { mVV = b; }
+    void SetNoNiiMeta(bool b) { mNoNiiMeta = b; }
     bool IsWarningOccur() { return mWarningOccur; }
     std::string & GetWarning() { return mWarning; }
     void EnableDisplayWarning(bool b) { mDisplayWarning = b; }
@@ -95,6 +98,7 @@ namespace clitk {
     bool mWarningOccur;
     bool mDisplayWarning;
     bool mVV;
+    bool mNoNiiMeta;
     bool mCorrectNegativeSpacingFlag;
 
   private:
@@ -206,7 +210,11 @@ namespace clitk {
 
         // Cast
         typedef itk::Image<itk::Vector<OutputPixelType, InputImageType::PixelType::Dimension>, InputImageType::ImageDimension> OutputImageType;
+#if ( ITK_VERSION_MAJOR < 5 )
         typedef itk::VectorCastImageFilter<InputImageType, OutputImageType> FilterType;
+#else
+        typedef itk::CastImageFilter<InputImageType, OutputImageType> FilterType;
+#endif
         typename FilterType::Pointer cast_filter = FilterType::New();
         cast_filter->SetInput(input);
         cast_filter->Update();