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 Member Functions | Private Attributes
elastix::Configuration Class Reference

#include <elxConfiguration.h>

Detailed Description

A class that deals with user given parameters and command line arguments.

The Configuration class provides the functions ReadParameter() (to read parameters from the parameter file) and ReadCommandLineArgument(), and provides an easy way to get the current elastix level.

Parameters:
PrintErrorMessages: defines if warnings and errors should be printed to screen, e.g. when a parameter cannot be found and the default is used. example: (PrintErrorMessages "false")
Default: "true"

Definition at line 50 of file elxConfiguration.h.

+ Inheritance diagram for elastix::Configuration:

Public Types

typedef std::map< std::string, std::string > CommandLineArgumentMapType
 
typedef CommandLineArgumentMapType::value_type CommandLineEntryType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef ParameterFileParserType::Pointer ParameterFileParserPointer
 
typedef itk::ParameterFileParser ParameterFileParserType
 
typedef ParameterMapInterfaceType::Pointer ParameterMapInterfacePointer
 
typedef itk::ParameterMapInterface ParameterMapInterfaceType
 
typedef itk::SmartPointer< SelfPointer
 
typedef Configuration Self
 
typedef itk::Object Superclass1
 
typedef BaseComponent Superclass2
 

Public Member Functions

int BeforeAll (void) override
 
virtual int BeforeAllTransformix (void)
 
std::vcl_size_t CountNumberOfParameterEntries (const std::string &parameterName) const
 
virtual const char * GetClassName () const
 
std::string GetCommandLineArgument (const std::string &key) const
 
virtual unsigned int GetElastixLevel () const
 
virtual const char * GetParameterFileName () const
 
virtual bool GetPrintErrorMessages (void)
 
virtual unsigned int GetTotalNumberOfElastixLevels () const
 
virtual int Initialize (const CommandLineArgumentMapType &_arg)
 
virtual int Initialize (const CommandLineArgumentMapType &_arg, const ParameterFileParserType::ParameterMapType &inputMap)
 
virtual bool IsInitialized (void) const
 
template<class T >
bool ReadParameter (std::vector< T > &parameterValues, const std::string &parameterName, const unsigned int entry_nr_start, const unsigned int entry_nr_end, const bool printThisErrorMessage) const
 
template<class T >
bool ReadParameter (T &parameterValue, const std::string &parameterName, const std::string &prefix, const unsigned int entry_nr, const int default_entry_nr) const
 
template<class T >
bool ReadParameter (T &parameterValue, const std::string &parameterName, const std::string &prefix, const unsigned int entry_nr, const int default_entry_nr, const bool printThisErrorMessage) const
 
template<class T >
bool ReadParameter (T &parameterValue, const std::string &parameterName, const unsigned int entry_nr)
 
template<class T >
bool ReadParameter (T &parameterValue, const std::string &parameterName, const unsigned int entry_nr, const bool printThisErrorMessage)
 
void SetCommandLineArgument (const std::string &key, const std::string &value)
 
virtual void SetElastixLevel (unsigned int _arg)
 
virtual void SetParameterFileName (const char *_arg)
 
virtual void SetTotalNumberOfElastixLevels (unsigned int _arg)
 
- Public Member Functions inherited from elastix::BaseComponent
virtual void AfterEachIteration (void)
 
virtual void AfterEachIterationBase (void)
 
virtual void AfterEachResolution (void)
 
virtual void AfterEachResolutionBase (void)
 
virtual void AfterRegistration (void)
 
virtual void AfterRegistrationBase (void)
 
virtual int BeforeAll (void)
 
virtual int BeforeAllBase (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeEachResolutionBase (void)
 
virtual void BeforeRegistration (void)
 
virtual void BeforeRegistrationBase (void)
 
virtual const char * elxGetClassName (void) const
 
const char * GetComponentLabel (void) const
 
 ITK_DISALLOW_COPY_AND_ASSIGN (BaseComponent)
 
 itkTypeMacroNoParent (BaseComponent)
 
void SetComponentLabel (const char *label, unsigned int idx)
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from elastix::BaseComponent
static std::string ConvertSecondsToDHMS (const double totalSeconds, const unsigned int precision)
 
static void InitializeElastixExecutable ()
 
static bool IsElastixLibrary ()
 

Protected Member Functions

 Configuration ()
 
virtual void PrintParameterFile (void) const
 
 ~Configuration () override
 
- Protected Member Functions inherited from elastix::BaseComponent
 BaseComponent ()=default
 
virtual ~BaseComponent ()=default
 

Private Member Functions

 Configuration (const Self &)
 
void operator= (const Self &)
 

Private Attributes

CommandLineArgumentMapType m_CommandLineArgumentMap
 
unsigned int m_ElastixLevel
 
bool m_IsInitialized
 
std::string m_ParameterFileName
 
ParameterFileParserPointer m_ParameterFileParser
 
ParameterMapInterfacePointer m_ParameterMapInterface
 
unsigned int m_TotalNumberOfElastixLevels
 

Member Typedef Documentation

◆ CommandLineArgumentMapType

typedef std::map< std::string, std::string > elastix::Configuration::CommandLineArgumentMapType

Typedefs for the command line arguments.

Definition at line 68 of file elxConfiguration.h.

◆ CommandLineEntryType

typedef CommandLineArgumentMapType::value_type elastix::Configuration::CommandLineEntryType

Definition at line 69 of file elxConfiguration.h.

◆ ConstPointer

typedef itk::SmartPointer< const Self > elastix::Configuration::ConstPointer

Definition at line 59 of file elxConfiguration.h.

◆ ParameterFileParserPointer

Definition at line 73 of file elxConfiguration.h.

◆ ParameterFileParserType

Typedefs for the parameter file.

Definition at line 72 of file elxConfiguration.h.

◆ ParameterMapInterfacePointer

Definition at line 75 of file elxConfiguration.h.

◆ ParameterMapInterfaceType

Definition at line 74 of file elxConfiguration.h.

◆ Pointer

typedef itk::SmartPointer< Self > elastix::Configuration::Pointer

Definition at line 58 of file elxConfiguration.h.

◆ Self

Standard itk.

Definition at line 55 of file elxConfiguration.h.

◆ Superclass1

Definition at line 56 of file elxConfiguration.h.

◆ Superclass2

Definition at line 57 of file elxConfiguration.h.

Constructor & Destructor Documentation

◆ Configuration() [1/2]

elastix::Configuration::Configuration ( )
protected

◆ ~Configuration()

elastix::Configuration::~Configuration ( )
inlineoverrideprotected

Definition at line 242 of file elxConfiguration.h.

◆ Configuration() [2/2]

elastix::Configuration::Configuration ( const Self )
private

Member Function Documentation

◆ BeforeAll()

int elastix::Configuration::BeforeAll ( void  )
overridevirtual

Set/Get whether warnings are allowed to be printed, when reading a parameter. * itkSetMacro( Silent, bool ); itkGetConstMacro( Silent, bool ); Methods that is called at the very beginning of elastixTemplate::Run.

  • Prints the parameter file

Reimplemented from elastix::BaseComponent.

◆ BeforeAllTransformix()

virtual int elastix::Configuration::BeforeAllTransformix ( void  )
virtual

Methods that is called at the very beginning of elastixTemplate::ApplyTransform.

  • Prints the parameter file

◆ CountNumberOfParameterEntries()

std::vcl_size_t elastix::Configuration::CountNumberOfParameterEntries ( const std::string &  parameterName) const
inline

Interface to the ParameterMapInterface. Count the number of parameters.

Definition at line 136 of file elxConfiguration.h.

◆ GetClassName()

virtual const char * elastix::Configuration::GetClassName ( ) const
virtual

Standard part of all itk objects.

◆ GetCommandLineArgument()

std::string elastix::Configuration::GetCommandLineArgument ( const std::string &  key) const

Get and Set CommandLine arguments into the argument map.

◆ GetElastixLevel()

virtual unsigned int elastix::Configuration::GetElastixLevel ( ) const
virtual

◆ GetParameterFileName()

virtual const char * elastix::Configuration::GetParameterFileName ( ) const
virtual

Get/Set the name of the parameterFileName.

◆ GetPrintErrorMessages()

virtual bool elastix::Configuration::GetPrintErrorMessages ( void  )
inlinevirtual

Definition at line 112 of file elxConfiguration.h.

◆ GetTotalNumberOfElastixLevels()

virtual unsigned int elastix::Configuration::GetTotalNumberOfElastixLevels ( ) const
virtual

◆ Initialize() [1/2]

virtual int elastix::Configuration::Initialize ( const CommandLineArgumentMapType _arg)
virtual

Pass the command line arguments as a map. One of the command line arguments should be either: -p <parameter_file> or -tp <transform_parameter_file>. The specified (transform) parameter file is read by the itk::ParameterFileParser and passed to the itk::ParameterMapInterface.

◆ Initialize() [2/2]

virtual int elastix::Configuration::Initialize ( const CommandLineArgumentMapType _arg,
const ParameterFileParserType::ParameterMapType inputMap 
)
virtual

◆ IsInitialized()

virtual bool elastix::Configuration::IsInitialized ( void  ) const
virtual

True, if Initialize was successfully called.

◆ New()

static Pointer elastix::Configuration::New ( )
static

Method for creation through the object factory.

◆ operator=()

void elastix::Configuration::operator= ( const Self )
private

◆ PrintParameterFile()

virtual void elastix::Configuration::PrintParameterFile ( void  ) const
protectedvirtual

Print the parameter file to the log file. Called by BeforeAll(). This function is not really generic. It's just added because it needs to be called by both BeforeAll and BeforeAllTransformix.

◆ ReadParameter() [1/5]

template<class T >
bool elastix::Configuration::ReadParameter ( std::vector< T > &  parameterValues,
const std::string &  parameterName,
const unsigned int  entry_nr_start,
const unsigned int  entry_nr_end,
const bool  printThisErrorMessage 
) const
inline

Read a range of parameters from the parameter file.

Definition at line 220 of file elxConfiguration.h.

◆ ReadParameter() [2/5]

template<class T >
bool elastix::Configuration::ReadParameter ( T &  parameterValue,
const std::string &  parameterName,
const std::string &  prefix,
const unsigned int  entry_nr,
const int  default_entry_nr 
) const
inline

Read a parameter from the parameter file.

Definition at line 201 of file elxConfiguration.h.

◆ ReadParameter() [3/5]

template<class T >
bool elastix::Configuration::ReadParameter ( T &  parameterValue,
const std::string &  parameterName,
const std::string &  prefix,
const unsigned int  entry_nr,
const int  default_entry_nr,
const bool  printThisErrorMessage 
) const
inline

Read a parameter from the parameter file.

Definition at line 181 of file elxConfiguration.h.

◆ ReadParameter() [4/5]

template<class T >
bool elastix::Configuration::ReadParameter ( T &  parameterValue,
const std::string &  parameterName,
const unsigned int  entry_nr 
)
inline

Read a parameter from the parameter file.

Definition at line 164 of file elxConfiguration.h.

◆ ReadParameter() [5/5]

template<class T >
bool elastix::Configuration::ReadParameter ( T &  parameterValue,
const std::string &  parameterName,
const unsigned int  entry_nr,
const bool  printThisErrorMessage 
)
inline

Read a parameter from the parameter file.

Definition at line 146 of file elxConfiguration.h.

◆ SetCommandLineArgument()

void elastix::Configuration::SetCommandLineArgument ( const std::string &  key,
const std::string &  value 
)

◆ SetElastixLevel()

virtual void elastix::Configuration::SetElastixLevel ( unsigned int  _arg)
virtual

Other elastix related information. Get and Set the elastix level.

◆ SetParameterFileName()

virtual void elastix::Configuration::SetParameterFileName ( const char *  _arg)
virtual

◆ SetTotalNumberOfElastixLevels()

virtual void elastix::Configuration::SetTotalNumberOfElastixLevels ( unsigned int  _arg)
virtual

Get and Set the total number of elastix levels.

Field Documentation

◆ m_CommandLineArgumentMap

CommandLineArgumentMapType elastix::Configuration::m_CommandLineArgumentMap
private

Definition at line 255 of file elxConfiguration.h.

◆ m_ElastixLevel

unsigned int elastix::Configuration::m_ElastixLevel
private

Definition at line 261 of file elxConfiguration.h.

◆ m_IsInitialized

bool elastix::Configuration::m_IsInitialized
private

Definition at line 260 of file elxConfiguration.h.

◆ m_ParameterFileName

std::string elastix::Configuration::m_ParameterFileName
private

Definition at line 256 of file elxConfiguration.h.

◆ m_ParameterFileParser

ParameterFileParserPointer elastix::Configuration::m_ParameterFileParser
private

Definition at line 257 of file elxConfiguration.h.

◆ m_ParameterMapInterface

ParameterMapInterfacePointer elastix::Configuration::m_ParameterMapInterface
private

Definition at line 258 of file elxConfiguration.h.

◆ m_TotalNumberOfElastixLevels

unsigned int elastix::Configuration::m_TotalNumberOfElastixLevels
private

Definition at line 262 of file elxConfiguration.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo