57 this->SetNumberOfIndexedOutputs(1);
71 return "org.mitk.modules.us.USVideoDevice";
111 MITK_WARN(
"mitkUSDevice")(
"mitkUSVideoDevice") <<
"Could not activate us video device. Check if video grabber is configured correctly.";
127 Superclass::GenerateData();
129 if(
m_ImageVector.size() == 0 || this->GetNumberOfIndexedOutputs() == 0 )
162 MITK_INFO <<
"No probes exist for this USVideDevice. Empty vector is returned";
186 for (std::vector<mitk::USProbe::Pointer>::iterator it =
m_Probes.begin(); it !=
m_Probes.end(); it++)
188 if (name.compare((*it)->GetName()) == 0)
191 MITK_INFO <<
"No probe with given name " << name <<
" was found.";
197 for (std::vector<mitk::USProbe::Pointer>::iterator it =
m_Probes.begin(); it !=
m_Probes.end(); it++)
199 if (name.compare((*it)->GetName()) == 0)
205 MITK_INFO <<
"No Probe with given name " << name <<
" was found";
222 std::string name =
"default";
228 MITK_INFO <<
"SetDefaultProbeAsCurrentProbe()";
235 MITK_INFO <<
"SetCurrentProbe() " << probename;
241 spacing[0] = xSpacing;
242 spacing[1] = ySpacing;
252 MITK_WARN <<
"Cannot set spacing. Current ultrasound probe not set.";
itk::SmartPointer< USAbstractControlInterface > GetControlInterfaceCustom() override
A device holds information about it's model, make and the connected probes. It is the common super cl...
bool GetIsSourceFile()
True, if this Device plays back a file, false if it recieves data from a device.
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
~USVideoDevice() override
std::vector< mitk::USProbe::Pointer > GetAllProbes() override
Return all probes for this USVideoDevice or an empty vector it no probes were set Returns a std::vect...
void SetDefaultProbeAsCurrentProbe() override
Sets the first existing probe or the default probe of the video device as the current probe of it...
virtual void SetGeometry(BaseGeometry *aGeometry3D)
Set the BaseGeometry of the data, which will be referenced (not copied!). Assumes the data object has...
DataCollection - Class to facilitate loading/accessing structured data.
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.
itk::SmartPointer< USVideoDeviceCustomControls > m_ControlInterfaceCustom
custom control interface for us video device
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;.
bool OnDisconnection() override
Is called during the disconnection process. Returns true if successful and false if unsuccessful...
mitk::USProbe::Pointer GetProbeByName(std::string name) override
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.
void ProbeChanged(std::string probename)
To be called when the used probe changed. Will update the service properties.
void SetCurrentProbe(std::string probename) override
Sets the probe with the given name as current probe if the named probe exists.
mitk::USProbe::Pointer GetCurrentProbe() override
Return current active probe for this USVideoDevice Returns a pointer to the probe that is currently i...
void GenerateData() override
Grabs the next frame from the Video input. This method is called internally, whenever Update() is inv...
void RemoveProbeByName(std::string name) override
Removes the Probe with the given name.
bool m_SourceIsFile
True, if this source plays back a file, false if it recieves data from a device.
mitk::Image::Pointer image
mitk::USProbe::Pointer m_CurrentProbe
probe that is currently in use
void UnregisterOnService()
Remove this device from the micro service.
std::vector< mitk::Image::Pointer > m_ImageVector
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 SetSpacing(double xSpacing, double ySpacing) override
Sets the given spacing of the current depth of the current probe.
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.
DeviceStates m_DeviceState
void AddNewProbe(mitk::USProbe::Pointer probe) override
adds a new probe to the device
USImageSource::Pointer GetUSImageSource() override
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;.
void Deactivate()
Deactivates this device. After the deactivation process, the device will no longer produce images...
std::vector< mitk::USProbe::Pointer > m_Probes
probes for this USVideoDevice
OutputType * GetOutput()
Get the output data of this image source object.
static std::string GetDeviceClassStatic()
std::string GetDeviceClass() override
itk::FastMutexLock::Pointer m_ImageMutex
mutex for images provided by the image source
bool OnDeactivation() override
Is called during the deactivation process. After a call to this method the device should still be con...
bool Disconnect()
Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection inste...
void DeleteAllProbes() override
Cleans the std::vector containing all configured probes.
mitk::USImageVideoSource::Pointer m_Source
The image source that we use to aquire data.
void Init()
Initializes common properties for all constructors.