go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxParameterObject.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#ifndef elxParameterObject_h
19#define elxParameterObject_h
20
21#include "itkObjectFactory.h"
22#include "itkDataObject.h"
23#include "elxMacro.h"
24
25namespace elastix
26{
27
28// TODO: Why does the compiler not see ELASTIXLIB_API declspec in elxMacro.h?
29// error: variable has incomplete type 'class ELASTIXLIB_API'
30// with class ELASTIXLIB_API ParameterObject : public itk::DataObject
31
32class ParameterObject : public itk::DataObject
33{
34public:
36 using Pointer = itk::SmartPointer<Self>;
37 using ConstPointer = itk::SmartPointer<const Self>;
38 itkNewMacro(Self);
39 itkTypeMacro(ParameterObject, itk::DataObject);
40
41 using ParameterKeyType = std::string;
42 using ParameterValueType = std::string;
43 using ParameterValueVectorType = std::vector<ParameterValueType>;
44 using ParameterValueVectorIterator = ParameterValueVectorType::iterator;
45 using ParameterMapType = std::map<ParameterKeyType, ParameterValueVectorType>;
46 using ParameterMapIterator = ParameterMapType::iterator;
47 using ParameterMapConstIterator = ParameterMapType::const_iterator;
48 using ParameterMapVectorType = std::vector<ParameterMapType>;
49 using ParameterFileNameType = std::string;
50 using ParameterFileNameVectorType = std::vector<ParameterFileNameType>;
51 using ParameterFileNameVectorIterator = ParameterFileNameVectorType::iterator;
52 using ParameterFileNameVectorConstIterator = ParameterFileNameVectorType::const_iterator;
53
54 /* Set/Get/Add parameter map or vector of parameter maps. */
55 // TODO: Use itkSetMacro for ParameterMapVectorType
56 void
57 SetParameterMap(const ParameterMapType & parameterMap);
58 void
59 SetParameterMap(const unsigned int index, const ParameterMapType & parameterMap);
60 void
62 void
63 AddParameterMap(const ParameterMapType & parameterMap);
64 const ParameterMapType &
65 GetParameterMap(const unsigned int index) const;
66
69 {
70 return m_ParameterMaps;
71 }
72
73 unsigned int
75 {
76 return static_cast<unsigned int>(m_ParameterMaps.size());
77 }
78
79 void
80 SetParameter(const unsigned int index, const ParameterKeyType & key, const ParameterValueType & value);
81 void
82 SetParameter(const unsigned int index, const ParameterKeyType & key, const ParameterValueVectorType & value);
83 void
85 void
88 GetParameter(const unsigned int index, const ParameterKeyType & key);
89 void
90 RemoveParameter(const unsigned int index, const ParameterKeyType & key);
91 void
93
94 /* Read/Write parameter file or multiple parameter files to/from disk. */
95 void
96 ReadParameterFile(const ParameterFileNameType & parameterFileName);
97 void
98 ReadParameterFile(const ParameterFileNameVectorType & parameterFileNameVector);
99 void
100 AddParameterFile(const ParameterFileNameType & parameterFileName);
101 void
103 static void
104 WriteParameterFile(const ParameterMapType & parameterMap, const ParameterFileNameType & parameterFileName);
105 void
106 WriteParameterFile(const ParameterFileNameType & parameterFileName) const;
107 void
108 WriteParameterFile(const ParameterFileNameVectorType & parameterFileNameVector) const;
109 static void
110 WriteParameterFile(const ParameterMapVectorType & parameterMapVector,
111 const ParameterFileNameVectorType & parameterFileNameVector);
112
113 /* Get preconfigured parameter maps. */
114 static const ParameterMapType
115 GetDefaultParameterMap(const std::string & transformName,
116 const unsigned int numberOfResolutions = 4u,
117 const double finalGridSpacingInPhysicalUnits = 10.0);
118
119protected:
120 void
121 PrintSelf(std::ostream & os, itk::Indent indent) const override;
122
123private:
125};
126
127} // namespace elastix
128
129#endif // elxParameterObject_h
unsigned int GetNumberOfParameterMaps() const
void RemoveParameter(const ParameterKeyType &key)
ParameterFileNameVectorType::const_iterator ParameterFileNameVectorConstIterator
void WriteParameterFile() const
void ReadParameterFile(const ParameterFileNameVectorType &parameterFileNameVector)
ParameterMapVectorType m_ParameterMaps
itk::SmartPointer< Self > Pointer
static void WriteParameterFile(const ParameterMapVectorType &parameterMapVector, const ParameterFileNameVectorType &parameterFileNameVector)
void AddParameterFile(const ParameterFileNameType &parameterFileName)
std::vector< ParameterFileNameType > ParameterFileNameVectorType
const ParameterMapType & GetParameterMap(const unsigned int index) const
void SetParameterMap(const unsigned int index, const ParameterMapType &parameterMap)
static const ParameterMapType GetDefaultParameterMap(const std::string &transformName, const unsigned int numberOfResolutions=4u, const double finalGridSpacingInPhysicalUnits=10.0)
ParameterFileNameVectorType::iterator ParameterFileNameVectorIterator
void RemoveParameter(const unsigned int index, const ParameterKeyType &key)
void AddParameterMap(const ParameterMapType &parameterMap)
static void WriteParameterFile(const ParameterMapType &parameterMap, const ParameterFileNameType &parameterFileName)
const ParameterMapVectorType & GetParameterMap() const
void SetParameterMap(const ParameterMapVectorType &parameterMaps)
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
const ParameterValueVectorType & GetParameter(const unsigned int index, const ParameterKeyType &key)
itk::SmartPointer< const Self > ConstPointer
void SetParameter(const ParameterKeyType &key, const ParameterValueVectorType &value)
void WriteParameterFile(const ParameterFileNameVectorType &parameterFileNameVector) const
ParameterValueVectorType::iterator ParameterValueVectorIterator
std::vector< ParameterValueType > ParameterValueVectorType
void SetParameterMap(const ParameterMapType &parameterMap)
std::vector< ParameterMapType > ParameterMapVectorType
void ReadParameterFile(const ParameterFileNameType &parameterFileName)
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void SetParameter(const unsigned int index, const ParameterKeyType &key, const ParameterValueVectorType &value)
void SetParameter(const ParameterKeyType &key, const ParameterValueType &value)
ParameterMapType::iterator ParameterMapIterator
void SetParameter(const unsigned int index, const ParameterKeyType &key, const ParameterValueType &value)
void WriteParameterFile(const ParameterFileNameType &parameterFileName) const
ParameterMapType::const_iterator ParameterMapConstIterator


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo