Home
|
Main Page
|
Modules
|
Namespace List
|
Class Hierarchy
|
Alphabetical List
|
Data Structures
|
File List
|
Namespace Members
|
Data Fields
|
Globals
|
Related Pages
src
Core
Install
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
15
#ifndef __elxMacro_h
16
#define __elxMacro_h
17
18
80
#define elxInstallMacro(_classname) \
81
template < ::elx::ComponentDatabase::IndexType VIndex> \
82
class _classname##_install \
83
{ \
84
public: \
85
typedef typename ::elx::ElastixTypedef<VIndex>::ElastixType ElastixType; \
86
typedef ::elx::ComponentDatabase::ComponentDescriptionType ComponentDescriptionType; \
87
static int DO(::elx::ComponentDatabase * cdb) \
88
{ \
89
ComponentDescriptionType name = ::elx:: _classname <ElastixType>::elxGetClassNameStatic(); \
90
int dummy = ::elx::InstallFunctions< ::elx:: _classname <ElastixType> >::InstallComponent(name, VIndex, cdb); \
91
if ( ::elx::ElastixTypedef<VIndex+1>::Defined() ) \
92
{ return _classname##_install<VIndex+1>::DO( cdb ); } \
93
return dummy; \
94
} \
95
}; \
96
template <> \
97
class _classname##_install < ::elx::NrOfSupportedImageTypes+1 > \
98
{ \
99
public: \
100
typedef ::elx::ComponentDatabase::ComponentDescriptionType ComponentDescriptionType; \
101
static int DO(::elx::ComponentDatabase * ) \
102
{ return 0; } \
103
}; \
104
extern "C" int _classname##InstallComponent( \
105
::elx::ComponentDatabase * _cdb ) \
106
{ \
107
int _InstallDummy##_classname = _classname##_install<1>::DO( _cdb ); \
108
return _InstallDummy##_classname ; \
109
}//ignore semicolon
110
111
129
#define elxInstallComponentFunctionDeclarationMacro(_classname)\
130
extern "C" int _classname##InstallComponent( \
131
::elx::ComponentDatabase * _cdb )
132
133
151
#define elxInstallComponentFunctionCallMacro(_classname)\
152
ret |= _classname##InstallComponent( _cdb )
153
154
162
#define elxPrepareImageTypeSupportMacro() \
163
template < ::elx::ComponentDatabase::IndexType VIndex > \
164
class ElastixTypedef \
165
{ \
166
public: \
167
\
168
\
169
typedef ::itk::Object ElastixType; \
170
typedef ::elx::ComponentDatabase::PixelTypeDescriptionType PixelTypeString; \
171
static PixelTypeString fPixelTypeAsString(void) \
172
{ return PixelTypeString("");} \
173
static PixelTypeString mPixelTypeAsString(void) \
174
{ return PixelTypeString("");} \
175
static unsigned int fDim(void) \
176
{ return 0;} \
177
static unsigned int mDim(void) \
178
{ return 0;} \
179
\
180
\
181
static bool Defined(void) \
182
{ return false;} \
183
}
184
185
213
#define elxSupportedImageTypeMacro(_fPixelType,_fDim,_mPixelType,_mDim,_VIndex) \
214
template<> \
215
class ElastixTypedef < _VIndex > \
216
{ \
217
public: \
218
typedef ::itk::Image< _fPixelType , _fDim > FixedImageType; \
219
typedef ::itk::Image< _mPixelType , _mDim > MovingImageType; \
220
typedef ::elx::ElastixTemplate< FixedImageType, MovingImageType > ElastixType; \
221
typedef ::elx::ComponentDatabase::PixelTypeDescriptionType PixelTypeString; \
222
static PixelTypeString fPixelTypeAsString(void) \
223
{ return PixelTypeString( #_fPixelType );} \
224
static PixelTypeString mPixelTypeAsString(void) \
225
{ return PixelTypeString( #_mPixelType );} \
226
static unsigned int fDim(void) \
227
{ return _fDim ;} \
228
static unsigned int mDim(void) \
229
{ return _mDim ;} \
230
static bool Defined(void) \
231
{ return true; } \
232
}
233
234
254
#define elxClassNameMacro(_name) \
255
static const char * elxGetClassNameStatic( void ) { return _name ; } \
256
virtual const char * elxGetClassName( void ) const { return _name ; }
257
258
270
#define elxout ::xl::xout["standard"]
271
272
273
#endif // end #ifndef __elxMacro_h
274
Generated on 05-12-2013 for elastix by
1.8.5