Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkImageCastPart3.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include <mitkImageCast.txx>
18 
19 #include <itkDiffusionTensor3D.h>
20 #include <itkRGBPixel.h>
21 #include <itkVector.h>
22 
23 namespace mitk
24 {
25  typedef itk::Image<itk::RGBPixel<unsigned char>, 2> itkImageRGBUC2;
26  typedef itk::Image<itk::DiffusionTensor3D<float>, 2> itkImageDTIF2;
27  typedef itk::Image<itk::DiffusionTensor3D<double>, 2> itkImageDTID2;
28 
29  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageRGBUC2 *, itk::SmartPointer<itkImageRGBUC2> &);
30  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageDTIF2 *, itk::SmartPointer<itkImageDTIF2> &);
31  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageDTID2 *, itk::SmartPointer<itkImageDTID2> &);
32 
33  typedef itk::Image<itk::RGBPixel<unsigned char>, 3> itkImageRGBUC3;
34  typedef itk::Image<itk::DiffusionTensor3D<float>, 3> itkImageDTIF3;
35  typedef itk::Image<itk::DiffusionTensor3D<double>, 3> itkImageDTID3;
36 
37  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageRGBUC3 *, itk::SmartPointer<itkImageRGBUC3> &);
38  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageDTIF3 *, itk::SmartPointer<itkImageDTIF3> &);
39  template void MITKCORE_EXPORT _CastToItkImage2Access(const itkImageDTID3 *, itk::SmartPointer<itkImageDTID3> &);
40 
41 #define CAST_HUNDRED_VECS(HUN) \
42  CAST_TEN_VECS(HUN) \
43  CAST_TEN_VECS(HUN + 10) \
44  CAST_TEN_VECS(HUN + 20) \
45  CAST_TEN_VECS(HUN + 30) \
46  CAST_TEN_VECS(HUN + 40) \
47  CAST_TEN_VECS(HUN + 50) \
48  CAST_TEN_VECS(HUN + 60) \
49  CAST_TEN_VECS(HUN + 70) \
50  CAST_TEN_VECS(HUN + 80) \
51  CAST_TEN_VECS(HUN + 90)
52 
53 #define CAST_TEN_VECS(TEN) \
54  CAST_N_VEC(TEN + 1) \
55  CAST_N_VEC(TEN + 2) \
56  CAST_N_VEC(TEN + 3) \
57  CAST_N_VEC(TEN + 4) \
58  CAST_N_VEC(TEN + 5) \
59  CAST_N_VEC(TEN + 6) \
60  CAST_N_VEC(TEN + 7) \
61  CAST_N_VEC(TEN + 8) \
62  CAST_N_VEC(TEN + 9) \
63  CAST_N_VEC(TEN + 10)
64 
65 #define CAST_N_VEC(N_DIRS) \
66  _CAST_N_VEC(N_DIRS, double) \
67  _CAST_N_VEC(N_DIRS, float) \
68  _CAST_N_VEC(N_DIRS, short)
69 
70 #define _CAST_N_VEC(N_DIRS, PIXTYPE) \
71  template void MITKCORE_EXPORT _CastToItkImage2Access( \
72  const itk::Image<itk::Vector<PIXTYPE, N_DIRS>, 2> *, \
73  itk::SmartPointer<itk::Image<itk::Vector<PIXTYPE, N_DIRS>, 2>> &); \
74  template void MITKCORE_EXPORT _CastToItkImage2Access( \
75  const itk::Image<itk::Vector<PIXTYPE, N_DIRS>, 3> *, \
76  itk::SmartPointer<itk::Image<itk::Vector<PIXTYPE, N_DIRS>, 3>> &);
77 
78  // the following lines allow for fixed-size vector images up to a certain size limit
79  // (commented out for shorter compile times)
80 
81  // CAST_HUNDRED_VECS(0)
82  // CAST_HUNDRED_VECS(100)
83  // CAST_HUNDRED_VECS(200)
84  // CAST_HUNDRED_VECS(300)
85 
86  // allow for fixed-size vectors of specific length
87  // (inspired by itkPointshell.cpp, precompiled q-ball configs)
88 
89  // CAST_TEN_VECS(0)
90  // CAST_N_VEC(11)
91  // CAST_N_VEC(12)
92  CAST_N_VEC(2)
93  CAST_N_VEC(3)
94  CAST_N_VEC(6)
95  CAST_N_VEC(42)
96  CAST_N_VEC(92)
97  CAST_N_VEC(162)
98  CAST_N_VEC(252)
99  CAST_N_VEC(362)
100  CAST_N_VEC(492)
101  CAST_N_VEC(642)
102  CAST_N_VEC(812)
103  CAST_N_VEC(1002)
104 }
itk::Image< itk::DiffusionTensor3D< float >, 2 > itkImageDTIF2
itk::Image< itk::DiffusionTensor3D< double >, 3 > itkImageDTID3
#define MITKCORE_EXPORT
itk::Image< itk::RGBPixel< unsigned char >, 2 > itkImageRGBUC2
DataCollection - Class to facilitate loading/accessing structured data.
itk::Image< itk::DiffusionTensor3D< float >, 3 > itkImageDTIF3
itk::Image< itk::DiffusionTensor3D< double >, 2 > itkImageDTID2
#define CAST_N_VEC(N_DIRS)
void _CastToItkImage2Access(const itk::Image< TPixel, VImageDimension > *itkInputImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Definition: typeExtension.h:33
itk::Image< itk::RGBPixel< unsigned char >, 3 > itkImageRGBUC3