Loading...
Searching...
No Matches
elastix::Conversion Class Reference

`#include <elxConversion.h>`

## Detailed Description

A class that contains utility functions for the conversion of number of seconds and parameter values to text.

Definition at line 44 of file elxConversion.h.

## Public Types

using | ParameterMapType = std::map<std::string, ParameterValuesType>
using | ParameterValuesType = std::vector<std::string>
using | Self = Conversion

## Static Public Member Functions

static constexpr const char * | BoolToString (const bool arg)
template<typename TValue>
static std::vector< TValue > | ConcatenateVectors (std::vector< TValue > vector1, std::vector< TValue > vector2)
static bool | IsNumber (const std::string &)
static std::string | ObjectPtrToString (itk::Object *)
static std::string | ParameterMapToString (const ParameterMapType &)
static std::string | SecondsToDHMS (const double totalSeconds, const unsigned int precision)
static bool | StringToValue (const std::string &str, bool &value)
static bool | StringToValue (const std::string &str, itk::Object *&value)
static bool | StringToValue (const std::string &str, std::string &value)
template<class T>
static bool | StringToValue (const std::string &str, T &value)
static std::string | ToNativePathNameSeparators (const std::string &)
static itk::OptimizerParameters< double > | ToOptimizerParameters (const std::vector< double > &)
static std::string | ToString (const bool arg)
template<typename TInteger>
static std::string | ToString (const TInteger integerValue)
static std::string | ToString (double)
static std::string | ToString (float)
template<typename T, unsigned int NRows, unsigned int NColumns>
static std::vector< std::string > | ToVectorOfStrings (const itk::Matrix< T, NRows, NColumns > &matrix)
template<typename TContainer, typename SFINAE = typename TContainer::iterator>
static std::vector< std::string > | ToVectorOfStrings (const TContainer &container)
static bool | StringToValue (const std::string &str, double &value)
static bool | StringToValue (const std::string &str, float &value)
static bool | StringToValue (const std::string &str, char &value)
static bool | StringToValue (const std::string &str, signed char &value)
static bool | StringToValue (const std::string &str, unsigned char &value)

## Member Typedef Documentation

## ParameterMapType

using elastix::Conversion::ParameterMapType = std::map<std::string, ParameterValuesType>

Definition at line 49 of file elxConversion.h.

## ParameterValuesType

using elastix::Conversion::ParameterValuesType = std::vector<std::string>

Corresponds with typedefs from the elastix class itk::ParameterFileParser.

Definition at line 48 of file elxConversion.h.

## Self

using elastix::Conversion::Self = Conversion

Definition at line 50 of file elxConversion.h.

## Member Function Documentation

## BoolToString()

constexpr const char * elastix::Conversion::BoolToString | ( | const bool | arg | ) |

inline static constexpr

Convenience function to convert a boolean to a text string.

Definition at line 58 of file elxConversion.h.

## ConcatenateVectors()

template<typename TValue>

std::vector< TValue > elastix::Conversion::ConcatenateVectors | ( | std::vector< TValue > | vector1,
|  | std::vector< TValue > | vector2 )

inline static

Convenience function to concatenate two vectors.

Definition at line 148 of file elxConversion.h.

## IsNumber()

bool elastix::Conversion::IsNumber | ( | const std::string & |  | ) |

static

Convenience function which tells whether the argument may represent a number (either fixed point, floating point, or integer/whole number).

Note
  IsNumber("NaN") and IsNumber("nan") return false.

## ObjectPtrToString()

std::string elastix::Conversion::ObjectPtrToString | ( | itk::Object * |  | ) |

static

Converts a raw itk::Object pointer to a text string.

## ParameterMapToString()

std::string elastix::Conversion::ParameterMapToString | ( | const ParameterMapType & |  | ) |

static

Converts the specified parameter map to a text string, according to the elastix parameter text file format.

## SecondsToDHMS()

std::string elastix::Conversion::SecondsToDHMS | ( | const double | totalSeconds,
|  | const unsigned int | precision )

static

Convenience function to convert seconds to day, hour, minute, second format.

## StringToValue() [1/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | bool & | value )

static

Overload to cast a string to a bool. Returns true when casting was successful and false otherwise.

## StringToValue() [2/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | char & | value )

static

Overloads for (signed/unsigned) char types, processing them as 8-bits integer types.

## StringToValue() [3/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | double & | value )

static

Overloads for floating point types, to support NaN and infinity.

## StringToValue() [4/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | float & | value )

static

Overloads for floating point types, to support NaN and infinity.

## StringToValue() [5/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | itk::Object *& | value )

static

Overload to cast a string to an itk::Object pointer. Returns true when casting was successful and false otherwise.

## StringToValue() [6/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | signed char & | value )

static

Overloads for (signed/unsigned) char types, processing them as 8-bits integer types.

## StringToValue() [7/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | std::string & | value )

static

Provide a specialization for std::string, since the general StringToValue (especially outputStringStream >> value) will not work for strings containing spaces.

## StringToValue() [8/9]

template<class T>

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | T & | value )

inline static

A templated function to cast strings to a type T. Returns true when casting was successful and false otherwise. We make use of the casting functionality of string streams.

Definition at line 174 of file elxConversion.h.

## StringToValue() [9/9]

bool elastix::Conversion::StringToValue | ( | const std::string & | str,
|  | unsigned char & | value )

static

Overloads for (signed/unsigned) char types, processing them as 8-bits integer types.

## ToNativePathNameSeparators()

std::string elastix::Conversion::ToNativePathNameSeparators | ( | const std::string & |  | ) |

static

Similar to Qt5 QDir::toNativeSeparators(const QString &pathName).

## ToOptimizerParameters()

itk::OptimizerParameters< double > elastix::Conversion::ToOptimizerParameters | ( | const std::vector< double > & |  | ) |

static

Converts the specified std::vector to an OptimizerParameters object.

## ToString() [1/4]

std::string elastix::Conversion::ToString | ( | const bool | arg | ) |

inline static

Convenience function overload to convert a Boolean to a text string.

Definition at line 77 of file elxConversion.h.

## ToString() [2/4]

template<typename TInteger>

std::string elastix::Conversion::ToString | ( | const TInteger | integerValue | ) |

inline static

Convenience function overload to convert an integer to a text string.

Definition at line 93 of file elxConversion.h.

## ToString() [3/4]

std::string elastix::Conversion::ToString | ( | double |  | ) |

static

Convenience function overload to convert a double precision floating point to a text string.

## ToString() [4/4]

std::string elastix::Conversion::ToString | ( | float |  | ) |

static

Convenience function overload to convert a single precision floating point to a text string.

## ToVectorOfStrings() [1/2]

template<typename T, unsigned int NRows, unsigned int NColumns>

std::vector< std::string > elastix::Conversion::ToVectorOfStrings | ( | const itk::Matrix< T, NRows, NColumns > & | matrix | ) |

inline static

Convenience function overload to convert a 2-D matrix to a vector of text strings. Typically used for an itk::ImageBase::DirectionType.

Definition at line 129 of file elxConversion.h.

## ToVectorOfStrings() [2/2]

template<typename TContainer, typename SFINAE = typename TContainer::iterator>

std::vector< std::string > elastix::Conversion::ToVectorOfStrings | ( | const TContainer & | container | ) |

inline static

Convenience function overload to convert a container to a vector of text strings. The container may be an itk::Size, itk::Index, itk::Point<double,N>, or itk::Vector<double,N>, or itk::OptimizationParameters<double>.

The C++ SFINAE idiom is being used to ensure that the argument type supports standard C++ iteration.

Definition at line 111 of file elxConversion.h.

Generated on 1768596610 for elastix by 1.15.0 |