Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __elxComponentDatabase_h
00016 #define __elxComponentDatabase_h
00017
00018 #include "itkObject.h"
00019 #include "itkObjectFactory.h"
00020 #include <iostream>
00021 #include <string>
00022 #include <utility>
00023 #include <map>
00024
00025
00026 namespace elastix
00027 {
00028
00049 class ComponentDatabase :
00050 public itk::Object
00051 {
00052 public:
00053
00055 typedef ComponentDatabase Self;
00056 typedef itk::Object Superclass;
00057 typedef itk::SmartPointer<Self> Pointer;
00058 typedef itk::SmartPointer<const Self> ConstPointer;
00059
00060 itkNewMacro(Self);
00061 itkTypeMacro(ComponentDatabase, Object);
00062
00064 typedef unsigned int IndexType;
00065
00067 typedef itk::Object ObjectType;
00068 typedef ObjectType::Pointer ObjectPointer;
00069
00073 typedef ObjectPointer (*PtrToCreator)(void);
00074 typedef std::string ComponentDescriptionType;
00075 typedef std::pair<
00076 ComponentDescriptionType,
00077 IndexType> CreatorMapKeyType;
00078 typedef PtrToCreator CreatorMapValueType;
00079 typedef std::map<
00080 CreatorMapKeyType,
00081 CreatorMapValueType> CreatorMapType;
00082 typedef CreatorMapType::value_type CreatorMapEntryType;
00083
00089 typedef std::string PixelTypeDescriptionType;
00090 typedef unsigned int ImageDimensionType;
00091 typedef std::pair<
00092 PixelTypeDescriptionType,
00093 ImageDimensionType> ImageTypeDescriptionType;
00094
00098 typedef std::pair<
00099 ImageTypeDescriptionType,
00100 ImageTypeDescriptionType> IndexMapKeyType;
00101 typedef IndexType IndexMapValueType;
00102 typedef std::map<
00103 IndexMapKeyType,
00104 IndexMapValueType> IndexMapType;
00105 typedef IndexMapType::value_type IndexMapEntryType;
00106
00108 CreatorMapType & GetCreatorMap(void);
00109 IndexMapType & GetIndexMap(void);
00110
00112 int SetCreator(
00113 const ComponentDescriptionType & name,
00114 IndexType i,
00115 PtrToCreator creator );
00116
00117 int SetIndex(
00118 const PixelTypeDescriptionType & fixedPixelType,
00119 ImageDimensionType fixedDimension,
00120 const PixelTypeDescriptionType & movingPixelType,
00121 ImageDimensionType movingDimension,
00122 IndexType i );
00123
00125 PtrToCreator GetCreator(
00126 const ComponentDescriptionType & name,
00127 IndexType i );
00128
00129 IndexType GetIndex(
00130 const PixelTypeDescriptionType & fixedPixelType,
00131 ImageDimensionType fixedDimension,
00132 const PixelTypeDescriptionType & movingPixelType,
00133 ImageDimensionType movingDimension );
00134
00135 protected:
00136
00137 ComponentDatabase(){}
00138 virtual ~ComponentDatabase(){}
00139
00140 CreatorMapType CreatorMap;
00141 IndexMapType IndexMap;
00142
00143 private:
00144 ComponentDatabase( const Self& );
00145 void operator=( const Self& );
00146
00147 };
00148
00149
00150 }
00151
00152
00153
00154 #endif // end #ifndef __elxComponentDatabase_h
00155