DGtal  1.5.beta
ITKIOTrait.h
1 
17 #pragma once
18 
31 #if defined(ITKIOTrait_RECURSES)
32 #error Recursive header files inclusion detected in ITKIOTrait.h
33 #else // defined(ITKIOTrait_RECURSES)
35 #define ITKIOTrait_RECURSES
36 
37 #if !defined ITKIOTrait_h
39 #define ITKIOTrait_h
40 
41 #include "DGtal/base/BasicFunctors.h"
42 
43 namespace DGtal
44 {
48  [[maybe_unused]] const auto ITK_IO_IMAGE_EXT = {"nii", "gz" ,"mha", "mhd", "tiff", "nrrd",
49  "tif", "pic", "mnc"};
50 
51 
53  // class ITKIOTrait
60  template <typename Value>
61  struct ITKIOTrait
62  {
63  typedef Value ValueOut; // Associated ITK image value type
64  typedef functors::Cast<ValueOut> DefaultWriteFunctor; // Default functor used by ITKWriter
65  typedef functors::Cast<Value> DefaultReadFunctor; // Default functor used by ITKReader
66 
67  private:
68 
74  ITKIOTrait(const ITKIOTrait & other);
76 
77 
78  }; // end of struct ITKIOTrait
79 
80  // specialization
81  template <>
82  struct ITKIOTrait<bool>
83  {
84  typedef unsigned char ValueOut;
87  };
88 
89 } // namespace DGtal
90 
91 
92 #endif // !defined ITKIOTrait_h
93 
94 #undef ITKIOTrait_RECURSES
95 #endif // else defined(ITKIOTrait_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
const auto ITK_IO_IMAGE_EXT
Definition: ITKIOTrait.h:48
unsigned char ValueOut
Definition: ITKIOTrait.h:84
functors::Cast< bool > DefaultReadFunctor
Definition: ITKIOTrait.h:86
functors::Cast< unsigned char > DefaultWriteFunctor
Definition: ITKIOTrait.h:85
Aim: Provide type trait for ITK reader and ITK writer.
Definition: ITKIOTrait.h:62
ITKIOTrait & operator=(const ITKIOTrait &other)
functors::Cast< ValueOut > DefaultWriteFunctor
Definition: ITKIOTrait.h:64
functors::Cast< Value > DefaultReadFunctor
Definition: ITKIOTrait.h:65
ITKIOTrait(const ITKIOTrait &other)
Aim: Define a simple functor using the static cast operator.