Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkUSDevicePersistence.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 mitkUSDevicePersistence_h
14 #define mitkUSDevicePersistence_h
15 
16 // MITK
17 #include <mitkCommon.h>
18 #include <mitkUSVideoDevice.h>
19 #include <mitkUSProbe.h>
20 
21 // ITK
22 #include <itkObjectFactory.h>
23 
24 // QT
25 #include <QSettings>
26 
27 namespace mitk {
32  class USDevicePersistence : public itk::Object
33  {
34  public:
36  itkFactorylessNewMacro(Self);
37  itkCloneMacro(Self);
38 
39  void StoreCurrentDevices();
40 
41  std::vector<mitk::USDevice::Pointer> RestoreLastDevices();
42 
43  protected:
44 
46  ~USDevicePersistence() override{}
47 
50  QString USProbeToString(mitk::USProbe::Pointer p);
51  mitk::USProbe::Pointer StringToUSProbe(std::string s);
52 
53  QSettings m_devices;
54 
55  void split(std::string& text, std::string& separators, std::vector<std::string>& words);
56  double spacingToDouble(std::string s);
57  int depthToInt(std::string s);
58  };
59 } // namespace mitk
60 
61 #endif
mitk::USDevicePersistence::StringToUSProbe
mitk::USProbe::Pointer StringToUSProbe(std::string s)
mitk::USDevicePersistence
Definition: mitkUSDevicePersistence.h:32
mitk::USDevicePersistence::USProbeToString
QString USProbeToString(mitk::USProbe::Pointer p)
itk::SmartPointer< Self >
mitkUSProbe.h
mitk::USDevicePersistence::~USDevicePersistence
~USDevicePersistence() override
Definition: mitkUSDevicePersistence.h:46
mitk::USDevicePersistence::mitkClassMacroItkParent
mitkClassMacroItkParent(USDevicePersistence, itk::Object)
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::USDevicePersistence::split
void split(std::string &text, std::string &separators, std::vector< std::string > &words)
mitk::USDevicePersistence::StoreCurrentDevices
void StoreCurrentDevices()
mitk::USDevicePersistence::spacingToDouble
double spacingToDouble(std::string s)
mitk::USDevicePersistence::depthToInt
int depthToInt(std::string s)
mitk::USDevicePersistence::StringToUSVideoDevice
mitk::USVideoDevice::Pointer StringToUSVideoDevice(QString s)
mitkCommon.h
mitk::USDevicePersistence::USDevicePersistence
USDevicePersistence()
mitkUSVideoDevice.h
mitk::USDevicePersistence::USVideoDeviceToString
QString USVideoDeviceToString(mitk::USVideoDevice::Pointer d)
mitk::USDevicePersistence::m_devices
QSettings m_devices
Definition: mitkUSDevicePersistence.h:53
mitk::USDevicePersistence::RestoreLastDevices
std::vector< mitk::USDevice::Pointer > RestoreLastDevices()