go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxComponentDatabase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __elxComponentDatabase_h
20 #define __elxComponentDatabase_h
21 
22 #include "itkObject.h"
23 #include "itkObjectFactory.h"
24 #include <iostream>
25 #include <string>
26 #include <utility>
27 #include <map>
28 
29 namespace elastix
30 {
31 
53  public itk::Object
54 {
55 public:
56 
59  typedef itk::Object Superclass;
60  typedef itk::SmartPointer< Self > Pointer;
61  typedef itk::SmartPointer< const Self > ConstPointer;
62 
63  itkNewMacro( Self );
64  itkTypeMacro( ComponentDatabase, Object );
65 
67  typedef unsigned int IndexType;
68 
70  typedef itk::Object ObjectType;
71  typedef ObjectType::Pointer ObjectPointer;
72 
76  typedef ObjectPointer (* PtrToCreator)( void );
77  typedef std::string ComponentDescriptionType;
78  typedef std::pair<
80  IndexType > CreatorMapKeyType;
82  typedef std::map<
84  CreatorMapValueType > CreatorMapType;
85  typedef CreatorMapType::value_type CreatorMapEntryType;
86 
92  typedef std::string PixelTypeDescriptionType;
93  typedef unsigned int ImageDimensionType;
94  typedef std::pair<
96  ImageDimensionType > ImageTypeDescriptionType;
97 
101  typedef std::pair<
103  ImageTypeDescriptionType > IndexMapKeyType;
104  typedef IndexType IndexMapValueType;
105  typedef std::map<
107  IndexMapValueType > IndexMapType;
108  typedef IndexMapType::value_type IndexMapEntryType;
109 
111  CreatorMapType & GetCreatorMap( void );
112 
113  IndexMapType & GetIndexMap( void );
114 
116  int SetCreator(
117  const ComponentDescriptionType & name,
118  IndexType i,
119  PtrToCreator creator );
120 
121  int SetIndex(
122  const PixelTypeDescriptionType & fixedPixelType,
123  ImageDimensionType fixedDimension,
124  const PixelTypeDescriptionType & movingPixelType,
125  ImageDimensionType movingDimension,
126  IndexType i );
127 
130  const ComponentDescriptionType & name,
131  IndexType i );
132 
133  IndexType GetIndex(
134  const PixelTypeDescriptionType & fixedPixelType,
135  ImageDimensionType fixedDimension,
136  const PixelTypeDescriptionType & movingPixelType,
137  ImageDimensionType movingDimension );
138 
139 protected:
140 
142  virtual ~ComponentDatabase(){}
143 
144  CreatorMapType CreatorMap;
145  IndexMapType IndexMap;
146 
147 private:
148 
149  ComponentDatabase( const Self & ); // purposely not implemented
150  void operator=( const Self & ); // purposely not implemented
151 
152 };
153 
154 } // end namespace elastix
155 
156 #endif // end #ifndef __elxComponentDatabase_h
itk::SmartPointer< const Self > ConstPointer
std::map< CreatorMapKeyType, CreatorMapValueType > CreatorMapType
ObjectPointer(* PtrToCreator)(void)
PtrToCreator GetCreator(const ComponentDescriptionType &name, IndexType i)
itk::SmartPointer< Self > Pointer
CreatorMapType::value_type CreatorMapEntryType
std::pair< PixelTypeDescriptionType, ImageDimensionType > ImageTypeDescriptionType
std::map< IndexMapKeyType, IndexMapValueType > IndexMapType
CreatorMapType & GetCreatorMap(void)
void operator=(const Self &)
int SetIndex(const PixelTypeDescriptionType &fixedPixelType, ImageDimensionType fixedDimension, const PixelTypeDescriptionType &movingPixelType, ImageDimensionType movingDimension, IndexType i)
IndexMapType::value_type IndexMapEntryType
The ComponentDatabase class is a class that stores the New() functions of all components.
IndexType GetIndex(const PixelTypeDescriptionType &fixedPixelType, ImageDimensionType fixedDimension, const PixelTypeDescriptionType &movingPixelType, ImageDimensionType movingDimension)
int SetCreator(const ComponentDescriptionType &name, IndexType i, PtrToCreator creator)
ObjectType::Pointer ObjectPointer
IndexMapType & GetIndexMap(void)
std::pair< ImageTypeDescriptionType, ImageTypeDescriptionType > IndexMapKeyType
std::pair< ComponentDescriptionType, IndexType > CreatorMapKeyType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo