DGtal  0.9.2
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)
34 
35 #define ITKIOTrait_RECURSES
36 
37 #if !defined ITKIOTrait_h
38 
39 #define ITKIOTrait_h
40 
41 #include "DGtal/base/BasicFunctors.h"
42 
43 namespace DGtal
44 {
45 
47 // class ITKIOTrait
53 template <typename Value>
54 struct ITKIOTrait
55 {
56  typedef Value ValueOut; // Associated ITK image value type
57  typedef functors::Cast<ValueOut> DefaultWriteFunctor; // Default functor used by ITKWriter
58  typedef functors::Cast<Value> DefaultReadFunctor; // Default functor used by ITKReader
59 
60 private:
61 
66  ITKIOTrait();
67  ITKIOTrait(const ITKIOTrait & other);
68  ITKIOTrait& operator=(const ITKIOTrait& other);
69 
70 
71 }; // end of struct ITKIOTrait
72 
73 // specialization
74 template <>
75 struct ITKIOTrait<bool>
76 {
77  typedef unsigned char ValueOut;
80 };
81 
82 } // namespace DGtal
83 
84 
85 #endif // !defined ITKIOTrait_h
86 
87 #undef ITKIOTrait_RECURSES
88 #endif // else defined(ITKIOTrait_RECURSES)
Aim: Provide type trait for ITK reader and ITK writer.
Definition: ITKIOTrait.h:54
ITKIOTrait & operator=(const ITKIOTrait &other)
functors::Cast< unsigned char > DefaultWriteFunctor
Definition: ITKIOTrait.h:78
Aim: Define a simple functor using the static cast operator.
unsigned char ValueOut
Definition: ITKIOTrait.h:77
functors::Cast< bool > DefaultReadFunctor
Definition: ITKIOTrait.h:79
DGtal is the top-level namespace which contains all DGtal functions and types.
functors::Cast< Value > DefaultReadFunctor
Definition: ITKIOTrait.h:58
functors::Cast< ValueOut > DefaultWriteFunctor
Definition: ITKIOTrait.h:57