Medical Imaging Interaction Toolkit  2022.04.99-7b8c4c8a
Medical Imaging Interaction Toolkit
mitkStringsToNumbers.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkVectorPropertySerializer_h
14 #define mitkVectorPropertySerializer_h
15 
16 #include <mitkLexicalCast.h>
17 
18 namespace mitk
19 {
47  template <typename NUMBER_TYPE, typename STRING_ARRAY, typename DOUBLE_ARRAY>
48  void StringsToNumbers(unsigned int count, const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
49  {
50  for (unsigned int i = 0; i < count; ++i)
51  {
52  numbers[i] = boost::lexical_cast<NUMBER_TYPE>(strings[i]);
53  }
54  }
55 }
56 
57 #endif
mitkLexicalCast.h
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::StringsToNumbers
void StringsToNumbers(unsigned int count, const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
Definition: mitkStringsToNumbers.h:48