#include <elxConfiguration.h>
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.
(PrintErrorMessages "false")
Definition at line 50 of file elxConfiguration.h.
Public Types | |
using | CommandLineArgumentMapType = std::map<std::string, std::string> |
using | CommandLineEntryType = CommandLineArgumentMapType::value_type |
using | ConstPointer = itk::SmartPointer<const Self> |
using | Pointer = itk::SmartPointer<Self> |
using | Self = Configuration |
using | Superclass1 = itk::Object |
using | Superclass2 = BaseComponent |
Public Member Functions | |
int | BeforeAll () override |
int | BeforeAllTransformix () |
std::vcl_size_t | CountNumberOfParameterEntries (const std::string ¶meterName) const |
virtual const char * | GetClassName () const |
std::string | GetCommandLineArgument (const std::string &key) const |
virtual unsigned int | GetElastixLevel () const |
virtual const char * | GetParameterFileName () const |
bool | GetPrintErrorMessages () const |
virtual unsigned int | GetTotalNumberOfElastixLevels () const |
std::vector< std::string > | GetValuesOfParameter (const std::string ¶meterName) const |
bool | HasParameter (const std::string ¶meterName) const |
int | Initialize (const CommandLineArgumentMapType &_arg) |
int | Initialize (const CommandLineArgumentMapType &_arg, const itk::ParameterFileParser::ParameterMapType &inputMap) |
bool | IsInitialized () const |
ITK_DISALLOW_COPY_AND_MOVE (Configuration) | |
template<class T > | |
bool | ReadParameter (std::vector< T > ¶meterValues, const std::string ¶meterName, const unsigned int entry_nr_start, const unsigned int entry_nr_end, const bool produceWarningMessage) const |
template<class T > | |
bool | ReadParameter (T ¶meterValue, const std::string ¶meterName, const std::string &prefix, const unsigned int entry_nr, const int default_entry_nr) const |
template<class T > | |
bool | ReadParameter (T ¶meterValue, const std::string ¶meterName, const std::string &prefix, const unsigned int entry_nr, const int default_entry_nr, const bool produceWarningMessage) const |
template<class T > | |
bool | ReadParameter (T ¶meterValue, const std::string ¶meterName, const unsigned int entry_nr) const |
template<class T > | |
bool | ReadParameter (T ¶meterValue, const std::string ¶meterName, const unsigned int entry_nr, const bool produceWarningMessage) const |
std::string | RetrieveParameterStringValue (const std::string &defaultParameterValue, const std::string ¶meterName, const unsigned int entry_nr, const bool produceWarningMessage) const |
template<typename T > | |
T | RetrieveParameterValue (const T &defaultParameterValue, const std::string ¶meterName, const unsigned int entry_nr, const bool produceWarningMessage) const |
template<typename T > | |
std::unique_ptr< std::vector< T > > | RetrieveValuesOfParameter (const std::string ¶meterName) 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 () |
virtual void | AfterEachIterationBase () |
virtual void | AfterEachResolution () |
virtual void | AfterEachResolutionBase () |
virtual void | AfterRegistration () |
virtual void | AfterRegistrationBase () |
virtual int | BeforeAllBase () |
virtual void | BeforeEachResolution () |
virtual void | BeforeEachResolutionBase () |
virtual void | BeforeRegistration () |
virtual void | BeforeRegistrationBase () |
virtual const char * | elxGetClassName () const |
const char * | GetComponentLabel () const |
ITK_DISALLOW_COPY_AND_MOVE (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 | |
template<typename TBaseComponent > | |
static auto | AsITKBaseType (TBaseComponent *const baseComponent) -> decltype(baseComponent->GetAsITKBaseType()) |
static void | InitializeElastixExecutable () |
static bool | IsElastixLibrary () |
Protected Member Functions | |
Configuration () | |
void | PrintParameterFile () const |
~Configuration () override=default | |
Protected Member Functions inherited from elastix::BaseComponent | |
BaseComponent ()=default | |
virtual | ~BaseComponent ()=default |
Private Attributes | |
CommandLineArgumentMapType | m_CommandLineArgumentMap {} |
unsigned int | m_ElastixLevel { 0 } |
bool | m_IsInitialized { false } |
std::string | m_ParameterFileName {} |
const itk::ParameterFileParser::Pointer | m_ParameterFileParser { itk::ParameterFileParser::New() } |
const itk::ParameterMapInterface::Pointer | m_ParameterMapInterface { itk::ParameterMapInterface::New() } |
unsigned int | m_TotalNumberOfElastixLevels { 1 } |
using elastix::Configuration::CommandLineArgumentMapType = std::map<std::string, std::string> |
Typedefs for the command line arguments.
Definition at line 71 of file elxConfiguration.h.
using elastix::Configuration::CommandLineEntryType = CommandLineArgumentMapType::value_type |
Definition at line 72 of file elxConfiguration.h.
using elastix::Configuration::ConstPointer = itk::SmartPointer<const Self> |
Definition at line 62 of file elxConfiguration.h.
using elastix::Configuration::Pointer = itk::SmartPointer<Self> |
Definition at line 61 of file elxConfiguration.h.
Standard itk.
Definition at line 58 of file elxConfiguration.h.
using elastix::Configuration::Superclass1 = itk::Object |
Definition at line 59 of file elxConfiguration.h.
Definition at line 60 of file elxConfiguration.h.
|
protected |
|
overrideprotecteddefault |
|
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.
Reimplemented from elastix::BaseComponent.
int elastix::Configuration::BeforeAllTransformix | ( | ) |
Methods that is called at the very beginning of elastixTemplate::ApplyTransform.
|
inline |
Interface to the ParameterMapInterface. Count the number of parameters.
Definition at line 141 of file elxConfiguration.h.
|
virtual |
Standard part of all itk objects.
std::string elastix::Configuration::GetCommandLineArgument | ( | const std::string & | key | ) | const |
Get and Set CommandLine arguments into the argument map.
|
virtual |
|
virtual |
Get/Set the name of the parameterFileName.
|
inline |
Definition at line 114 of file elxConfiguration.h.
|
virtual |
|
inline |
Returns the values of the specified parameter (from the parameter file).
Definition at line 236 of file elxConfiguration.h.
|
inline |
Tells whether its parameter map has the parameter with the given name.
Definition at line 228 of file elxConfiguration.h.
int elastix::Configuration::Initialize | ( | const CommandLineArgumentMapType & | _arg | ) |
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.
int elastix::Configuration::Initialize | ( | const CommandLineArgumentMapType & | _arg, |
const itk::ParameterFileParser::ParameterMapType & | inputMap ) |
bool elastix::Configuration::IsInitialized | ( | ) | const |
True, if Initialize was successfully called.
elastix::Configuration::ITK_DISALLOW_COPY_AND_MOVE | ( | Configuration | ) |
|
static |
Method for creation through the object factory.
|
protected |
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.
|
inline |
Read a range of parameters from the parameter file.
Definition at line 284 of file elxConfiguration.h.
|
inline |
Read a parameter from the parameter file.
Definition at line 208 of file elxConfiguration.h.
|
inline |
Read a parameter from the parameter file.
Definition at line 186 of file elxConfiguration.h.
|
inline |
Read a parameter from the parameter file.
Definition at line 170 of file elxConfiguration.h.
|
inline |
Read a parameter from the parameter file.
Definition at line 150 of file elxConfiguration.h.
|
inline |
Retrieves the string value of the specified parameter (from the parameter file). Returns the specified default parameter value if the parameter cannot be found.
Definition at line 272 of file elxConfiguration.h.
|
inline |
Retrieves the value of the specified parameter (from the parameter file). Returns the specified default parameter value if the parameter cannot be found.
Definition at line 258 of file elxConfiguration.h.
|
inline |
Retrieves the values of the specified parameter (from the parameter file). Returns null when the parameter map does not contain the specified parameter. Throws an exception when it fails to convert each of the parameter values to the specified type T
.
Definition at line 249 of file elxConfiguration.h.
void elastix::Configuration::SetCommandLineArgument | ( | const std::string & | key, |
const std::string & | value ) |
|
virtual |
Other elastix related information. Get and Set the elastix level.
|
virtual |
|
virtual |
Get and Set the total number of elastix levels.
|
private |
Definition at line 314 of file elxConfiguration.h.
|
private |
Definition at line 320 of file elxConfiguration.h.
|
private |
Definition at line 319 of file elxConfiguration.h.
|
private |
Definition at line 315 of file elxConfiguration.h.
|
private |
Definition at line 316 of file elxConfiguration.h.
|
private |
Definition at line 317 of file elxConfiguration.h.
|
private |
Definition at line 321 of file elxConfiguration.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |