Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKUSVideoDevice_H_HEADER_INCLUDED_
18 #define MITKUSVideoDevice_H_HEADER_INCLUDED_
19 
20 #include <MitkUSExports.h>
21 #include <mitkCommon.h>
22 #include "mitkUSDevice.h"
23 #include "mitkUSImageVideoSource.h"
24 #include "mitkUSProbe.h"
25 #include <itkObjectFactory.h>
26 
27 namespace itk {
28  template<class T> class SmartPointer;
29 }
30 
31 namespace mitk {
32  class USVideoDeviceCustomControls;
33  class USAbstractControlInterface;
34 
44  class MITKUS_EXPORT USVideoDevice : public mitk::USDevice
45  {
46  public:
48  // To open a device (DeviceID, Manufacturer, Model)
49  mitkNewMacro3Param(Self, int, std::string, std::string);
50  // To open A VideoFile (Path, Manufacturer, Model)
51  mitkNewMacro3Param(Self, std::string, std::string, std::string);
52  // To open a device (DeviceID, Metadata)
54  // To open A VideoFile (Path, Metadata)
56 
60  virtual std::string GetDeviceClass() override;
61 
69  static std::string GetDeviceClassStatic();
70 
77  virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom() override;
78 
85  void UnregisterOnService();
86 
90  virtual USImageSource::Pointer GetUSImageSource() override;
91 
97  std::vector<mitk::USProbe::Pointer> GetAllProbes();
98 
104  mitk::USProbe::Pointer GetCurrentProbe();
105 
109  void AddNewProbe(mitk::USProbe::Pointer probe);
110 
115  mitk::USProbe::Pointer GetProbeByName(std::string name);
116 
120  void RemoveProbeByName(std::string name);
121 
125  bool GetIsSourceFile();
126 
127  itkGetMacro(Image, mitk::Image::Pointer);
128  itkGetMacro(DeviceID, int);
129  itkGetMacro(FilePath, std::string);
130  protected:
131 
137  USVideoDevice(int videoDeviceNumber, std::string manufacturer, std::string model);
141  USVideoDevice(std::string videoFilePath, std::string manufacturer, std::string model);
147  USVideoDevice(int videoDeviceNumber, mitk::USImageMetadata::Pointer metadata);
151  USVideoDevice(std::string videoFilePath, mitk::USImageMetadata::Pointer metadata);
152 
153  virtual ~USVideoDevice();
154 
158  void Init();
159 
164  virtual bool OnInitialization() override;
165 
170  virtual bool OnConnection() override;
171 
176  virtual bool OnDisconnection() override;
177 
181  virtual bool OnActivation() override;
182 
186  virtual bool OnDeactivation() override;
187 
192 
197 
202 
206  std::string m_FilePath;
207 
212 
216  std::vector < mitk::USProbe::Pointer > m_Probes;
217 
222  };
223 } // namespace mitk
224 
225 #endif // MITKUSVideoDevice_H_HEADER_INCLUDED_
A device holds information about it's model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:77
itk::SmartPointer< Self > Pointer
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:89
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
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
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:102
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.