Statismo  0.10.1
 All Classes Namespaces Functions Typedefs
itkStandardImageRepresenterTraits.h
1 /*
2  * This file is part of the statismo library.
3  *
4  * Author: Marcel Luethi (marcel.luethi@unibas.ch)
5  *
6  * Copyright (c) 2011 University of Basel
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * Neither the name of the project's author nor the names of its
21  * contributors may be used to endorse or promote products derived from
22  * this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
30  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef __itkStandardImageRepresenterTraits_h
39 #define __itkStandardImageRepresenterTraits_h
40 
41 #include "itkImage.h"
42 #include "itkVector.h"
43 #include "Representer.h"
44 
45 namespace statismo {
46 
47 template<>
48 struct RepresenterTraits<itk::Image<itk::Vector<float, 4u>, 4u> > {
49 
50  typedef itk::Image<itk::Vector<float, 4u>, 4u> VectorImageType;
51  typedef VectorImageType::Pointer DatasetPointerType;
52  typedef VectorImageType::Pointer DatasetConstPointerType;
53  typedef VectorImageType::PointType PointType;
54  typedef VectorImageType::PixelType ValueType;
55 };
56 
57 template<>
58 struct RepresenterTraits<itk::Image<itk::Vector<float, 3u>, 3u> > {
59 
60  typedef itk::Image<itk::Vector<float, 3u>, 3u> VectorImageType;
61  typedef VectorImageType::Pointer DatasetPointerType;
62  typedef VectorImageType::Pointer DatasetConstPointerType;
63  typedef VectorImageType::PointType PointType;
64  typedef VectorImageType::PixelType ValueType;
65 };
66 
67 template<>
68 struct RepresenterTraits<itk::Image<itk::Vector<float, 2u>, 2u> > {
69 
70  typedef itk::Image<itk::Vector<float, 2u>, 2u> VectorImageType;
71  typedef VectorImageType::Pointer DatasetPointerType;
72  typedef VectorImageType::Pointer DatasetConstPointerType;
73  typedef VectorImageType::PointType PointType;
74  typedef VectorImageType::PixelType ValueType;
75 };
76 
77 template<>
78 struct RepresenterTraits<itk::Image<float, 4u> > {
79 
80  typedef itk::Image<float, 4u> ImageType;
81  typedef ImageType::Pointer DatasetPointerType;
82  typedef ImageType::Pointer DatasetConstPointerType;
83  typedef ImageType::PointType PointType;
84  typedef ImageType::PixelType ValueType;
85 };
86 
87 template<>
88 struct RepresenterTraits<itk::Image<float, 3u> > {
89 
90  typedef itk::Image<float, 3u> ImageType;
91  typedef ImageType::Pointer DatasetPointerType;
92  typedef ImageType::Pointer DatasetConstPointerType;
93  typedef ImageType::PointType PointType;
94  typedef ImageType::PixelType ValueType;
95 };
96 
97 template<>
98 struct RepresenterTraits<itk::Image<float, 2u> > {
99 
100  typedef itk::Image<float, 2u> ImageType;
101  typedef ImageType::Pointer DatasetPointerType;
102  typedef ImageType::Pointer DatasetConstPointerType;
103  typedef ImageType::PointType PointType;
104  typedef ImageType::PixelType ValueType;
105 };
106 
107 template<>
108 struct RepresenterTraits<itk::Image<short, 4u> > {
109 
110  typedef itk::Image<short, 4u> ImageType;
111  typedef ImageType::Pointer DatasetPointerType;
112  typedef ImageType::Pointer DatasetConstPointerType;
113  typedef ImageType::PointType PointType;
114  typedef ImageType::PixelType ValueType;
115 };
116 
117 template<>
118 struct RepresenterTraits<itk::Image<short, 3u> > {
119 
120  typedef itk::Image<short, 3u> ImageType;
121  typedef ImageType::Pointer DatasetPointerType;
122  typedef ImageType::Pointer DatasetConstPointerType;
123  typedef ImageType::PointType PointType;
124  typedef ImageType::PixelType ValueType;
125 };
126 
127 template<>
128 struct RepresenterTraits<itk::Image<short, 2u> > {
129 
130  typedef itk::Image<float, 2u> ImageType;
131  typedef ImageType::Pointer DatasetPointerType;
132  typedef ImageType::Pointer DatasetConstPointerType;
133  typedef ImageType::PointType PointType;
134  typedef ImageType::PixelType ValueType;
135 };
136 
137 template<>
138 struct RepresenterTraits<itk::Image<unsigned char, 4u> > {
139 
140  typedef itk::Image<char, 4u> ImageType;
141  typedef ImageType::Pointer DatasetPointerType;
142  typedef ImageType::Pointer DatasetConstPointerType;
143  typedef ImageType::PointType PointType;
144  typedef ImageType::PixelType ValueType;
145 };
146 
147 template<>
148 struct RepresenterTraits<itk::Image<unsigned char, 3u> > {
149 
150  typedef itk::Image<char, 3u> ImageType;
151  typedef ImageType::Pointer DatasetPointerType;
152  typedef ImageType::Pointer DatasetConstPointerType;
153  typedef ImageType::PointType PointType;
154  typedef ImageType::PixelType ValueType;
155 };
156 
157 template<>
158 struct RepresenterTraits<itk::Image<unsigned char, 2u> > {
159 
160  typedef itk::Image<short, 2u> ImageType;
161  typedef ImageType::Pointer DatasetPointerType;
162  typedef ImageType::Pointer DatasetConstPointerType;
163  typedef ImageType::PointType PointType;
164  typedef ImageType::PixelType ValueType;
165 };
166 
167 
168 } // namespace statismo
169 
170 #endif