Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
mitk::USDiPhASDevice Class Reference

#include <mitkUSDiPhASDevice.h>

Inheritance diagram for mitk::USDiPhASDevice:
Collaboration diagram for mitk::USDiPhASDevice:

Public Member Functions

 mitkClassMacro (USDiPhASDevice, mitk::USDevice)
 
 mitkNewMacro2Param (Self, std::string, std::string)
 
virtual std::string GetDeviceClass ()
 Returns the class of the device. More...
 
virtual USControlInterfaceProbes::Pointer 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< USAbstractControlInterfaceGetControlInterfaceCustom ()
 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 bool OnInitialization ()
 Is called during the initialization process. There is nothing done on the initialization of a mik::USDiPhASDevive object. More...
 
virtual bool OnConnection ()
 Is called during the connection process. Connect to the DiPhAS API. More...
 
virtual bool OnDisconnection ()
 Is called during the disconnection process. Deactivate and remove all DiPhAS API controls. A disconnect from the DiPhAS API is not possible for which reason the hardware stays in connected state even after calling this method. More...
 
virtual bool OnActivation ()
 Is called during the activation process. After this method is finished, the device is generating images in b mode. Changing scanning mode is possible afterwards by using the appropriate control interfaces. More...
 
virtual bool OnDeactivation ()
 Is called during the deactivation process. After a call to this method the device is connected, but not producing images anymore. More...
 
virtual void OnFreeze (bool freeze)
 Changes scan state of the device if freeze is toggeled in mitk::USDevice. More...
 
USImageSource::Pointer GetUSImageSource ()
 
ScanModeNative & GetScanMode ()
 
void UpdateScanmode ()
 
void MessageCallback (const char *message)
 
void SetBursts (int bursts)
 
void SetInterleaved (bool interleaved)
 
bool IsInterleaved ()
 
- Public Member Functions inherited from mitk::USDevice
 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< USControlInterfaceBModeGetControlInterfaceBMode ()
 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< USControlInterfaceDopplerGetControlInterfaceDoppler ()
 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)
 
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 ()
 
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)
 
- Public Member Functions inherited from mitk::ImageSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (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
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (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...
 

Public Attributes

BeamformingParametersInterleaved_OA_US paramsInterleaved
 
BeamformingParametersPlaneWaveCompound paramsPlaneWave
 

Protected Member Functions

 USDiPhASDevice (std::string manufacturer, std::string model)
 
virtual ~USDiPhASDevice ()
 
void InitializeScanMode ()
 
void UpdateTransmitEvents ()
 
- Protected Member Functions inherited from mitk::USDevice
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...
 
 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 ()
 
- Protected Member Functions inherited from mitk::ImageSource
 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...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Protected Attributes

USDiPhASProbesControls::Pointer m_ControlsProbes
 
itk::SmartPointer< USAbstractControlInterfacem_ControlInterfaceCustom
 
mitk::USDiPhASImageSource::Pointer m_ImageSource
 
bool m_IsRunning
 
ScanModeNative m_ScanMode
 
int m_BurstHalfwaveClockCount
 
Beamforming m_CurrentBeamformingAlgorithm
 
bool m_Interleaved
 
- Protected Attributes inherited from mitk::USDevice
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::Pointerm_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< Selfm_ServiceRegistration
 The device's ServiceRegistration object that allows to modify it's Microservice registraton details. More...
 

Additional Inherited Members

- Public Types inherited from mitk::USDevice
enum  DeviceStates { State_NoState, State_Initialized, State_Connected, State_Activated }
 
- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- Static Public Member Functions inherited from mitk::USDevice
static mitk::USDevice::PropertyKeys GetPropertyKeys ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 
- Static Protected Member Functions inherited from mitk::USDevice
static ITK_THREAD_RETURN_TYPE Acquire (void *pInfoStruct)
 
static ITK_THREAD_RETURN_TYPE ConnectThread (void *pInfoStruct)
 
- Static Protected Member Functions inherited from mitk::ImageSource
static ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Definition at line 46 of file mitkUSDiPhASDevice.h.

Constructor & Destructor Documentation

◆ USDiPhASDevice()

mitk::USDiPhASDevice::USDiPhASDevice ( std::string  manufacturer,
std::string  model 
)
protected

Constructs a mitk::USDiPhASDevice object by given manufacturer and model string. These strings are just for labeling the device in the micro service.

Control interfaces and image source are available directly after construction. Registration at the micro service happens not before initialization method was called.

◆ ~USDiPhASDevice()

virtual mitk::USDiPhASDevice::~USDiPhASDevice ( )
protectedvirtual

Member Function Documentation

◆ GetControlInterfaceCustom()

virtual itk::SmartPointer<USAbstractControlInterface> mitk::USDiPhASDevice::GetControlInterfaceCustom ( )
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.

Returns
null pointer

Reimplemented from mitk::USDevice.

◆ GetControlInterfaceProbes()

virtual USControlInterfaceProbes::Pointer mitk::USDiPhASDevice::GetControlInterfaceProbes ( )
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.

Returns
null pointer

Reimplemented from mitk::USDevice.

◆ GetDeviceClass()

virtual std::string mitk::USDiPhASDevice::GetDeviceClass ( )
virtual

Returns the class of the device.

Implements mitk::USDevice.

◆ GetScanMode()

ScanModeNative& mitk::USDiPhASDevice::GetScanMode ( )
Returns
Returns the currently used scanmode of this device

◆ GetUSImageSource()

USImageSource::Pointer mitk::USDiPhASDevice::GetUSImageSource ( )
virtual
Returns
Returns the current image source of this device.

Implements mitk::USDevice.

◆ InitializeScanMode()

void mitk::USDiPhASDevice::InitializeScanMode ( )
protected

The DiPhAS API expects callback functions to pass both status messages and the processed images to the user. The message callback is here, the data itself is given directly to the image source. This method sets up the scanmode at the begining

◆ IsInterleaved()

bool mitk::USDiPhASDevice::IsInterleaved ( )

◆ MessageCallback()

void mitk::USDiPhASDevice::MessageCallback ( const char *  message)

This method forwards messages from the API to the user

◆ mitkClassMacro()

mitk::USDiPhASDevice::mitkClassMacro ( USDiPhASDevice  ,
mitk::USDevice   
)

◆ mitkNewMacro2Param()

mitk::USDiPhASDevice::mitkNewMacro2Param ( Self  ,
std::string  ,
std::string   
)

◆ OnActivation()

virtual bool mitk::USDiPhASDevice::OnActivation ( )
virtual

Is called during the activation process. After this method is finished, the device is generating images in b mode. Changing scanning mode is possible afterwards by using the appropriate control interfaces.

Returns
always true
Exceptions
mitk::Exceptionif something goes wrong at the API calls

Implements mitk::USDevice.

◆ OnConnection()

virtual bool mitk::USDiPhASDevice::OnConnection ( )
virtual

Is called during the connection process. Connect to the DiPhAS API.

Returns
true if successfull, false if no device is connected to the pc
Exceptions
mitk::Exceptionif something goes wrong at the API calls

Implements mitk::USDevice.

◆ OnDeactivation()

virtual bool mitk::USDiPhASDevice::OnDeactivation ( )
virtual

Is called during the deactivation process. After a call to this method the device is connected, but not producing images anymore.

Returns
always true
Exceptions
mitk::Exceptionif something goes wrong at the API calls

Implements mitk::USDevice.

◆ OnDisconnection()

virtual bool mitk::USDiPhASDevice::OnDisconnection ( )
virtual

Is called during the disconnection process. Deactivate and remove all DiPhAS API controls. A disconnect from the DiPhAS API is not possible for which reason the hardware stays in connected state even after calling this method.

Returns
always true
Exceptions
mitk::Exceptionif something goes wrong at the API calls

Implements mitk::USDevice.

◆ OnFreeze()

virtual void mitk::USDiPhASDevice::OnFreeze ( bool  freeze)
virtual

Changes scan state of the device if freeze is toggeled in mitk::USDevice.

Reimplemented from mitk::USDevice.

◆ OnInitialization()

virtual bool mitk::USDiPhASDevice::OnInitialization ( )
virtual

Is called during the initialization process. There is nothing done on the initialization of a mik::USDiPhASDevive object.

Returns
always true

Implements mitk::USDevice.

◆ SetBursts()

void mitk::USDiPhASDevice::SetBursts ( int  bursts)

◆ SetInterleaved()

void mitk::USDiPhASDevice::SetInterleaved ( bool  interleaved)

◆ UpdateScanmode()

void mitk::USDiPhASDevice::UpdateScanmode ( )

Updates the Scanmode and feeds it to the hardware

◆ UpdateTransmitEvents()

void mitk::USDiPhASDevice::UpdateTransmitEvents ( )
protected

Member Data Documentation

◆ m_BurstHalfwaveClockCount

int mitk::USDiPhASDevice::m_BurstHalfwaveClockCount
protected

Definition at line 163 of file mitkUSDiPhASDevice.h.

◆ m_ControlInterfaceCustom

itk::SmartPointer<USAbstractControlInterface> mitk::USDiPhASDevice::m_ControlInterfaceCustom
protected

Definition at line 157 of file mitkUSDiPhASDevice.h.

◆ m_ControlsProbes

USDiPhASProbesControls::Pointer mitk::USDiPhASDevice::m_ControlsProbes
protected

Definition at line 156 of file mitkUSDiPhASDevice.h.

◆ m_CurrentBeamformingAlgorithm

Beamforming mitk::USDiPhASDevice::m_CurrentBeamformingAlgorithm
protected

Definition at line 164 of file mitkUSDiPhASDevice.h.

◆ m_ImageSource

mitk::USDiPhASImageSource::Pointer mitk::USDiPhASDevice::m_ImageSource
protected

Definition at line 159 of file mitkUSDiPhASDevice.h.

◆ m_Interleaved

bool mitk::USDiPhASDevice::m_Interleaved
protected

Definition at line 165 of file mitkUSDiPhASDevice.h.

◆ m_IsRunning

bool mitk::USDiPhASDevice::m_IsRunning
protected

Definition at line 161 of file mitkUSDiPhASDevice.h.

◆ m_ScanMode

ScanModeNative mitk::USDiPhASDevice::m_ScanMode
protected

Definition at line 162 of file mitkUSDiPhASDevice.h.

◆ paramsInterleaved

BeamformingParametersInterleaved_OA_US mitk::USDiPhASDevice::paramsInterleaved

Definition at line 128 of file mitkUSDiPhASDevice.h.

◆ paramsPlaneWave

BeamformingParametersPlaneWaveCompound mitk::USDiPhASDevice::paramsPlaneWave

Definition at line 129 of file mitkUSDiPhASDevice.h.


The documentation for this class was generated from the following file: