MeVisLabToolboxReference
|
File containing a class and macros to build an object factory for itk classes. More...
#include <mlITKSupport.h>
Go to the source code of this file.
Classes | |
class | ml::MLITKObjectFactory |
A class to manage a void pointer to an object of a certain class type a type dataType and dimension dim. More... | |
Namespaces | |
namespace | ml |
Define the namespace name like in the ML. Default is | |
Defines | |
#define | _ML_CREATE_ITK_OBJECT_VOID(ML_OUTDATATYPE, ITKOUTDATATYPE, MLINDATATYPE, ITKINDATATYPE, DIM, CLASS_NAME) |
Internal helper macro, to be used only within this file. | |
#define | _ML_DESTROY_ITK_OBJECT_VOID(MLOUTDATATYPE, ITKOUTDATATYPE, MLINDATATYPE, ITKINDATATYPE, DIM, CLASS_NAME) |
See _ML_CREATE_ITK_OBJECT_VOID; however this is for object destruction. | |
#define | _ML_CREATE_ITK_OBJECT_VOID_WO_DT(ML_OUTDATATYPE, ITKOUTDATATYPE, MLINDATATYPE, ITKINDATATYPE, DIM, CLASS_NAME) |
Internal helper macro, to be used only within this file. | |
#define | _ML_DESTROY_ITK_OBJECT_VOID_WO_DT(MLOUTDATATYPE, ITKOUTDATATYPE, MLINDATATYPE, ITKINDATATYPE, DIM, CLASS_NAME) |
See _ML_CREATE_ITK_OBJECT_VOID; however this is for object destruction. | |
#define | MLITKImplementFactoryFuncs(CLASS_NAME, NAMESPACE, NEW_FUNC, DEL_FUNC) |
Creates code for two static factory functions, one to create objects of type NAMESPACE::CLASS_NAME and to remove them. | |
#define | MLITKObjectFactoryInit(FACTORY, CLASS_NAME) FACTORY._setCreatorAndDestructor(CLASS_NAME##Creator, CLASS_NAME##Destructor); |
File containing a class and macros to build an object factory for itk classes.
Definition in file mlITKObjectFactory.h.
#define _ML_CREATE_ITK_OBJECT_VOID | ( | ML_OUTDATATYPE, | |
ITKOUTDATATYPE, | |||
MLINDATATYPE, | |||
ITKINDATATYPE, | |||
DIM, | |||
CLASS_NAME | |||
) |
{ \ return new CLASS_NAME<ITKINDATATYPE, DIM>(); \ } \
Internal helper macro, to be used only within this file.
It expands to the code to create the itk object for all data types and dims.
ML_OUTDATATYPE | is the ML voxel type of output, currently unused. |
ITKOUTDATATYPE | is the ITK voxel type of the output image(s) of the ITK class, currently unused. |
MLINDATATYPE | is the ML voxel type of the input image(s), currently unused. |
ITKINDATATYPE | is the ITK voxel type of the input image(s). |
DIM | is the dimension the ITK class is compiled with. |
CLASS_NAME | is the class name of the ITK algorithm. |
Definition at line 26 of file mlITKObjectFactory.h.
#define _ML_CREATE_ITK_OBJECT_VOID_WO_DT | ( | ML_OUTDATATYPE, | |
ITKOUTDATATYPE, | |||
MLINDATATYPE, | |||
ITKINDATATYPE, | |||
DIM, | |||
CLASS_NAME | |||
) |
{ \ return new CLASS_NAME<DIM>(); \ } \
Internal helper macro, to be used only within this file.
It expands to the code to create the itk object for all data types and dims.
ML_OUTDATATYPE | is the ML voxel type of output, currently unused. |
ITKOUTDATATYPE | is the ITK voxel type of the output image(s) of the ITK class, currently unused. |
MLINDATATYPE | is the ML voxel type of the input image(s), currently unused. |
ITKINDATATYPE | is the ITK voxel type of the input image(s). |
DIM | is the dimension the ITK class is compiled with. |
CLASS_NAME | is the class name of the ITK algorithm. |
Definition at line 56 of file mlITKObjectFactory.h.
#define _ML_DESTROY_ITK_OBJECT_VOID | ( | MLOUTDATATYPE, | |
ITKOUTDATATYPE, | |||
MLINDATATYPE, | |||
ITKINDATATYPE, | |||
DIM, | |||
CLASS_NAME | |||
) |
{ \
delete (CLASS_NAME<ITKINDATATYPE, DIM>*)itkFactoryObj; \
} \
See _ML_CREATE_ITK_OBJECT_VOID; however this is for object destruction.
MLOUTDATATYPE | is the ML voxel type of output, currently unused. |
ITKOUTDATATYPE | is the ITK voxel type of the output image(s) of the ITK class, currently unused. |
MLINDATATYPE | is the ML voxel type of the input image(s), currently unused. |
ITKINDATATYPE | is the ITK voxel type of the input image(s). |
DIM | is the dimension the ITK class is compiled with. |
CLASS_NAME | is the class name of the ITK algorithm. |
Definition at line 40 of file mlITKObjectFactory.h.
#define _ML_DESTROY_ITK_OBJECT_VOID_WO_DT | ( | MLOUTDATATYPE, | |
ITKOUTDATATYPE, | |||
MLINDATATYPE, | |||
ITKINDATATYPE, | |||
DIM, | |||
CLASS_NAME | |||
) |
{ \ delete static_cast<CLASS_NAME<DIM>*>(itkFactoryObj); \ } \
See _ML_CREATE_ITK_OBJECT_VOID; however this is for object destruction.
MLOUTDATATYPE | is the ML voxel type of output, currently unused. |
ITKOUTDATATYPE | is the ITK voxel type of the output image(s) of the ITK class, currently unused. |
MLINDATATYPE | is the ML voxel type of the input image(s), currently unused. |
ITKINDATATYPE | is the ITK voxel type of the input image(s). |
DIM | is the dimension the ITK class is compiled with. |
CLASS_NAME | is the class name of the ITK algorithm. |
Definition at line 70 of file mlITKObjectFactory.h.
#define MLITKImplementFactoryFuncs | ( | CLASS_NAME, | |
NAMESPACE, | |||
NEW_FUNC, | |||
DEL_FUNC | |||
) |
/*--------------------------------------------------------------------*/ \ \ /*--------------------------------------------------------------------*/ \ static void *CLASS_NAME##Creator(MLDataType dType, unsigned int dim){ \ /* Call correct template version of object creation for all types and dims. */ \ ML_IMPLEMENT_ALL_ITK_6D_CASES("CLASS_NAME##creator())", \ NEW_FUNC, \ NAMESPACE::CLASS_NAME, dType, dim); \ return NULL; /* Error */ \ } \ \ /*--------------------------------------------------------------------*/ \ \ \ /*--------------------------------------------------------------------*/ \ static void CLASS_NAME##Destructor(void *itkFactoryObj, MLDataType dType, unsigned int dim){ \ /* Call correct template version of object destruction for all types and dims. */ \ ML_IMPLEMENT_ALL_ITK_6D_CASES("CLASS_NAME##destructor()", \ DEL_FUNC, \ NAMESPACE::CLASS_NAME, dType, dim); \ } \
Creates code for two static factory functions, one to create objects of type NAMESPACE::CLASS_NAME and to remove them.
Their template arguments are specified automatically by function arguments dataType and dim.
CLASS_NAME | specifies the class the factory function shall be created for. |
NAMESPACE | specifies the namespace in which CLASS_NAME resides. |
Definition at line 83 of file mlITKObjectFactory.h.
#define MLITKObjectFactoryInit | ( | FACTORY, | |
CLASS_NAME | |||
) | FACTORY._setCreatorAndDestructor(CLASS_NAME##Creator, CLASS_NAME##Destructor); |
Initializes an MLITKObjectFactory with its creation and destruction
functions which must have been implemented by MLITKImplementFactoryFuncs.
FACTORY | specifies the factory instance to be initialized. |
CLASS_NAME | specifies the class for which the init functions |
have been created.
Definition at line 114 of file mlITKObjectFactory.h.