61 this->SetNumberOfIndexedOutputs(1);
65 this->SetNthOutput(0, this->MakeOutput(0));
75 return "org.mitk.modules.us.USVideoDevice";
80 return m_ControlInterfaceCustom.GetPointer();
92 m_Source->SetVideoFileInput(m_FilePath);
95 m_Source->SetCameraInput(m_DeviceID);
103 if (m_DeviceState == State_Activated) this->Deactivate();
105 m_Source->ReleaseInput();
113 if (!m_Source->GetIsReady())
115 MITK_WARN(
"mitkUSDevice")(
"mitkUSVideoDevice") <<
"Could not activate us video device. Check if video grabber is configured correctly.";
131 if (m_DeviceState == State_Activated) { this->Deactivate(); }
132 if (m_DeviceState == State_Connected) { this->Disconnect(); }
139 return m_Source.GetPointer();
144 if (m_Probes.empty())
146 MITK_INFO <<
"No probes exist for this USVideDevice. Empty vector is returned";
153 if (m_CurrentProbe.IsNotNull())
155 return m_CurrentProbe;
165 for (std::vector<mitk::USProbe::Pointer>::iterator it = m_Probes.begin(); it != m_Probes.end(); it++)
167 if (name.compare((*it)->GetName()) == 0)
170 MITK_INFO <<
"No probe with given name " << name <<
" was found.";
176 for (std::vector<mitk::USProbe::Pointer>::iterator it = m_Probes.begin(); it != m_Probes.end(); it++)
178 if (name.compare((*it)->GetName()) == 0)
184 MITK_INFO <<
"No Probe with given name " << name <<
" was found";
189 m_Probes.push_back(probe);
194 return m_SourceIsFile;
virtual itk::SmartPointer< USAbstractControlInterface > GetControlInterfaceCustom() override
A device holds information about it's model, make and the connected probes. It is the common super cl...
itk::SmartPointer< Self > Pointer
bool GetIsSourceFile()
True, if this Device plays back a file, false if it recieves data from a device.
void RemoveProbeByName(std::string name)
Removes the Probe with the given name.
DataCollection - Class to facilitate loading/accessing structured data.
mitk::USProbe::Pointer GetCurrentProbe()
Return current active probe for this USVideoDevice Returns a pointer to the probe that is currently i...
virtual bool OnConnection() override
Is called during the connection process. Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong.
virtual bool OnInitialization() override
Is called during the initialization process. Returns true if successful and false if unsuccessful...
int m_DeviceID
The device id to connect to. Undefined, if m_SourceIsFile == true;.
virtual bool OnDisconnection() override
Is called during the disconnection process. Returns true if successful and false if unsuccessful...
std::vector< mitk::USProbe::Pointer > GetAllProbes()
Return all probes for this USVideoDevice or an empty vector it no probes were set Returns a std::vect...
mitk::USProbe::Pointer GetProbeByName(std::string name)
get the probe by its name Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
bool m_SourceIsFile
True, if this source plays back a file, false if it recieves data from a device.
void UnregisterOnService()
Remove this device from the micro service.
USVideoDevice(int videoDeviceNumber, std::string manufacturer, std::string model)
Creates a new device that will deliver USImages taken from a video device. under windows, try -1 for device number, which will grab the first available one (Open CV functionality)
void UnregisterOnService()
Remove this device from the micro service. This method is public for mitk::USVideoDevice, because this devices can be completly removed. This is not possible for API devices, which should be available while their sub module is loaded.
virtual USImageSource::Pointer GetUSImageSource() override
virtual bool OnActivation() override
Is called during the activation process. After this method is finsihed, the device should be generati...
std::string m_FilePath
The Filepath id to connect to. Undefined, if m_SourceIsFile == false;.
static std::string GetDeviceClassStatic()
virtual std::string GetDeviceClass() override
virtual bool OnDeactivation() override
Is called during the deactivation process. After a call to this method the device should still be con...
void AddNewProbe(mitk::USProbe::Pointer probe)
adds a new probe to the device
void Init()
Initializes common properties for all constructors.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.