DGtal  1.3.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)
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 {
48  const auto ITK_IO_IMAGE_EXT = {"nii", "gz" ,"mha", "mhd", "tiff", "nrrd",
49  "tif", "pic", "mnc"};
50 
51 
53 // class ITKIOTrait
59 template <typename Value>
60 struct ITKIOTrait
61 {
62  typedef Value ValueOut; // Associated ITK image value type
63  typedef functors::Cast<ValueOut> DefaultWriteFunctor; // Default functor used by ITKWriter
64  typedef functors::Cast<Value> DefaultReadFunctor; // Default functor used by ITKReader
65 
66 private:
67 
72  ITKIOTrait();
73  ITKIOTrait(const ITKIOTrait & other);
74  ITKIOTrait& operator=(const ITKIOTrait& other);
75 
76 
77 }; // end of struct ITKIOTrait
78 
79 // specialization
80 template <>
81 struct ITKIOTrait<bool>
82 {
83  typedef unsigned char ValueOut;
86 };
87 
88 } // namespace DGtal
89 
90 
91 #endif // !defined ITKIOTrait_h
92 
93 #undef ITKIOTrait_RECURSES
94 #endif // else defined(ITKIOTrait_RECURSES)
DGtal::ITKIOTrait
Aim: Provide type trait for ITK reader and ITK writer.
Definition: ITKIOTrait.h:60
DGtal::ITKIOTrait::DefaultWriteFunctor
functors::Cast< ValueOut > DefaultWriteFunctor
Definition: ITKIOTrait.h:63
DGtal::ITK_IO_IMAGE_EXT
const auto ITK_IO_IMAGE_EXT
Definition: ITKIOTrait.h:48
DGtal::ITKIOTrait< bool >::DefaultWriteFunctor
functors::Cast< unsigned char > DefaultWriteFunctor
Definition: ITKIOTrait.h:84
DGtal::ITKIOTrait::operator=
ITKIOTrait & operator=(const ITKIOTrait &other)
DGtal::functors::Cast
Aim: Define a simple functor using the static cast operator.
Definition: BasicFunctors.h:393
DGtal::ITKIOTrait< bool >::ValueOut
unsigned char ValueOut
Definition: ITKIOTrait.h:83
DGtal::ITKIOTrait::ValueOut
Value ValueOut
Definition: ITKIOTrait.h:62
DGtal::ITKIOTrait< bool >::DefaultReadFunctor
functors::Cast< bool > DefaultReadFunctor
Definition: ITKIOTrait.h:85
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::ITKIOTrait::DefaultReadFunctor
functors::Cast< Value > DefaultReadFunctor
Definition: ITKIOTrait.h:64
DGtal::ITKIOTrait::ITKIOTrait
ITKIOTrait()
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38