Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
14 #define mitkUSVideoDevice_h
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 
40  class MITKUS_EXPORT USVideoDevice : public mitk::USDevice
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
mitk::USVideoDevice::m_SourceIsFile
bool m_SourceIsFile
True, if this source plays back a file, false if it recieves data from a device.
Definition: mitkUSVideoDevice.h:219
mitk::USVideoDevice::m_Probes
std::vector< mitk::USProbe::Pointer > m_Probes
probes for this USVideoDevice
Definition: mitkUSVideoDevice.h:239
mitkNewMacro2Param
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:81
mitk::USVideoDevice::m_CurrentProbe
mitk::USProbe::Pointer m_CurrentProbe
probe that is currently in use
Definition: mitkUSVideoDevice.h:244
mitk::USVideoDevice::m_ControlInterfaceCustom
itk::SmartPointer< USVideoDeviceCustomControls > m_ControlInterfaceCustom
custom control interface for us video device
Definition: mitkUSVideoDevice.h:234
mitk::USVideoDevice::m_DeviceID
int m_DeviceID
The device id to connect to. Undefined, if m_SourceIsFile == true;.
Definition: mitkUSVideoDevice.h:224
itk::SmartPointer
Definition: mitkIFileReader.h:30
mitkUSProbe.h
mitkNewMacro3Param
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:94
mitk::USDevice
A device holds information about it's model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:75
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitkUSImageVideoSource.h
mitkCommon.h
mitkUSDevice.h
mitk::USVideoDevice
A mitk::USVideoDevice is the common class for video only devices. They capture video input either fro...
Definition: mitkUSVideoDevice.h:40
mitk::USVideoDevice::m_Source
mitk::USImageVideoSource::Pointer m_Source
The image source that we use to aquire data.
Definition: mitkUSVideoDevice.h:214
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::USVideoDevice::m_FilePath
std::string m_FilePath
The Filepath id to connect to. Undefined, if m_SourceIsFile == false;.
Definition: mitkUSVideoDevice.h:229