Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
A device holds information about it's model, make and the connected probes. It is the common super class for all devices and acts as an image source for mitkUSImages. It is the base class for all US Devices, and every new device should extend it. More...
#include <mitkUSDevice.h>
Classes | |
struct | PropertyKeys |
These constants are used in conjunction with Microservices. The constants aren't defined as static member attributes to avoid the "static initialization order fiasco", which would occur when objects of this class are used in module activators (for restoring stored device, for example). More... | |
struct | USImageCropArea |
Public Types | |
enum | DeviceStates { State_NoState, State_Initialized, State_Connected, State_Activated } |
![]() | |
typedef ImageSource | Self |
typedef BaseDataSource | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef mitk::Image | OutputImageType |
Some convenient typedefs. More... | |
typedef OutputImageType | OutputType |
typedef OutputImageType::Pointer | OutputImagePointer |
typedef SlicedData::RegionType | OutputImageRegionType |
![]() | |
typedef BaseDataSource | Self |
typedef itk::ProcessObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef BaseData | OutputType |
typedef itk::DataObject::DataObjectIdentifierType | DataObjectIdentifierType |
Public Member Functions | |
mitkClassMacro (USDevice, mitk::ImageSource) | |
virtual void | SetSpawnAcquireThread (bool _arg) |
virtual bool | GetSpawnAcquireThread () |
mitkNewMessage2Macro (PropertyChanged, const std::string &, const std::string &) | |
Event for being notified about changes of the micro service properties. This event can be used if no micro service context is available. More... | |
virtual itk::SmartPointer< USAbstractControlInterface > | GetControlInterfaceCustom () |
Default getter for the custom control interface. Has to be implemented in a subclass if a custom control interface is available. Default implementation returns null. More... | |
virtual itk::SmartPointer< USControlInterfaceBMode > | GetControlInterfaceBMode () |
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode control interface is available. Default implementation returns null. More... | |
virtual itk::SmartPointer< USControlInterfaceProbes > | GetControlInterfaceProbes () |
Default getter for the probes control interface. Has to be implemented in a subclass if a probes control interface is available. Default implementation returns null. More... | |
virtual itk::SmartPointer< USControlInterfaceDoppler > | GetControlInterfaceDoppler () |
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler control interface is available. Default implementation returns null. More... | |
bool | Initialize () |
Changes device state to mitk::USDevice::State_Initialized. During initialization the virtual method mitk::USDevice::OnInitialization will be called. If this method returns false the initialization process will be canceled. Otherwise the mitk::USDevice is registered in a micro service. More... | |
bool | Connect () |
Connects this device. A connected device is ready to deliver images (i.e. be Activated). A Connected Device can be active. A disconnected Device cannot be active. Internally calls onConnect and then registers the device with the service. A device usually should override the OnConnection() method, but never the Connect() method, since this will possibly exclude the device from normal service management. The exact flow of events is: 0. Check if the device is already connected. If yes, return true anyway, but don't do anything. More... | |
void | ConnectAsynchron () |
bool | Disconnect () |
Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection instead. More... | |
bool | Activate () |
Activates this device. After the activation process, the device will start to produce images. This Method will fail, if the device is not connected. More... | |
void | Deactivate () |
Deactivates this device. After the deactivation process, the device will no longer produce images, but still be connected. More... | |
virtual void | SetIsFreezed (bool freeze) |
Can toggle if ultrasound image is currently updated or freezed. More... | |
virtual bool | GetIsFreezed () |
void | PushFilter (AbstractOpenCVImageFilter::Pointer filter) |
void | PushFilterIfNotPushedBefore (AbstractOpenCVImageFilter::Pointer filter) |
bool | RemoveFilter (AbstractOpenCVImageFilter::Pointer filter) |
void | ProbeChanged (std::string probename) |
To be called when the used probe changed. Will update the service properties. More... | |
void | DepthChanged (double depth) |
To be called when the scanning depth of the probe changed. Will update the service properties. More... | |
void | UpdateServiceProperty (std::string key, std::string value) |
Given property is updated in the device micro service. This method is mainly for being used by the control interface superclasses. You do not need to call it by yoursefs in your concrete control interface classes. More... | |
void | UpdateServiceProperty (std::string key, double value) |
void | UpdateServiceProperty (std::string key, bool value) |
virtual std::string | GetDeviceClass ()=0 |
Returns the Class of the Device. This Method must be reimplemented by every Inheriting Class. More... | |
bool | GetIsInitialized () |
True, if the device object is created and initialized, false otherwise. More... | |
bool | GetIsActive () |
True, if the device is currently generating image data, false otherwise. More... | |
bool | GetIsConnected () |
True, if the device is currently ready to start transmitting image data or is already transmitting image data. A disconnected device cannot be activated. More... | |
mitk::USDevice::USImageCropArea | GetCropArea () |
unsigned int | GetSizeOfImageVector () |
virtual USImageSource::Pointer | GetUSImageSource ()=0 |
std::string | GetDeviceManufacturer () |
Deprecated -> use GetManufacturer() instead. More... | |
std::string | GetDeviceModel () |
Deprecated -> use GetName() instead. More... | |
std::string | GetDeviceComment () |
Deprecated -> use GetCommend() instead. More... | |
virtual std::string | GetManufacturer () |
virtual std::string | GetName () |
virtual std::string | GetComment () |
void | SetManufacturer (std::string manufacturer) |
void | SetName (std::string name) |
void | SetComment (std::string comment) |
virtual DeviceStates | GetDeviceState () |
virtual us::ServiceProperties | GetServiceProperties () |
void | GrabImage () |
virtual std::vector< mitk::USProbe::Pointer > | GetAllProbes ()=0 |
Returns all probes for this device or an empty vector it no probes were set Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice. Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it! More... | |
virtual void | DeleteAllProbes () |
Cleans the std::vector containing all configured probes. More... | |
virtual mitk::USProbe::Pointer | GetCurrentProbe ()=0 |
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice. Returns null otherwise. More... | |
virtual void | AddNewProbe (mitk::USProbe::Pointer) |
adds a new probe to the device More... | |
virtual mitk::USProbe::Pointer | GetProbeByName (std::string name)=0 |
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. More... | |
virtual void | RemoveProbeByName (std::string) |
Removes the Probe with the given name. More... | |
virtual void | SetDefaultProbeAsCurrentProbe () |
Sets the first existing probe or the default probe of the ultrasound device as the current probe of it. More... | |
virtual void | SetCurrentProbe (std::string) |
Sets the probe with the given name as current probe if the named probe exists. More... | |
virtual void | SetSpacing (double xSpacing, double ySpacing) |
![]() | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
OutputType * | GetOutput () |
Get the output data of this image source object. More... | |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
itk::DataObject::Pointer | MakeOutput (DataObjectPointerArraySizeType idx) override |
Make a DataObject of the correct type to used as the specified output. More... | |
itk::DataObject::Pointer | MakeOutput (const DataObjectIdentifierType &name) override |
virtual vtkImageData * | GetVtkImageData () |
virtual const vtkImageData * | GetVtkImageData () const |
![]() | |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
virtual void | GraftOutput (OutputType *output) |
Graft the specified BaseData onto this BaseDataSource's output. More... | |
virtual void | GraftOutput (const DataObjectIdentifierType &key, OutputType *output) |
virtual void | GraftNthOutput (unsigned int idx, OutputType *output) |
Graft the specified base data object onto this BaseDataSource's idx'th output. More... | |
bool | Updating () const |
Access itk::ProcessObject::m_Updating. More... | |
Static Public Member Functions | |
static mitk::USDevice::PropertyKeys | GetPropertyKeys () |
![]() | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Method for creation through the object factory. More... | |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
virtual void | SetImageVector (std::vector< mitk::Image::Pointer > vec) |
void | ProvideViaOIGTL () |
Registers an OpenIGTLink device as a microservice so that we can send the images of this device via the network. More... | |
void | DisableOIGTL () |
Deregisters the microservices for OpenIGTLink. More... | |
us::ServiceProperties | ConstructServiceProperties () |
This Method constructs the service properties which can later be used to register the object with the Microservices Return service properties. More... | |
void | UnregisterOnService () |
Remove this device from the micro service. More... | |
virtual bool | OnInitialization ()=0 |
Is called during the initialization process. Override this method in a subclass to handle the actual initialization. If it returns false, the initialization process will be canceled. More... | |
virtual bool | OnConnection ()=0 |
Is called during the connection process. Override this method in a subclass to handle the actual connection. If it returns false, the connection process will be canceled. More... | |
virtual bool | OnDisconnection ()=0 |
Is called during the disconnection process. Override this method in a subclass to handle the actual disconnection. If it returns false, the disconnection process will be canceled. More... | |
virtual bool | OnActivation ()=0 |
Is called during the activation process. After this method is finished, the device should be generating images. If it returns false, the activation process will be canceled. More... | |
virtual bool | OnDeactivation ()=0 |
Is called during the deactivation process. After a call to this method the device should still be connected, but not producing images anymore. More... | |
virtual void | OnFreeze (bool) |
Called when mitk::USDevice::SetIsFreezed() is called. Subclasses can overwrite this method to do additional actions. Default implementation does noting. More... | |
USDevice (std::string manufacturer, std::string model) | |
Enforces minimal Metadata to be set. More... | |
USDevice (mitk::USImageMetadata::Pointer metadata) | |
Constructs a device with the given Metadata. Make sure the Metadata contains meaningful content! More... | |
~USDevice () override | |
void | GenerateData () override |
Grabs the next frame from the Video input. This method is called internally, whenever Update() is invoked by an Output. More... | |
std::string | GetServicePropertyLabel () |
![]() | |
ImageSource () | |
~ImageSource () override | |
void | GenerateData () override |
A version of GenerateData() specific for image processing filters. More... | |
virtual void | ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) |
If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More... | |
void | PrepareOutputs () override |
This method is intentionally left blank. More... | |
virtual void | AllocateOutputs () |
The GenerateData method normally allocates the buffers for all of the outputs of a filter. More... | |
virtual void | BeforeThreadedGenerateData () |
If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More... | |
virtual void | AfterThreadedGenerateData () |
If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More... | |
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) |
Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More... | |
![]() | |
BaseDataSource () | |
~BaseDataSource () override | |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_TYPE | Acquire (void *pInfoStruct) |
static ITK_THREAD_RETURN_TYPE | ConnectThread (void *pInfoStruct) |
![]() | |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
Static function used as a "callback" by the MultiThreader. More... | |
![]() | |
static Pointer | New () |
Protected Attributes | |
itk::ConditionVariable::Pointer | m_FreezeBarrier |
itk::SimpleMutexLock | m_FreezeMutex |
itk::MultiThreader::Pointer | m_MultiThreader |
itk::MultiThreader used for thread handling More... | |
itk::FastMutexLock::Pointer | m_ImageMutex |
mutex for images provided by the image source More... | |
int | m_ThreadID |
ID of the started thread. More... | |
std::vector< mitk::Image::Pointer > | m_ImageVector |
mitk::Vector3D | m_Spacing |
mitk::IGTLServer::Pointer | m_IGTLServer |
mitk::IGTLMessageProvider::Pointer | m_IGTLMessageProvider |
mitk::ImageToIGTLMessageFilter::Pointer | m_ImageToIGTLMsgFilter |
bool | m_IsFreezed |
DeviceStates | m_DeviceState |
USImageCropArea | m_CropArea |
unsigned int | m_NumberOfOutputs |
us::ServiceProperties | m_ServiceProperties |
Properties of the device's Microservice. More... | |
us::ServiceRegistration< Self > | m_ServiceRegistration |
The device's ServiceRegistration object that allows to modify it's Microservice registraton details. More... | |
A device holds information about it's model, make and the connected probes. It is the common super class for all devices and acts as an image source for mitkUSImages. It is the base class for all US Devices, and every new device should extend it.
US Devices support output of calibrated images, i.e. images that include a specific geometry. To achieve this, call SetCalibration, and make sure that the subclass also calls apply transformation at some point (The USDevice does not automatically apply the transformation to the image)
Note that USDevices will be removed from micro servive when their destructor is called. Registering into micro service is done when mitk::USDevice::Initialize() is called.
Definition at line 73 of file mitkUSDevice.h.
Enumerator | |
---|---|
State_NoState | |
State_Initialized | |
State_Connected | |
State_Activated |
Definition at line 76 of file mitkUSDevice.h.
|
protected |
Enforces minimal Metadata to be set.
Definition at line 46 of file mitkUSDevice.cpp.
References mitk::USDevice::USImageCropArea::cropBottom, mitk::USDevice::USImageCropArea::cropLeft, mitk::USDevice::USImageCropArea::cropRight, mitk::USDevice::USImageCropArea::cropTop, m_CropArea, m_NumberOfOutputs, and mitk::Image::New().
|
protected |
Constructs a device with the given Metadata. Make sure the Metadata contains meaningful content!
Definition at line 84 of file mitkUSDevice.cpp.
References mitk::USDevice::USImageCropArea::cropBottom, mitk::USDevice::USImageCropArea::cropLeft, mitk::USDevice::USImageCropArea::cropRight, mitk::USDevice::USImageCropArea::cropTop, m_CropArea, m_NumberOfOutputs, and mitk::Image::New().
|
overrideprotected |
Definition at line 123 of file mitkUSDevice.cpp.
References m_MultiThreader, m_ThreadID, and UnregisterOnService().
|
staticprotected |
Definition at line 668 of file mitkUSDevice.cpp.
References GetIsActive(), GrabImage(), m_FreezeBarrier, m_FreezeMutex, and m_IsFreezed.
Referenced by Activate().
bool mitk::USDevice::Activate | ( | ) |
Activates this device. After the activation process, the device will start to produce images. This Method will fail, if the device is not connected.
Definition at line 318 of file mitkUSDevice.cpp.
References Acquire(), GetControlInterfaceBMode(), GetIsConnected(), GetPropertyKeys(), GetServicePropertyLabel(), m_DeviceState, m_FreezeBarrier, m_MultiThreader, m_ThreadID, MITK_INFO, OnActivation(), ProvideViaOIGTL(), State_Activated, and UpdateServiceProperty().
Referenced by mitk::USTelemedDevice::raw_OnProbeArrive().
|
inlinevirtual |
adds a new probe to the device
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 339 of file mitkUSDevice.h.
bool mitk::USDevice::Connect | ( | ) |
Connects this device. A connected device is ready to deliver images (i.e. be Activated). A Connected Device can be active. A disconnected Device cannot be active. Internally calls onConnect and then registers the device with the service. A device usually should override the OnConnection() method, but never the Connect() method, since this will possibly exclude the device from normal service management. The exact flow of events is: 0. Check if the device is already connected. If yes, return true anyway, but don't do anything.
Definition at line 260 of file mitkUSDevice.cpp.
References GetIsConnected(), GetIsInitialized(), GetPropertyKeys(), m_DeviceState, MITK_DEBUG, MITK_ERROR, MITK_INFO, OnConnection(), State_Connected, and UpdateServiceProperty().
Referenced by ConnectThread(), and mitk::USTelemedDevice::raw_OnBeamformerArrive().
void mitk::USDevice::ConnectAsynchron | ( | ) |
Definition at line 292 of file mitkUSDevice.cpp.
References ConnectThread(), and m_MultiThreader.
|
staticprotected |
Definition at line 692 of file mitkUSDevice.cpp.
References Connect().
Referenced by ConnectAsynchron().
|
protected |
This Method constructs the service properties which can later be used to register the object with the Microservices Return service properties.
Definition at line 194 of file mitkUSDevice.cpp.
References GetControlInterfaceProbes(), GetDeviceClass(), GetIsActive(), GetIsConnected(), GetPropertyKeys(), GetServicePropertyLabel(), m_ServiceProperties, mitk::USDevice::PropertyKeys::US_PROPKEY_CLASS, mitk::USDevice::PropertyKeys::US_PROPKEY_COMMENT, mitk::USDevice::PropertyKeys::US_PROPKEY_ISACTIVE, mitk::USDevice::PropertyKeys::US_PROPKEY_ISCONNECTED, mitk::USDevice::PropertyKeys::US_PROPKEY_LABEL, mitk::USDevice::PropertyKeys::US_PROPKEY_MANUFACTURER, mitk::USDevice::PropertyKeys::US_PROPKEY_NAME, and mitk::USDevice::PropertyKeys::US_PROPKEY_PROBES_SELECTED.
Referenced by Initialize().
void mitk::USDevice::Deactivate | ( | ) |
Deactivates this device. After the deactivation process, the device will no longer produce images, but still be connected.
Definition at line 391 of file mitkUSDevice.cpp.
References DisableOIGTL(), GetIsActive(), GetPropertyKeys(), GetServicePropertyLabel(), m_DeviceState, MITK_WARN, OnDeactivation(), State_Connected, and UpdateServiceProperty().
Referenced by mitk::USVideoDevice::OnDisconnection(), mitk::USTelemedDevice::raw_OnBeamformerRemove(), mitk::USTelemedDevice::raw_OnProbeRemove(), and mitk::USVideoDevice::UnregisterOnService().
|
inlinevirtual |
Cleans the std::vector containing all configured probes.
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 327 of file mitkUSDevice.h.
void mitk::USDevice::DepthChanged | ( | double | depth | ) |
To be called when the scanning depth of the probe changed. Will update the service properties.
depth | that is now used |
Definition at line 710 of file mitkUSDevice.cpp.
References GetPropertyKeys(), and UpdateServiceProperty().
|
protected |
Deregisters the microservices for OpenIGTLink.
Definition at line 415 of file mitkUSDevice.cpp.
References m_IGTLMessageProvider, m_IGTLServer, and m_ImageToIGTLMsgFilter.
Referenced by Deactivate().
bool mitk::USDevice::Disconnect | ( | ) |
Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection instead.
Definition at line 297 of file mitkUSDevice.cpp.
References GetIsConnected(), GetPropertyKeys(), m_DeviceState, MITK_WARN, OnDisconnection(), State_Initialized, and UpdateServiceProperty().
Referenced by QmitkUSDeviceManagerWidget::DisconnectAllDevices(), mitk::USTelemedDevice::raw_OnBeamformerRemove(), and mitk::USVideoDevice::UnregisterOnService().
|
overrideprotected |
Grabs the next frame from the Video input. This method is called internally, whenever Update() is invoked by an Output.
Definition at line 619 of file mitkUSDevice.cpp.
References mitk::ImageAccessorBase::GetData(), mitk::ImageSource::GetOutput(), image, m_ImageMutex, and m_ImageVector.
|
pure virtual |
Returns all probes for this device or an empty vector it no probes were set Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice. Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
Implemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
|
virtual |
|
virtual |
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode control interface is available. Default implementation returns null.
Reimplemented in mitk::USTelemedDevice.
Definition at line 143 of file mitkUSDevice.cpp.
References MITK_INFO.
Referenced by Activate().
|
virtual |
Default getter for the custom control interface. Has to be implemented in a subclass if a custom control interface is available. Default implementation returns null.
Reimplemented in mitk::USVideoDevice, mitk::USIGTLDevice, and mitk::USDiPhASDevice.
Definition at line 136 of file mitkUSDevice.cpp.
References MITK_INFO.
|
virtual |
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler control interface is available. Default implementation returns null.
Reimplemented in mitk::USTelemedDevice.
Definition at line 157 of file mitkUSDevice.cpp.
References MITK_INFO.
|
virtual |
Default getter for the probes control interface. Has to be implemented in a subclass if a probes control interface is available. Default implementation returns null.
Reimplemented in mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Definition at line 150 of file mitkUSDevice.cpp.
References MITK_INFO.
Referenced by ConstructServiceProperties().
mitk::USDevice::USImageCropArea mitk::USDevice::GetCropArea | ( | ) |
Definition at line 33 of file mitkUSDevice.cpp.
References mitk::USDevice::USImageCropArea::cropBottom, mitk::USDevice::USImageCropArea::cropLeft, mitk::USDevice::USImageCropArea::cropRight, mitk::USDevice::USImageCropArea::cropTop, m_CropArea, and MITK_INFO.
|
pure virtual |
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice. Returns null otherwise.
Implemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
|
pure virtual |
Returns the Class of the Device. This Method must be reimplemented by every Inheriting Class.
Implemented in mitk::USVideoDevice, mitk::USDiPhASDevice, mitk::USIGTLDevice, and mitk::USTelemedDevice.
Referenced by ConstructServiceProperties().
std::string mitk::USDevice::GetDeviceComment | ( | ) |
Deprecated -> use GetCommend() instead.
Definition at line 595 of file mitkUSDevice.cpp.
std::string mitk::USDevice::GetDeviceManufacturer | ( | ) |
Deprecated -> use GetManufacturer() instead.
Definition at line 591 of file mitkUSDevice.cpp.
std::string mitk::USDevice::GetDeviceModel | ( | ) |
Deprecated -> use GetName() instead.
Definition at line 593 of file mitkUSDevice.cpp.
|
virtual |
bool mitk::USDevice::GetIsActive | ( | ) |
True, if the device is currently generating image data, false otherwise.
Definition at line 584 of file mitkUSDevice.cpp.
References m_DeviceState, and State_Activated.
Referenced by Acquire(), ConstructServiceProperties(), Deactivate(), GetServicePropertyLabel(), mitk::USTelemedDevice::raw_OnBeamformerRemove(), mitk::USTelemedDevice::raw_OnProbeRemove(), and SetIsFreezed().
bool mitk::USDevice::GetIsConnected | ( | ) |
True, if the device is currently ready to start transmitting image data or is already transmitting image data. A disconnected device cannot be activated.
Definition at line 586 of file mitkUSDevice.cpp.
References m_DeviceState, and State_Connected.
Referenced by Activate(), Connect(), ConstructServiceProperties(), and Disconnect().
|
virtual |
Definition at line 448 of file mitkUSDevice.cpp.
References m_IsFreezed.
bool mitk::USDevice::GetIsInitialized | ( | ) |
True, if the device object is created and initialized, false otherwise.
Definition at line 579 of file mitkUSDevice.cpp.
References m_DeviceState, and State_Initialized.
Referenced by Connect().
|
virtual |
|
virtual |
Referenced by ProvideViaOIGTL().
|
pure virtual |
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.
Implemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
|
static |
Definition at line 27 of file mitkUSDevice.cpp.
Referenced by Activate(), Connect(), ConstructServiceProperties(), QmitkUSDeviceManagerWidget::CreateQtPartControl(), Deactivate(), DepthChanged(), Disconnect(), mitk::AbstractUltrasoundTrackerDevice::GetCurrentDepthValue(), mitk::AbstractUltrasoundTrackerDevice::GetIdentifierForCurrentProbe(), mitk::USControlInterfaceBMode::Initialize(), QmitkUSDeviceManagerWidget::OnDeviceSelectionChanged(), ProbeChanged(), mitk::USControlInterfaceProbes::SelectProbe(), SetComment(), SetManufacturer(), SetName(), mitk::USControlInterfaceBMode::SetScanningDepth(), mitk::USControlInterfaceBMode::SetScanningDynamicRange(), mitk::USControlInterfaceBMode::SetScanningFrequency(), mitk::USControlInterfaceBMode::SetScanningGain(), mitk::USControlInterfaceBMode::SetScanningPower(), and mitk::USControlInterfaceBMode::SetScanningRejection().
|
virtual |
|
protected |
Definition at line 653 of file mitkUSDevice.cpp.
References GetIsActive().
Referenced by Activate(), ConstructServiceProperties(), and Deactivate().
unsigned int mitk::USDevice::GetSizeOfImageVector | ( | ) |
Definition at line 41 of file mitkUSDevice.cpp.
References m_ImageVector.
|
virtual |
|
pure virtual |
Implemented in mitk::USDiPhASDevice, mitk::USTelemedDevice, mitk::USVideoDevice, and mitk::USIGTLDevice.
Referenced by GrabImage(), PushFilter(), PushFilterIfNotPushedBefore(), and RemoveFilter().
void mitk::USDevice::GrabImage | ( | ) |
mitk::Image* mitk::USDevice::GetOutput() { if (this->GetNumberOfOutputs() < 1) return nullptr;
return static_cast<USImage*>(this->ProcessObject::GetPrimaryOutput()); }
mitk::Image* mitk::USDevice::GetOutput(unsigned int idx) { if (this->GetNumberOfOutputs() < 1) return nullptr; return static_cast<USImage*>(this->ProcessObject::GetOutput(idx)); }
void mitk::USDevice::GraftOutput(itk::DataObject *graft) { this->GraftNthOutput(0, graft); }
void mitk::USDevice::GraftNthOutput(unsigned int idx, itk::DataObject *graft) { if ( idx >= this->GetNumberOfOutputs() ) { itkExceptionMacro(<<"Requested to graft output " << idx << " but this filter only has " << this->GetNumberOfOutputs() << " Outputs."); }
if ( !graft ) { itkExceptionMacro(<<"Requested to graft output with a nullptr pointer object" ); }
itk::DataObject* output = this->GetOutput(idx); if ( !output ) { itkExceptionMacro(<<"Requested to graft output that is a nullptr pointer" ); } Call Graft on USImage to copy member data output->Graft( graft ); }
Definition at line 569 of file mitkUSDevice.cpp.
References GetUSImageSource(), image, m_ImageMutex, and SetImageVector().
Referenced by Acquire().
bool mitk::USDevice::Initialize | ( | ) |
Changes device state to mitk::USDevice::State_Initialized. During initialization the virtual method mitk::USDevice::OnInitialization will be called. If this method returns false the initialization process will be canceled. Otherwise the mitk::USDevice is registered in a micro service.
Definition at line 242 of file mitkUSDevice.cpp.
References ConstructServiceProperties(), us::GetModuleContext(), m_DeviceState, m_ServiceRegistration, OnInitialization(), and State_Initialized.
mitk::USDevice::mitkClassMacro | ( | USDevice | , |
mitk::ImageSource | |||
) |
mitk::USDevice::mitkNewMessage2Macro | ( | PropertyChanged | , |
const std::string & | , | ||
const std::string & | |||
) |
Event for being notified about changes of the micro service properties. This event can be used if no micro service context is available.
|
protectedpure virtual |
Is called during the activation process. After this method is finished, the device should be generating images. If it returns false, the activation process will be canceled.
mitk::Exception | implementation may throw an exception to clarify what went wrong |
Implemented in mitk::USVideoDevice, mitk::USIGTLDevice, mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Referenced by Activate().
|
protectedpure virtual |
Is called during the connection process. Override this method in a subclass to handle the actual connection. If it returns false, the connection process will be canceled.
mitk::Exception | implementation may throw an exception to clarify what went wrong |
Implemented in mitk::USVideoDevice, mitk::USIGTLDevice, mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Referenced by Connect().
|
protectedpure virtual |
Is called during the deactivation process. After a call to this method the device should still be connected, but not producing images anymore.
mitk::Exception | implementation may throw an exception to clarify what went wrong |
Implemented in mitk::USVideoDevice, mitk::USIGTLDevice, mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Referenced by Deactivate().
|
protectedpure virtual |
Is called during the disconnection process. Override this method in a subclass to handle the actual disconnection. If it returns false, the disconnection process will be canceled.
mitk::Exception | implementation may throw an exception to clarify what went wrong |
Implemented in mitk::USVideoDevice, mitk::USIGTLDevice, mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Referenced by Disconnect().
|
inlineprotectedvirtual |
Called when mitk::USDevice::SetIsFreezed() is called. Subclasses can overwrite this method to do additional actions. Default implementation does noting.
Reimplemented in mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Definition at line 480 of file mitkUSDevice.h.
Referenced by SetIsFreezed().
|
protectedpure virtual |
Is called during the initialization process. Override this method in a subclass to handle the actual initialization. If it returns false, the initialization process will be canceled.
mitk::Exception | implementation may throw an exception to clarify what went wrong |
Implemented in mitk::USVideoDevice, mitk::USIGTLDevice, mitk::USDiPhASDevice, and mitk::USTelemedDevice.
Referenced by Initialize().
void mitk::USDevice::ProbeChanged | ( | std::string | probename | ) |
To be called when the used probe changed. Will update the service properties.
probename | of the now used probe |
Definition at line 705 of file mitkUSDevice.cpp.
References GetPropertyKeys(), and UpdateServiceProperty().
Referenced by mitk::USIGTLDevice::SetDefaultProbeAsCurrentProbe(), and mitk::USVideoDevice::SetDefaultProbeAsCurrentProbe().
|
protected |
Registers an OpenIGTLink device as a microservice so that we can send the images of this device via the network.
Definition at line 359 of file mitkUSDevice.cpp.
References GetName(), m_IGTLMessageProvider, m_IGTLServer, m_ImageToIGTLMsgFilter, mitk::ImageToIGTLMessageFilter::New(), and mitk::IGTLMessageProvider::New().
Referenced by Activate().
void mitk::USDevice::PushFilter | ( | AbstractOpenCVImageFilter::Pointer | filter | ) |
Definition at line 462 of file mitkUSDevice.cpp.
References GetUSImageSource(), MITK_ERROR, and mitkThrow.
void mitk::USDevice::PushFilterIfNotPushedBefore | ( | AbstractOpenCVImageFilter::Pointer | filter | ) |
Definition at line 474 of file mitkUSDevice.cpp.
References GetUSImageSource(), MITK_ERROR, and mitkThrow.
bool mitk::USDevice::RemoveFilter | ( | AbstractOpenCVImageFilter::Pointer | filter | ) |
Definition at line 490 of file mitkUSDevice.cpp.
References GetUSImageSource(), MITK_ERROR, and mitkThrow.
|
inlinevirtual |
Removes the Probe with the given name.
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 350 of file mitkUSDevice.h.
void mitk::USDevice::SetComment | ( | std::string | comment | ) |
Definition at line 184 of file mitkUSDevice.cpp.
References GetPropertyKeys(), m_DeviceState, State_Initialized, and UpdateServiceProperty().
|
inlinevirtual |
Sets the probe with the given name as current probe if the named probe exists.
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 361 of file mitkUSDevice.h.
|
inlinevirtual |
Sets the first existing probe or the default probe of the ultrasound device as the current probe of it.
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 356 of file mitkUSDevice.h.
|
inlineprotectedvirtual |
Definition at line 374 of file mitkUSDevice.h.
Referenced by GrabImage().
|
virtual |
Can toggle if ultrasound image is currently updated or freezed.
freeze | true to stop updating the ultrasound image, false to start updating again |
Definition at line 424 of file mitkUSDevice.cpp.
References GetIsActive(), m_FreezeBarrier, m_IsFreezed, MITK_WARN, and OnFreeze().
void mitk::USDevice::SetManufacturer | ( | std::string | manufacturer | ) |
Definition at line 163 of file mitkUSDevice.cpp.
References GetPropertyKeys(), m_DeviceState, State_Initialized, and UpdateServiceProperty().
void mitk::USDevice::SetName | ( | std::string | name | ) |
Definition at line 174 of file mitkUSDevice.cpp.
References GetPropertyKeys(), m_DeviceState, State_Initialized, and UpdateServiceProperty().
|
virtual |
Reimplemented in mitk::USVideoDevice, and mitk::USIGTLDevice.
Definition at line 597 of file mitkUSDevice.cpp.
References image, m_ImageVector, m_Spacing, and MITK_INFO.
|
virtual |
|
protected |
Remove this device from the micro service.
Definition at line 229 of file mitkUSDevice.cpp.
References m_ServiceRegistration, and us::ServiceRegistrationBase::Unregister().
Referenced by mitk::USIGTLDevice::UnregisterOnService(), mitk::USVideoDevice::UnregisterOnService(), and ~USDevice().
void mitk::USDevice::UpdateServiceProperty | ( | std::string | key, |
std::string | value | ||
) |
Given property is updated in the device micro service. This method is mainly for being used by the control interface superclasses. You do not need to call it by yoursefs in your concrete control interface classes.
Definition at line 502 of file mitkUSDevice.cpp.
References m_ServiceProperties, m_ServiceRegistration, and us::ServiceRegistrationBase::SetProperties().
Referenced by Activate(), Connect(), Deactivate(), DepthChanged(), Disconnect(), ProbeChanged(), SetComment(), SetManufacturer(), SetName(), and UpdateServiceProperty().
void mitk::USDevice::UpdateServiceProperty | ( | std::string | key, |
double | value | ||
) |
Definition at line 511 of file mitkUSDevice.cpp.
References UpdateServiceProperty().
void mitk::USDevice::UpdateServiceProperty | ( | std::string | key, |
bool | value | ||
) |
Definition at line 518 of file mitkUSDevice.cpp.
References UpdateServiceProperty().
|
protected |
Definition at line 411 of file mitkUSDevice.h.
Referenced by GetCropArea(), and USDevice().
|
protected |
Definition at line 408 of file mitkUSDevice.h.
Referenced by Activate(), Connect(), Deactivate(), Disconnect(), GetIsActive(), GetIsConnected(), GetIsInitialized(), Initialize(), mitk::USVideoDevice::OnDisconnection(), SetComment(), SetManufacturer(), SetName(), and mitk::USVideoDevice::UnregisterOnService().
|
protected |
Definition at line 368 of file mitkUSDevice.h.
Referenced by Acquire(), Activate(), and SetIsFreezed().
|
protected |
Definition at line 369 of file mitkUSDevice.h.
Referenced by Acquire().
|
protected |
Definition at line 403 of file mitkUSDevice.h.
Referenced by DisableOIGTL(), and ProvideViaOIGTL().
|
protected |
Definition at line 402 of file mitkUSDevice.h.
Referenced by DisableOIGTL(), and ProvideViaOIGTL().
|
protected |
mutex for images provided by the image source
Definition at line 371 of file mitkUSDevice.h.
Referenced by mitk::USIGTLDevice::GenerateData(), mitk::USVideoDevice::GenerateData(), GenerateData(), and GrabImage().
|
protected |
Definition at line 404 of file mitkUSDevice.h.
Referenced by DisableOIGTL(), and ProvideViaOIGTL().
|
protected |
Definition at line 386 of file mitkUSDevice.h.
Referenced by mitk::USIGTLDevice::GenerateData(), mitk::USVideoDevice::GenerateData(), GenerateData(), GetSizeOfImageVector(), and SetSpacing().
|
protected |
Definition at line 406 of file mitkUSDevice.h.
Referenced by Acquire(), GetIsFreezed(), and SetIsFreezed().
|
protected |
itk::MultiThreader used for thread handling
Definition at line 370 of file mitkUSDevice.h.
Referenced by Activate(), ConnectAsynchron(), and ~USDevice().
|
protected |
Definition at line 503 of file mitkUSDevice.h.
Referenced by USDevice(), and mitk::USDiPhASDevice::USDiPhASDevice().
|
protected |
Properties of the device's Microservice.
Definition at line 508 of file mitkUSDevice.h.
Referenced by ConstructServiceProperties(), and UpdateServiceProperty().
|
protected |
The device's ServiceRegistration object that allows to modify it's Microservice registraton details.
Definition at line 513 of file mitkUSDevice.h.
Referenced by Initialize(), UnregisterOnService(), and UpdateServiceProperty().
|
protected |
Definition at line 389 of file mitkUSDevice.h.
Referenced by SetSpacing().
|
protected |
ID of the started thread.
Definition at line 372 of file mitkUSDevice.h.
Referenced by Activate(), and ~USDevice().