00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED 00020 #define MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED 00021 00022 #include <itkCastImageFilter.h> 00023 #include <mitkImageToItk.h> 00024 00025 // File created using Visual Studio by replacing regular expression 00026 // itkImgFunc\(itk\:\:Image<(.*),(.*)> 00027 // with 00028 // itkImgFunc<\1, \2>(itk::Image<\1,\2> 00029 // from mitkAltInstantiateAccessFunction.h 00030 00031 //--------------------------------- instantiation functions ------------------------------ 00032 //##Documentation 00033 //## @brief Instantiate access function without additional parammeters 00034 //## for all datatypes and dimensions 00035 //## 00036 //## Use this macro once after the definition of your access function. 00037 //## Some compilers have memory problems without the explicit instantiation. 00038 //## You may need to move the access function to a separate file. The CMake macro 00039 //## MITK_MULTIPLEX_PICTYPE can help you with that. See \c mitk/CMake/CoreHelpers.cmake 00040 //## for documentation. 00041 //## 00042 //## \note If you experience compiler errors, try to 00043 //## include mitkAltInstantiateAccessFunctions.h and 00044 //## add "Alt" (for alternate) before the call 00045 //## (e.g. AltInstantiateAccessFunction(...)). 00046 //## \sa InstantiateAccessFunction_1 00047 //## \sa InstantiateAccessFunction_2 00048 //## @ingroup Adaptor 00049 #define InstantiateAccessFunction(itkImgFunc) \ 00050 InstantiateAccessFunctionForFixedDimension(itkImgFunc, 2) \ 00051 InstantiateAccessFunctionForFixedDimension(itkImgFunc, 3) 00052 00053 //##Documentation 00054 //## @brief Instantiate access function with one additional parammeter 00055 //## for all datatypes and dimensions 00056 //## 00057 //## Use this macro once after the definition of your access function. 00058 //## Some compilers have memory problems without the explicit instantiation. 00059 //## You may need to move the access function to a separate file. 00060 //## \note If you experience compiler errors, try to 00061 //## include mitkAltInstantiateAccessFunctions.h and 00062 //## add "Alt" (for alternate) before the call 00063 //## (e.g. AltInstantiateAccessFunction(...)). 00064 //## \sa InstantiateAccessFunction 00065 //## \sa InstantiateAccessFunction_2 00066 //## @ingroup Adaptor 00067 #define InstantiateAccessFunction_1(itkImgFunc, param1Type) \ 00068 InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, 2, param1Type) \ 00069 InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, 3, param1Type) 00070 00071 //##Documentation 00072 //## @brief Instantiate access function with two additional parammeters 00073 //## for all datatypes and dimensions 00074 //## 00075 //## Use this macro once after the definition of your access function. 00076 //## Some compilers have memory problems without the explicit instantiation. 00077 //## You may need to move the access function to a separate file. 00078 //## \sa InstantiateAccessFunction 00079 //## \sa InstantiateAccessFunction_1 00080 //## @ingroup Adaptor 00081 #define InstantiateAccessFunction_2(itkImgFunc, param1Type, param2Type) \ 00082 InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, 2, param1Type, param2Type) \ 00083 InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, 3, param1Type, param2Type) 00084 00085 //##Documentation 00086 //## @brief Instantiate access function without additional parammeters 00087 //## for all datatypes, but fixed dimension 00088 //## 00089 //## Use this macro once after the definition of your access function. 00090 //## Some compilers have memory problems without the explicit instantiation. 00091 //## You may need to move the access function to a separate file. 00092 //## \note If you experience compiler errors, try to 00093 //## include mitkAltInstantiateAccessFunctions.h and 00094 //## add "Alt" (for alternate) before the call 00095 //## (e.g. AltInstantiateAccessFunction(...)). 00096 //## \sa InstantiateAccessFunctionForFixedDimension_1 00097 //## \sa InstantiateAccessFunctionForFixedDimension_2 00098 //## @ingroup Adaptor 00099 #define InstantiateAccessFunctionForFixedDimension(itkImgFunc, dimension) \ 00100 template void itkImgFunc<double, dimension>(itk::Image<double, dimension>*); \ 00101 template void itkImgFunc<float, dimension>(itk::Image<float, dimension>*); \ 00102 template void itkImgFunc<int, dimension>(itk::Image<int, dimension>*); \ 00103 template void itkImgFunc<unsigned int, dimension>(itk::Image<unsigned int, dimension>*); \ 00104 template void itkImgFunc<short, dimension>(itk::Image<short, dimension>*); \ 00105 template void itkImgFunc<unsigned short, dimension>(itk::Image<unsigned short, dimension>*); \ 00106 template void itkImgFunc<char, dimension>(itk::Image<char, dimension>*); \ 00107 template void itkImgFunc<unsigned char, dimension>(itk::Image<unsigned char, dimension>*); 00108 00109 //##Documentation 00110 //## @brief Instantiate access function with one additional parammeter 00111 //## for all datatypes, but fixed dimension 00112 //## 00113 //## Use this macro once after the definition of your access function. 00114 //## Some compilers have memory problems without the explicit instantiation. 00115 //## You may need to move the access function to a separate file. 00116 //## \note If you experience compiler errors, try to 00117 //## include mitkAltInstantiateAccessFunctions.h and 00118 //## add "Alt" (for alternate) before the call 00119 //## (e.g. AltInstantiateAccessFunction(...)). 00120 //## \sa InstantiateAccessFunctionForFixedDimension 00121 //## \sa InstantiateAccessFunctionForFixedDimension_2 00122 //## @ingroup Adaptor 00123 #define InstantiateAccessFunctionForFixedDimension_1(itkImgFunc, dimension, param1Type) \ 00124 template void itkImgFunc<double, dimension>(itk::Image<double, dimension>*, param1Type); \ 00125 template void itkImgFunc<float, dimension>(itk::Image<float, dimension>*, param1Type); \ 00126 template void itkImgFunc<int, dimension>(itk::Image<int, dimension>*, param1Type); \ 00127 template void itkImgFunc<unsigned int, dimension>(itk::Image<unsigned int, dimension>*, param1Type); \ 00128 template void itkImgFunc<short, dimension>(itk::Image<short, dimension>*, param1Type); \ 00129 template void itkImgFunc<unsigned short, dimension>(itk::Image<unsigned short, dimension>*, param1Type); \ 00130 template void itkImgFunc<char, dimension>(itk::Image<char, dimension>*, param1Type); \ 00131 template void itkImgFunc<unsigned char, dimension>(itk::Image<unsigned char, dimension>*, param1Type); 00132 00133 //##Documentation 00134 //## @brief Instantiate access function with two additional parammeters 00135 //## for all datatypes, but fixed dimension 00136 //## 00137 //## Use this macro once after the definition of your access function. 00138 //## Some compilers have memory problems without the explicit instantiation. 00139 //## You may need to move the access function to a separate file. 00140 //## \note If you experience compiler errors, try to 00141 //## include mitkAltInstantiateAccessFunctions.h and 00142 //## add "Alt" (for alternate) before the call 00143 //## (e.g. AltInstantiateAccessFunction(...)). 00144 //## \sa InstantiateAccessFunctionForFixedDimension 00145 //## \sa InstantiateAccessFunctionForFixedDimension_1 00146 //## @ingroup Adaptor 00147 #define InstantiateAccessFunctionForFixedDimension_2(itkImgFunc, dimension, param1Type, param2Type) \ 00148 template void itkImgFunc<double, dimension>(itk::Image<double, dimension>*, param1Type, param2Type); \ 00149 template void itkImgFunc<float, dimension>(itk::Image<float, dimension>*, param1Type, param2Type); \ 00150 template void itkImgFunc<int, dimension>(itk::Image<int, dimension>*, param1Type, param2Type); \ 00151 template void itkImgFunc<unsigned int, dimension>(itk::Image<unsigned int, dimension>*, param1Type, param2Type); \ 00152 template void itkImgFunc<short, dimension>(itk::Image<short, dimension>*, param1Type, param2Type); \ 00153 template void itkImgFunc<unsigned short, dimension>(itk::Image<unsigned short, dimension>*, param1Type, param2Type); \ 00154 template void itkImgFunc<char, dimension>(itk::Image<char, dimension>*, param1Type, param2Type); \ 00155 template void itkImgFunc<unsigned char, dimension>(itk::Image<unsigned char, dimension>*, param1Type, param2Type); 00156 00157 //##Documentation 00158 //## @brief Instantiate access function without additional parammeters 00159 //## for a fixed datatype, but all dimensions 00160 //## 00161 //## Use this macro once after the definition of your access function. 00162 //## Some compilers have memory problems without the explicit instantiation. 00163 //## You may need to move the access function to a separate file. 00164 //## \note If you experience compiler errors, try to 00165 //## include mitkAltInstantiateAccessFunctions.h and 00166 //## add "Alt" (for alternate) before the call 00167 //## (e.g. AltInstantiateAccessFunction(...)). 00168 //## \sa InstantiateAccessFunctionForFixedPixelType_1 00169 //## \sa InstantiateAccessFunctionForFixedPixelType_2 00170 //## @ingroup Adaptor 00171 #define InstantiateAccessFunctionForFixedPixelType(itkImgFunc, pixelType) \ 00172 template void itkImgFunc<pixelType, 2>(itk::Image<pixelType, 2>*); \ 00173 template void itkImgFunc<pixelType, 3>(itk::Image<pixelType, 3>*); 00174 00175 //##Documentation 00176 //## @brief Instantiate access function with one additional parammeter 00177 //## for a fixed datatype, but all dimensions 00178 //## 00179 //## Use this macro once after the definition of your access function. 00180 //## Some compilers have memory problems without the explicit instantiation. 00181 //## You may need to move the access function to a separate file. 00182 //## \note If you experience compiler errors, try to 00183 //## include mitkAltInstantiateAccessFunctions.h and 00184 //## add "Alt" (for alternate) before the call 00185 //## (e.g. AltInstantiateAccessFunction(...)). 00186 //## \sa InstantiateAccessFunctionForFixedPixelType 00187 //## \sa InstantiateAccessFunctionForFixedPixelType_2 00188 //## @ingroup Adaptor 00189 #define InstantiateAccessFunctionForFixedPixelType_1(itkImgFunc, pixelType, param1Type) \ 00190 template void itkImgFunc<pixelType, 2>(itk::Image<pixelType, 2>*, param1Type); \ 00191 template void itkImgFunc<pixelType, 3>(itk::Image<pixelType, 3>*, param1Type); 00192 00193 //##Documentation 00194 //## @brief Instantiate access function with two additional parammeters 00195 //## for a fixed datatype, but all dimensions 00196 //## 00197 //## Use this macro once after the definition of your access function. 00198 //## Some compilers have memory problems without the explicit instantiation. 00199 //## You may need to move the access function to a separate file. 00200 //## \note If you experience compiler errors, try to 00201 //## include mitkAltInstantiateAccessFunctions.h and 00202 //## add "Alt" (for alternate) before the call 00203 //## (e.g. AltInstantiateAccessFunction(...)). 00204 //## \sa InstantiateAccessFunctionForFixedPixelType 00205 //## \sa InstantiateAccessFunctionForFixedPixelType_1 00206 //## @ingroup Adaptor 00207 #define InstantiateAccessFunctionForFixedPixelType_2(itkImgFunc, pixelType, param1Type, param2Type)\ 00208 template void itkImgFunc<pixelType, 2>(itk::Image<pixelType, 2>*, param1Type, param2Type); \ 00209 template void itkImgFunc<pixelType, 3>(itk::Image<pixelType, 3>*, param1Type, param2Type); 00210 00211 #endif // of MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED