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
26
27namespace elastix
28{
29
30// TODO: Why does the compiler not see ELASTIXLIB_API declspec in elxMacro.h?
31// error: variable has incomplete type 'class ELASTIXLIB_API'
32// with class ELASTIXLIB_API ParameterObject : public itk::DataObject
33
34class ParameterObject : public itk::DataObject
35{
36public:
37
39 typedef itk::SmartPointer< Self > Pointer;
40 typedef itk::SmartPointer< const Self > ConstPointer;
41 itkNewMacro( Self );
42 itkTypeMacro( ParameterObject, itk::DataObject );
43
44 typedef std::string ParameterKeyType;
45 typedef std::string ParameterValueType;
46 typedef std::vector< ParameterValueType > ParameterValueVectorType;
47 typedef ParameterValueVectorType::iterator ParameterValueVectorIterator;
48 typedef std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType;
49 typedef ParameterMapType::iterator ParameterMapIterator;
50 typedef ParameterMapType::const_iterator ParameterMapConstIterator;
51 typedef std::vector< ParameterMapType > ParameterMapVectorType;
52 typedef std::string ParameterFileNameType;
53 typedef std::vector< ParameterFileNameType > ParameterFileNameVectorType;
54 typedef ParameterFileNameVectorType::iterator ParameterFileNameVectorIterator;
55 typedef ParameterFileNameVectorType::const_iterator ParameterFileNameVectorConstIterator;
58
59 /* Set/Get/Add parameter map or vector of parameter maps. */
60 // TODO: Use itkSetMacro for ParameterMapVectorType
61 void SetParameterMap( const ParameterMapType & parameterMap );
62 void SetParameterMap( const unsigned int& index, const ParameterMapType & parameterMap );
63 void SetParameterMap( const ParameterMapVectorType & parameterMap );
64 void AddParameterMap( const ParameterMapType & parameterMap );
65 const ParameterMapType& GetParameterMap( const unsigned int& index ) const;
66 itkGetConstReferenceMacro( ParameterMap, ParameterMapVectorType );
67 unsigned int GetNumberOfParameterMaps() const { return static_cast< unsigned int >(this->m_ParameterMap.size()); }
68
69 void SetParameter( const unsigned int& index, const ParameterKeyType& key, const ParameterValueType& value );
70 void SetParameter( const unsigned int& index, const ParameterKeyType& key, const ParameterValueVectorType& value );
71 void SetParameter( const ParameterKeyType& key, const ParameterValueType& value );
72 void SetParameter( const ParameterKeyType& key, const ParameterValueVectorType& value );
73 const ParameterValueVectorType& GetParameter( const unsigned int& index, const ParameterKeyType& key);
74 void RemoveParameter( const unsigned int& index, const ParameterKeyType& key );
76
77 /* Read/Write parameter file or multiple parameter files to/from disk. */
78 void ReadParameterFile( const ParameterFileNameType & parameterFileName );
79 void ReadParameterFile( const ParameterFileNameVectorType & parameterFileNameVector );
80 void AddParameterFile( const ParameterFileNameType & parameterFileName );
81 void WriteParameterFile( void );
82 void WriteParameterFile( const ParameterMapType & parameterMap, const ParameterFileNameType & parameterFileName );
83 void WriteParameterFile( const ParameterFileNameType & parameterFileName );
84 void WriteParameterFile( const ParameterFileNameVectorType & parameterFileNameVector );
85 void WriteParameterFile( const ParameterMapVectorType & parameterMapVector, const ParameterFileNameVectorType & parameterFileNameVector );
86
87 /* Get preconfigured parameter maps. */
88 static const ParameterMapType GetDefaultParameterMap( const std::string & transformName,
89 const unsigned int & numberOfResolutions = 4u,
90 const double & finalGridSpacingInPhysicalUnits = 10.0 );
91
92protected:
93
94 void PrintSelf( std::ostream & os, itk::Indent indent ) const override;
95
96private:
97
99
100};
101
102} // namespace elx
103
104#endif // elxParameterObject_h
unsigned int GetNumberOfParameterMaps() const
void RemoveParameter(const ParameterKeyType &key)
std::map< ParameterKeyType, ParameterValueVectorType > ParameterMapType
void ReadParameterFile(const ParameterFileNameVectorType &parameterFileNameVector)
void AddParameterFile(const ParameterFileNameType &parameterFileName)
void SetParameter(const unsigned int &index, const ParameterKeyType &key, const ParameterValueType &value)
ParameterFileNameVectorType::const_iterator ParameterFileNameVectorConstIterator
ParameterValueVectorType::iterator ParameterValueVectorIterator
ParameterMapType::iterator ParameterMapIterator
itk::SmartPointer< const Self > ConstPointer
void SetParameterMap(const ParameterMapVectorType &parameterMap)
std::vector< ParameterFileNameType > ParameterFileNameVectorType
void SetParameterMap(const unsigned int &index, const ParameterMapType &parameterMap)
void WriteParameterFile(const ParameterFileNameVectorType &parameterFileNameVector)
ParameterMapType::const_iterator ParameterMapConstIterator
void AddParameterMap(const ParameterMapType &parameterMap)
void WriteParameterFile(const ParameterFileNameType &parameterFileName)
ParameterMapVectorType m_ParameterMap
const ParameterMapType & GetParameterMap(const unsigned int &index) const
std::vector< ParameterValueType > ParameterValueVectorType
void SetParameter(const ParameterKeyType &key, const ParameterValueVectorType &value)
ParameterFileParserType::Pointer ParameterFileParserPointer
void RemoveParameter(const unsigned int &index, const ParameterKeyType &key)
void WriteParameterFile(const ParameterMapType &parameterMap, const ParameterFileNameType &parameterFileName)
void WriteParameterFile(const ParameterMapVectorType &parameterMapVector, const ParameterFileNameVectorType &parameterFileNameVector)
ParameterFileNameVectorType::iterator ParameterFileNameVectorIterator
static const ParameterMapType GetDefaultParameterMap(const std::string &transformName, const unsigned int &numberOfResolutions=4u, const double &finalGridSpacingInPhysicalUnits=10.0)
void SetParameterMap(const ParameterMapType &parameterMap)
itk::SmartPointer< Self > Pointer
void SetParameter(const unsigned int &index, const ParameterKeyType &key, const ParameterValueVectorType &value)
void ReadParameterFile(const ParameterFileNameType &parameterFileName)
const ParameterValueVectorType & GetParameter(const unsigned int &index, const ParameterKeyType &key)
itk::ParameterFileParser ParameterFileParserType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void SetParameter(const ParameterKeyType &key, const ParameterValueType &value)
std::vector< ParameterMapType > ParameterMapVectorType
Implements functionality to read a parameter file.


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo