Medical Imaging Interaction Toolkit  2018.04.99-aba3194f
Medical Imaging Interaction Toolkit
mitkUSVideoDevice.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 MITKUSVideoDevice_H_HEADER_INCLUDED_
14 #define MITKUSVideoDevice_H_HEADER_INCLUDED_
15 
16 #include <MitkUSExports.h>
17 #include <mitkCommon.h>
18 #include "mitkUSDevice.h"
19 #include "mitkUSImageVideoSource.h"
20 #include "mitkUSProbe.h"
21 #include <itkObjectFactory.h>
22 
23 namespace itk {
24  template<class T> class SmartPointer;
25 }
26 
27 namespace mitk {
28  class USVideoDeviceCustomControls;
29  class USAbstractControlInterface;
30 
41  {
42  public:
44  // To open a device (DeviceID, Manufacturer, Model)
45  mitkNewMacro3Param(Self, int, std::string, std::string);
46  // To open A VideoFile (Path, Manufacturer, Model)
47  mitkNewMacro3Param(Self, std::string, std::string, std::string);
48  // To open a device (DeviceID, Metadata)
49  mitkNewMacro2Param(Self, int, mitk::USImageMetadata::Pointer);
50  // To open A VideoFile (Path, Metadata)
51  mitkNewMacro2Param(Self, std::string, mitk::USImageMetadata::Pointer);
52 
56  std::string GetDeviceClass() override;
57 
65  static std::string GetDeviceClassStatic();
66 
73  itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom() override;
74 
81  void UnregisterOnService();
82 
86  USImageSource::Pointer GetUSImageSource() override;
87 
93  std::vector<mitk::USProbe::Pointer> GetAllProbes() override;
94 
98  void DeleteAllProbes() override;
99 
105  mitk::USProbe::Pointer GetCurrentProbe() override;
106 
110  void AddNewProbe(mitk::USProbe::Pointer probe) override;
111 
116  mitk::USProbe::Pointer GetProbeByName(std::string name) override;
117 
121  void RemoveProbeByName(std::string name) override;
122 
126  bool GetIsSourceFile();
127 
132  void SetDefaultProbeAsCurrentProbe() override;
133 
137  void SetCurrentProbe( std::string probename ) override;
138 
142  void SetSpacing( double xSpacing, double ySpacing ) override;
143 
144  itkGetMacro(ImageVector, std::vector<mitk::Image::Pointer>);
145  itkGetMacro(DeviceID, int);
146  itkGetMacro(FilePath, std::string);
147  protected:
148 
154  USVideoDevice(int videoDeviceNumber, std::string manufacturer, std::string model);
158  USVideoDevice(std::string videoFilePath, std::string manufacturer, std::string model);
164  USVideoDevice(int videoDeviceNumber, mitk::USImageMetadata::Pointer metadata);
168  USVideoDevice(std::string videoFilePath, mitk::USImageMetadata::Pointer metadata);
169 
170  ~USVideoDevice() override;
171 
175  void Init();
176 
181  bool OnInitialization() override;
182 
187  bool OnConnection() override;
188 
193  bool OnDisconnection() override;
194 
198  bool OnActivation() override;
199 
203  bool OnDeactivation() override;
204 
209  void GenerateData() override;
210 
214  mitk::USImageVideoSource::Pointer m_Source;
215 
220 
225 
229  std::string m_FilePath;
230 
235 
239  std::vector < mitk::USProbe::Pointer > m_Probes;
240 
244  mitk::USProbe::Pointer m_CurrentProbe;
245  };
246 } // namespace mitk
247 
248 #endif // MITKUSVideoDevice_H_HEADER_INCLUDED_
A device holds information about it&#39;s model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:73
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< USVideoDeviceCustomControls > m_ControlInterfaceCustom
custom control interface for us video device
int m_DeviceID
The device id to connect to. Undefined, if m_SourceIsFile == true;.
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
bool m_SourceIsFile
True, if this source plays back a file, false if it recieves data from a device.
mitk::USProbe::Pointer m_CurrentProbe
probe that is currently in use
#define MITKUS_EXPORT
Definition: MitkUSExports.h:15
std::string m_FilePath
The Filepath id to connect to. Undefined, if m_SourceIsFile == false;.
std::vector< mitk::USProbe::Pointer > m_Probes
probes for this USVideoDevice
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:98
A mitk::USVideoDevice is the common class for video only devices. They capture video input either fro...
mitk::USImageVideoSource::Pointer m_Source
The image source that we use to aquire data.