#include <itkParameterFileParser.h>
Implements functionality to read a parameter file.
A parameter file is a text file that contains parameters and their values. Parameters should be specified obeying certain rules.
1) A single parameter should be on a single line
2) A parameter should be specified between brackets: (...)
3) Parameters are specified by a single name, followed by one or more values, all separated by spaces
4) Values that are strings should be quoted using "\n
5) Values that are numbers should be unquoted\n
For example: \n
(ParameterName1 "string1" "string2")\n
(ParameterName2 3 5.8)\n
(ParameterName3 "true" "false" "true")
The parameter file is read, and parameter name-value combinations are stored in an std::map< std::string, std::vector<std:string> >, where the string is the parameter name, and the vector of strings are the values. Exceptions are raised in case:
The resulting map can be accessed via:
parser->GetParameterMap();
Definition at line 78 of file itkParameterFileParser.h.
Public Types | |
using | ConstPointer = SmartPointer<const Self> |
using | ParameterMapType = std::map<std::string, ParameterValuesType> |
using | ParameterValuesType = std::vector<std::string> |
using | Pointer = SmartPointer<Self> |
using | Self = ParameterFileParser |
using | Superclass = Object |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual const char * | GetParameterFileName () const |
const ParameterMapType & | GetParameterMap () const |
ITK_DISALLOW_COPY_AND_MOVE (ParameterFileParser) | |
void | ReadParameterFile () |
std::string | ReturnParameterFileAsString () |
virtual void | SetParameterFileName (const char *_arg) |
Static Public Member Functions | |
static ParameterMapType | ConvertToParameterMap (const std::string &text) |
static Pointer | New () |
static ParameterMapType | ReadParameterMap (const std::string &fileName) |
Protected Member Functions | |
ParameterFileParser () | |
~ParameterFileParser () override | |
Private Attributes | |
std::string | m_ParameterFileName {} |
ParameterMapType | m_ParameterMap {} |
using itk::ParameterFileParser::ConstPointer = SmartPointer<const Self> |
Definition at line 87 of file itkParameterFileParser.h.
using itk::ParameterFileParser::ParameterMapType = std::map<std::string, ParameterValuesType> |
Definition at line 97 of file itkParameterFileParser.h.
using itk::ParameterFileParser::ParameterValuesType = std::vector<std::string> |
Typedefs.
Definition at line 96 of file itkParameterFileParser.h.
using itk::ParameterFileParser::Pointer = SmartPointer<Self> |
Definition at line 86 of file itkParameterFileParser.h.
Standard ITK typedefs.
Definition at line 84 of file itkParameterFileParser.h.
using itk::ParameterFileParser::Superclass = Object |
Definition at line 85 of file itkParameterFileParser.h.
|
protected |
|
overrideprotected |
|
static |
Converts the specified text string to the corresponding parameter map, assuming that the text is formatted according to the elastix parameter text file format.
|
virtual |
Run-time type information (and related methods).
|
virtual |
const ParameterMapType & itk::ParameterFileParser::GetParameterMap | ( | ) | const |
Return the parameter map.
itk::ParameterFileParser::ITK_DISALLOW_COPY_AND_MOVE | ( | ParameterFileParser | ) |
|
static |
Method for creation through the object factory.
void itk::ParameterFileParser::ReadParameterFile | ( | ) |
Read the parameters in the parameter map.
|
static |
Read the specified file into a parameter map and return the map.
std::string itk::ParameterFileParser::ReturnParameterFileAsString | ( | ) |
Read the parameter file and return the content as a string. Useful for printing the content.
|
virtual |
Set the name of the file containing the parameters.
|
private |
Member variables.
Definition at line 132 of file itkParameterFileParser.h.
|
private |
Definition at line 133 of file itkParameterFileParser.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |