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.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
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& ); // purposely not implemented
00145     void operator=( const Self& );  // purposely not implemented
00146 
00147   }; // end class ComponentDatabase
00148 
00149 
00150 } // end namespace elastix
00151 
00152 
00153 
00154 #endif // end #ifndef __elxComponentDatabase_h
00155 


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo