Medical Imaging Interaction Toolkit  2024.06.00
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 mitkStringsToNumbers_h
14 #define mitkStringsToNumbers_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
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::StringsToNumbers
void StringsToNumbers(unsigned int count, const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
Definition: mitkStringsToNumbers.h:48