DGtal 1.3.0
Loading...
Searching...
No Matches
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
43namespace DGtal
44{
48 const auto ITK_IO_IMAGE_EXT = {"nii", "gz" ,"mha", "mhd", "tiff", "nrrd",
49 "tif", "pic", "mnc"};
50
51
53// class ITKIOTrait
59template <typename Value>
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
66private:
67
73 ITKIOTrait(const ITKIOTrait & other);
75
76
77}; // end of struct ITKIOTrait
78
79// specialization
80template <>
81struct 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 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:83
functors::Cast< bool > DefaultReadFunctor
Definition: ITKIOTrait.h:85
functors::Cast< unsigned char > DefaultWriteFunctor
Definition: ITKIOTrait.h:84
Aim: Provide type trait for ITK reader and ITK writer.
Definition: ITKIOTrait.h:61
functors::Cast< ValueOut > DefaultWriteFunctor
Definition: ITKIOTrait.h:63
functors::Cast< Value > DefaultReadFunctor
Definition: ITKIOTrait.h:64
ITKIOTrait & operator=(const ITKIOTrait &other)
ITKIOTrait(const ITKIOTrait &other)
Aim: Define a simple functor using the static cast operator.