Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkTestDICOMLoading.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 #ifndef mitkTestDICOMLoading_h
13 #define mitkTestDICOMLoading_h
14 
16 
18 
19 namespace mitk
20 {
21 
23 {
24  public:
25 
26  typedef std::list<Image::Pointer> ImageList;
27 
29 
30  ImageList
31  LoadFiles( const StringList & files );
32 
34  DecorateVerifyCachedImage( const StringList& files, mitk::Image::Pointer cachedImage );
35 
37  DecorateVerifyCachedImage( const StringList& files, DICOMTagCache*, mitk::Image::Pointer cachedImage );
38 
43  std::string
44  DumpImageInformation( const Image* image );
45 
51  bool
52  CompareImageInformationDumps( const std::string& reference,
53  const std::string& test );
54 
55  private:
56 
57  typedef std::map<std::string,std::string> KeyValueMap;
58 
59  ClassicDICOMSeriesReader::Pointer
60  BuildDICOMReader();
61 
62  void SetDefaultLocale();
63 
64  void ResetUserLocale();
65 
66  std::string ComponentTypeToString( int type );
67 
68  KeyValueMap ParseDump( const std::string& dump );
69 
70  bool CompareSpacedValueFields( const std::string& reference,
71  const std::string& test,
72  double eps = mitk::eps );
73 
80  std::string reduce(const std::string& pString,
81  const std::string& pFill = " ",
82  const std::string& pWhitespace = " \t");
83 
89  std::string trim(const std::string& pString,
90  const std::string& pWhitespace = " \t");
91 
92  template<typename T>
93  bool StringToNumber(const std::string& s, T& value)
94  {
95  std::stringstream stream(s);
96  stream >> value;
97  return (!stream.fail()) && (std::abs(value) <= std::numeric_limits<T>::max());
98  }
99 
100  const char* m_PreviousCLocale;
101  std::locale m_PreviousCppLocale;
102 
103 };
104 
105 }
106 
107 #endif
108 
Follow Up Storage - Class to facilitate loading/accessing structured follow-up data.
Definition: testcase.h:28
DataCollection - Class to facilitate loading/accessing structured data.
std::list< Image::Pointer > ImageList
#define MITKDICOMTESTING_EXPORT
Image class for storing images.
Definition: mitkImage.h:72
static T max(T x, T y)
Definition: svm.cpp:56
mitk::Image::Pointer image
std::vector< std::string > StringList
MITKCORE_EXPORT const ScalarType eps