go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxMacro.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 #ifndef __elxMacro_h
15 #define __elxMacro_h
16 
25 #include "itkWin32Header.h"
26 
88 #define elxInstallMacro( _classname ) \
89  template< ::elx::ComponentDatabase::IndexType VIndex > \
90  class _classname##_install \
91  { \
92 public: \
93  typedef typename::elx::ElastixTypedef< VIndex >::ElastixType ElastixType; \
94  typedef::elx::ComponentDatabase::ComponentDescriptionType ComponentDescriptionType; \
95  static int DO( ::elx::ComponentDatabase * cdb ) \
96  { \
97  ComponentDescriptionType name = ::elx::_classname< ElastixType >::elxGetClassNameStatic(); \
98  int dummy = ::elx::InstallFunctions< ::elx::_classname< ElastixType > >::InstallComponent( name, VIndex, cdb ); \
99  if( ::elx::ElastixTypedef< VIndex + 1 >::Defined() ) \
100  { return _classname##_install< VIndex + 1 >::DO( cdb ); } \
101  return dummy; \
102  } \
103  }; \
104  template< > \
105  class _classname##_install< ::elx::NrOfSupportedImageTypes + 1 > \
106  { \
107 public: \
108  typedef::elx::ComponentDatabase::ComponentDescriptionType ComponentDescriptionType; \
109  static int DO( ::elx::ComponentDatabase * ) \
110  { return 0; } \
111  }; \
112  extern "C" int _classname##InstallComponent( \
113  ::elx::ComponentDatabase * _cdb ) \
114  { \
115  int _InstallDummy##_classname = _classname##_install< 1 >::DO( _cdb ); \
116  return _InstallDummy##_classname; \
117  } //ignore semicolon
118 
136 #define elxInstallComponentFunctionDeclarationMacro( _classname ) \
137  extern "C" int _classname##InstallComponent( \
138  ::elx::ComponentDatabase * _cdb )
139 
157 #define elxInstallComponentFunctionCallMacro( _classname ) \
158  ret |= _classname##InstallComponent( _cdb )
159 
167 #define elxPrepareImageTypeSupportMacro() \
168  template< ::elx::ComponentDatabase::IndexType VIndex > \
169  \
170  class ElastixTypedef \
171  { \
172 public: \
173  \
174  \
175  typedef::itk::Object ElastixType; \
176  typedef::elx::ComponentDatabase::PixelTypeDescriptionType PixelTypeString; \
177  static PixelTypeString fPixelTypeAsString( void ) \
178  { return PixelTypeString( "" ); } \
179  static PixelTypeString mPixelTypeAsString( void ) \
180  { return PixelTypeString( "" ); } \
181  static unsigned int fDim( void ) \
182  { return 0; } \
183  static unsigned int mDim( void ) \
184  { return 0; } \
185  \
186  \
187  static bool Defined( void ) \
188  { return false; } \
189  }
190 
218 #define elxSupportedImageTypeMacro( _fPixelType, _fDim, _mPixelType, _mDim, _VIndex ) \
219  template< > \
220  class ElastixTypedef< _VIndex > \
221  { \
222 public: \
223  typedef::itk::Image< _fPixelType, _fDim > FixedImageType; \
224  typedef::itk::Image< _mPixelType, _mDim > MovingImageType; \
225  typedef::elx::ElastixTemplate< FixedImageType, MovingImageType > ElastixType; \
226  typedef::elx::ComponentDatabase::PixelTypeDescriptionType PixelTypeString; \
227  static PixelTypeString fPixelTypeAsString( void ) \
228  { return PixelTypeString( #_fPixelType ); } \
229  static PixelTypeString mPixelTypeAsString( void ) \
230  { return PixelTypeString( #_mPixelType ); } \
231  static unsigned int fDim( void ) \
232  { return _fDim; } \
233  static unsigned int mDim( void ) \
234  { return _mDim; } \
235  static bool Defined( void ) \
236  { return true; } \
237  }
238 
258 #define elxClassNameMacro( _name ) \
259  static const char * elxGetClassNameStatic( void ) { return _name; } \
260  virtual const char * elxGetClassName( void ) const { return _name; }
261 
273 #define elxout ::xl::xout[ "standard" ]
274 
275 #endif // end #ifndef __elxMacro_h


Generated on 11-03-2014 for elastix by doxygen 1.8.6 elastix logo