go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
itk::ParameterFileParser Class Reference

#include <itkParameterFileParser.h>

Detailed Description

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:

See also

Definition at line 78 of file itkParameterFileParser.h.

Inheritance diagram for itk::ParameterFileParser:
Inheritance graph

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 ParameterMapTypeGetParameterMap () const
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

Member Typedef Documentation

◆ ConstPointer

using itk::ParameterFileParser::ConstPointer = SmartPointer<const Self>

Definition at line 87 of file itkParameterFileParser.h.

◆ ParameterMapType

Definition at line 97 of file itkParameterFileParser.h.

◆ ParameterValuesType

using itk::ParameterFileParser::ParameterValuesType = std::vector<std::string>


Definition at line 96 of file itkParameterFileParser.h.

◆ Pointer

using itk::ParameterFileParser::Pointer = SmartPointer<Self>

Definition at line 86 of file itkParameterFileParser.h.

◆ Self

Standard ITK typedefs.

Definition at line 84 of file itkParameterFileParser.h.

◆ Superclass

Definition at line 85 of file itkParameterFileParser.h.

Constructor & Destructor Documentation

◆ ParameterFileParser()

itk::ParameterFileParser::ParameterFileParser ( )

◆ ~ParameterFileParser()

itk::ParameterFileParser::~ParameterFileParser ( )

Member Function Documentation

◆ ConvertToParameterMap()

static ParameterMapType itk::ParameterFileParser::ConvertToParameterMap ( const std::string &  text)

Converts the specified text string to the corresponding parameter map, assuming that the text is formatted according to the elastix parameter text file format.

◆ GetClassName()

virtual const char * itk::ParameterFileParser::GetClassName ( ) const

Run-time type information (and related methods).

◆ GetParameterFileName()

virtual const char * itk::ParameterFileParser::GetParameterFileName ( ) const

◆ GetParameterMap()

const ParameterMapType & itk::ParameterFileParser::GetParameterMap ( ) const

Return the parameter map.


itk::ParameterFileParser::ITK_DISALLOW_COPY_AND_MOVE ( ParameterFileParser  )

◆ New()

static Pointer itk::ParameterFileParser::New ( )

Method for creation through the object factory.

◆ ReadParameterFile()

void itk::ParameterFileParser::ReadParameterFile ( )

Read the parameters in the parameter map.

◆ ReadParameterMap()

static ParameterMapType itk::ParameterFileParser::ReadParameterMap ( const std::string &  fileName)

Read the specified file into a parameter map and return the map.

◆ ReturnParameterFileAsString()

std::string itk::ParameterFileParser::ReturnParameterFileAsString ( )

Read the parameter file and return the content as a string. Useful for printing the content.

◆ SetParameterFileName()

virtual void itk::ParameterFileParser::SetParameterFileName ( const char *  _arg)

Set the name of the file containing the parameters.

Field Documentation

◆ m_ParameterFileName

std::string itk::ParameterFileParser::m_ParameterFileName

Member variables.

Definition at line 132 of file itkParameterFileParser.h.

◆ m_ParameterMap

ParameterMapType itk::ParameterFileParser::m_ParameterMap

Definition at line 133 of file itkParameterFileParser.h.

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