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:
Inheritance graph
[legend]

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

virtual int BeforeAll (void)
 
virtual int BeforeAllTransformix (void)
 
std::vcl_size_t CountNumberOfParameterEntries (const std::string &parameterName) const
 
virtual const char * GetClassName () const
 
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, ParameterFileParserType::ParameterMapType &inputMap)
 
virtual bool IsInitialized (void) const
 
template<class T >
bool ReadParameter (T &parameterValue, const std::string &parameterName, const unsigned int entry_nr, const bool printThisErrorMessage)
 
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 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 std::string &prefix, const unsigned int entry_nr, const int default_entry_nr) 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
 
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 BeforeAllBase (void)
 
virtual void BeforeEachResolution (void)
 
virtual void BeforeEachResolutionBase (void)
 
virtual void BeforeRegistration (void)
 
virtual void BeforeRegistrationBase (void)
 
std::string ConvertSecondsToDHMS (const double totalSeconds, const unsigned int precision) const
 
virtual const char * elxGetClassName (void) const
 
virtual const char * GetComponentLabel (void) const
 
virtual void SetComponentLabel (const char *label, unsigned int idx)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

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

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

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

Typedefs for the command line arguments.

Definition at line 65 of file elxConfiguration.h.

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

Definition at line 69 of file elxConfiguration.h.

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

Definition at line 59 of file elxConfiguration.h.

Definition at line 73 of file elxConfiguration.h.

Typedefs for the parameter file.

Definition at line 72 of file elxConfiguration.h.

Definition at line 75 of file elxConfiguration.h.

Definition at line 74 of file elxConfiguration.h.

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

Definition at line 58 of file elxConfiguration.h.

Standard itk.

Definition at line 55 of file elxConfiguration.h.

Definition at line 56 of file elxConfiguration.h.

Definition at line 57 of file elxConfiguration.h.

Constructor & Destructor Documentation

elastix::Configuration::Configuration ( )
protected
virtual elastix::Configuration::~Configuration ( )
inlineprotectedvirtual

Definition at line 242 of file elxConfiguration.h.

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

Member Function Documentation

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

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.

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

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

  • Prints the parameter file
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.

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

Standard part of all itk objects.

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

Get and Set CommandLine arguments into the argument map.

virtual unsigned int elastix::Configuration::GetElastixLevel ( ) const
virtual
virtual const char* elastix::Configuration::GetParameterFileName ( ) const
virtual

Get/Set the name of the parameterFileName.

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

Definition at line 112 of file elxConfiguration.h.

virtual unsigned int elastix::Configuration::GetTotalNumberOfElastixLevels ( ) const
virtual
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.

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

True, if Initialize was successfully called.

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

Method for creation through the object factory.

void elastix::Configuration::operator= ( const Self )
private
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.

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.

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.

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.

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.

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.

void elastix::Configuration::SetCommandLineArgument ( const std::string &  key,
const std::string &  value 
)
virtual void elastix::Configuration::SetElastixLevel ( unsigned int  _arg)
virtual

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

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

Get and Set the total number of elastix levels.

Field Documentation

CommandLineArgumentMapType elastix::Configuration::m_CommandLineArgumentMap
private

Definition at line 255 of file elxConfiguration.h.

unsigned int elastix::Configuration::m_ElastixLevel
private

Definition at line 261 of file elxConfiguration.h.

bool elastix::Configuration::m_IsInitialized
private

Definition at line 260 of file elxConfiguration.h.

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

Definition at line 256 of file elxConfiguration.h.

ParameterFileParserPointer elastix::Configuration::m_ParameterFileParser
private

Definition at line 257 of file elxConfiguration.h.

ParameterMapInterfacePointer elastix::Configuration::m_ParameterMapInterface
private

Definition at line 258 of file elxConfiguration.h.

unsigned int elastix::Configuration::m_TotalNumberOfElastixLevels
private

Definition at line 262 of file elxConfiguration.h.



Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo