13 #ifndef mitkStringsToNumbers_h
14 #define mitkStringsToNumbers_h
57 template <
typename NUMBER_TYPE,
typename STRING_ARRAY,
typename DOUBLE_ARRAY>
58 void StringsToNumbers(
unsigned int count,
const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
60 for (
unsigned int i = 0; i < count; ++i)
62 numbers[i] = boost::lexical_cast<NUMBER_TYPE>(strings[i]);
Provides a robust lexical cast from strings to numeric types with a fallback for edge-case values.
Find image slices visible on a given plane.
void StringsToNumbers(unsigned int count, const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
Converts an array of string representations to an array of numeric values.