PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
vtkPlusOpenIGTLinkServer Class Reference

This class provides a network interface for data acquired by Plus as an OpenIGTLink server. More...

#include <src/PlusServer/vtkPlusOpenIGTLinkServer.h>

Inheritance diagram for vtkPlusOpenIGTLinkServer:
Inheritance graph
[legend]
Collaboration diagram for vtkPlusOpenIGTLinkServer:
Collaboration graph
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual PlusStatus GetClientInfo (unsigned int clientId, PlusIgtlClientInfo &outClientInfo) const
 
virtual int GetIGTLHeaderVersion ()
 
virtual int GetIGTLProtocolVersion ()
 
virtual unsigned int GetNumberOfConnectedClients () const
 
virtual int IsA (const char *type)
 
virtual void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
int ProcessPendingCommands ()
 
virtual PlusStatus ReadConfiguration (vtkXMLDataElement *serverElement, const std::string &aFilename)
 
virtual void SetDataCollector (vtkPlusDataCollector *)
 
virtual void SetDefaultClientReceiveTimeoutSec (float)
 
virtual void SetDefaultClientSendTimeoutSec (float)
 
virtual void SetListeningPort (int)
 
virtual void SetMaxTimeSpentWithProcessingMs (double)
 
virtual void SetMissingInputGracePeriodSec (double)
 
virtual void SetSendValidTransformsOnly (bool)
 
virtual void SetTransformRepository (vtkIGSIOTransformRepository *)
 
PlusStatus Start (vtkPlusDataCollector *dataCollector, vtkIGSIOTransformRepository *transformRepository, vtkXMLDataElement *serverElement, const std::string &configFilePath)
 
PlusStatus StartOpenIGTLinkService ()
 
PlusStatus Stop ()
 
PlusStatus StopOpenIGTLinkService ()
 
 vtkGetMacroConst (ListeningPort, int)
 
 vtkGetMacroConst (MissingInputGracePeriodSec, double)
 
 vtkGetMacroConst (MaxTimeSpentWithProcessingMs, double)
 
 vtkGetMacroConst (SendValidTransformsOnly, bool)
 
 vtkGetMacroConst (DefaultClientSendTimeoutSec, float)
 
 vtkGetMacroConst (DefaultClientReceiveTimeoutSec, float)
 
 vtkGetMacroConst (DataCollector, vtkPlusDataCollector *)
 
 vtkGetMacroConst (TransformRepository, vtkIGSIOTransformRepository *)
 
 vtkGetStdStringMacro (OutputChannelId)
 
 vtkGetStdStringMacro (ConfigFilename)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkPlusOpenIGTLinkServerNew ()
 
static vtkPlusOpenIGTLinkServerSafeDownCast (vtkObject *o)
 

Protected Member Functions

igtl::MessageBase::Pointer CreateIgtlMessageFromCommandResponse (vtkPlusCommandResponse *response)
 
void DisconnectClient (int clientId)
 
bool HasGracePeriodExpired ()
 
virtual void KeepAlive ()
 
PlusStatus QueueMessageResponseForClient (int clientId, igtl::MessageBase::Pointer message)
 
virtual PlusStatus SendTrackedFrame (igsioTrackedFrame &trackedFrame)
 
virtual void SetDelayBetweenRetryAttemptsSec (double)
 
virtual void SetIgtlMessageCrcCheckEnabled (bool)
 
virtual void SetKeepAliveIntervalSec (double)
 
virtual void SetLogWarningOnNoDataAvailable (bool)
 
virtual void SetMaxNumberOfIgtlMessagesToSend (int)
 
virtual void SetNumberOfRetryAttempts (int)
 
 vtkGetMacroConst (IgtlMessageCrcCheckEnabled, bool)
 
 vtkGetMacroConst (LogWarningOnNoDataAvailable, bool)
 
 vtkGetMacroConst (MaxNumberOfIgtlMessagesToSend, int)
 
 vtkGetMacroConst (NumberOfRetryAttempts, int)
 
 vtkGetMacroConst (DelayBetweenRetryAttemptsSec, double)
 
 vtkGetMacroConst (KeepAliveIntervalSec, double)
 
 vtkPlusOpenIGTLinkServer ()
 
 vtkSetStdStringMacro (OutputChannelId)
 
 vtkSetStdStringMacro (ConfigFilename)
 
virtual ~vtkPlusOpenIGTLinkServer ()
 

Static Protected Member Functions

static void * ConnectionReceiverThread (vtkMultiThreader::ThreadInfo *data)
 
static void * DataReceiverThread (vtkMultiThreader::ThreadInfo *data)
 
static void * DataSenderThread (vtkMultiThreader::ThreadInfo *data)
 
static PlusStatus SendCommandResponses (vtkPlusOpenIGTLinkServer &self)
 
static PlusStatus SendLatestFramesToClients (vtkPlusOpenIGTLinkServer &self, double &elapsedTimeSinceLastPacketSentSec)
 
static PlusStatus SendMessageResponses (vtkPlusOpenIGTLinkServer &self)
 

Detailed Description

This class provides a network interface for data acquired by Plus as an OpenIGTLink server.

As soon as a client connects to the server, the server start streaming those image and tracking information that are defined in the server's default client information (DefaultClientInfo element in the device set configuration file).

A connected client any time can change what information the server sends to it by sending a CLIENTINFO message. The CLIENTINFO message is encoded the same way as an OpenIGTLink STRING message, the only difference is that the message type is CLIENTINFO (implemented in igtl::PlusClientInfoMessage). The contents of the message is an XML string, describing the requested image and tracking information in the same format as in the DefaultClientInfo element in the device set configuration file.

Definition at line 88 of file vtkPlusOpenIGTLinkServer.h.

Member Typedef Documentation

◆ Superclass

Definition at line 94 of file vtkPlusOpenIGTLinkServer.h.

Constructor & Destructor Documentation

◆ vtkPlusOpenIGTLinkServer()

vtkPlusOpenIGTLinkServer::vtkPlusOpenIGTLinkServer ( )
protected

Definition at line 79 of file vtkPlusOpenIGTLinkServer.cxx.

◆ ~vtkPlusOpenIGTLinkServer()

vtkPlusOpenIGTLinkServer::~vtkPlusOpenIGTLinkServer ( )
protectedvirtual

Definition at line 115 of file vtkPlusOpenIGTLinkServer.cxx.

Member Function Documentation

◆ ConnectionReceiverThread()

void * vtkPlusOpenIGTLinkServer::ConnectionReceiverThread ( vtkMultiThreader::ThreadInfo *  data)
staticprotected

Thread for client connection handling

Definition at line 237 of file vtkPlusOpenIGTLinkServer.cxx.

◆ CreateIgtlMessageFromCommandResponse()

igtl::MessageBase::Pointer vtkPlusOpenIGTLinkServer::CreateIgtlMessageFromCommandResponse ( vtkPlusCommandResponse response)
protected

Converts a command response to an OpenIGTLink message that can be sent to the client

Definition at line 1363 of file vtkPlusOpenIGTLinkServer.cxx.

◆ DataReceiverThread()

void * vtkPlusOpenIGTLinkServer::DataReceiverThread ( vtkMultiThreader::ThreadInfo *  data)
staticprotected

Thread for receiving control data from clients

Store the IDs of recent commands to be able to detect duplicate command IDs

Definition at line 573 of file vtkPlusOpenIGTLinkServer.cxx.

◆ DataSenderThread()

void * vtkPlusOpenIGTLinkServer::DataSenderThread ( vtkMultiThreader::ThreadInfo *  data)
staticprotected

Thread for sending data to clients

Definition at line 318 of file vtkPlusOpenIGTLinkServer.cxx.

◆ DisconnectClient()

void vtkPlusOpenIGTLinkServer::DisconnectClient ( int  clientId)
protected

Stops client's data receiving thread, closes the socket, and removes the client from the client list

Definition at line 1111 of file vtkPlusOpenIGTLinkServer.cxx.

◆ GetClassName()

virtual const char* vtkPlusOpenIGTLinkServer::GetClassName ( )
virtual

◆ GetClientInfo()

PlusStatus vtkPlusOpenIGTLinkServer::GetClientInfo ( unsigned int  clientId,
PlusIgtlClientInfo outClientInfo 
) const
virtual

Retrieve a COPY of client info for a given clientId Locks access to the client info for the duration of the function

Definition at line 1245 of file vtkPlusOpenIGTLinkServer.cxx.

◆ GetIGTLHeaderVersion()

virtual int vtkPlusOpenIGTLinkServer::GetIGTLHeaderVersion ( )
virtual

◆ GetIGTLProtocolVersion()

virtual int vtkPlusOpenIGTLinkServer::GetIGTLProtocolVersion ( )
virtual

◆ GetNumberOfConnectedClients()

unsigned int vtkPlusOpenIGTLinkServer::GetNumberOfConnectedClients ( ) const
virtual

Get number of connected clients

Definition at line 1237 of file vtkPlusOpenIGTLinkServer.cxx.

◆ HasGracePeriodExpired()

bool vtkPlusOpenIGTLinkServer::HasGracePeriodExpired ( )
protected

Definition at line 1314 of file vtkPlusOpenIGTLinkServer.cxx.

◆ IsA()

virtual int vtkPlusOpenIGTLinkServer::IsA ( const char *  type)
virtual

◆ IsTypeOf()

static int vtkPlusOpenIGTLinkServer::IsTypeOf ( const char *  type)
static

◆ KeepAlive()

void vtkPlusOpenIGTLinkServer::KeepAlive ( )
protectedvirtual

Send status message to clients to keep alive the connection

Definition at line 1197 of file vtkPlusOpenIGTLinkServer.cxx.

◆ New()

static vtkPlusOpenIGTLinkServer* vtkPlusOpenIGTLinkServer::New ( )
static

◆ PrintSelf()

void vtkPlusOpenIGTLinkServer::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Definition at line 152 of file vtkPlusOpenIGTLinkServer.cxx.

◆ ProcessPendingCommands()

int vtkPlusOpenIGTLinkServer::ProcessPendingCommands ( )

Execute all commands in the queue from the current thread (useful if commands should be executed from the main thread)

Returns
Number of executed commands

Definition at line 1308 of file vtkPlusOpenIGTLinkServer.cxx.

◆ QueueMessageResponseForClient()

PlusStatus vtkPlusOpenIGTLinkServer::QueueMessageResponseForClient ( int  clientId,
igtl::MessageBase::Pointer  message 
)
protected

Add a response to the queue for sending to the client

Definition at line 124 of file vtkPlusOpenIGTLinkServer.cxx.

◆ ReadConfiguration()

PlusStatus vtkPlusOpenIGTLinkServer::ReadConfiguration ( vtkXMLDataElement *  serverElement,
const std::string &  aFilename 
)
virtual

Read the configuration file in XML format and set up the devices

Definition at line 1261 of file vtkPlusOpenIGTLinkServer.cxx.

◆ SafeDownCast()

static vtkPlusOpenIGTLinkServer* vtkPlusOpenIGTLinkServer::SafeDownCast ( vtkObject *  o)
static

◆ SendCommandResponses()

PlusStatus vtkPlusOpenIGTLinkServer::SendCommandResponses ( vtkPlusOpenIGTLinkServer self)
staticprotected

Process the command replies queue and send messages

Definition at line 531 of file vtkPlusOpenIGTLinkServer.cxx.

◆ SendLatestFramesToClients()

PlusStatus vtkPlusOpenIGTLinkServer::SendLatestFramesToClients ( vtkPlusOpenIGTLinkServer self,
double &  elapsedTimeSinceLastPacketSentSec 
)
staticprotected

Attempt to send any unsent frames to clients, if unsuccessful, accumulate an elapsed time

Definition at line 416 of file vtkPlusOpenIGTLinkServer.cxx.

◆ SendMessageResponses()

PlusStatus vtkPlusOpenIGTLinkServer::SendMessageResponses ( vtkPlusOpenIGTLinkServer self)
staticprotected

Process the message replies queue and send messages

Definition at line 495 of file vtkPlusOpenIGTLinkServer.cxx.

◆ SendTrackedFrame()

PlusStatus vtkPlusOpenIGTLinkServer::SendTrackedFrame ( igsioTrackedFrame &  trackedFrame)
protectedvirtual

Tracked frame interface, sends the selected message type and data to all clients

Definition at line 1018 of file vtkPlusOpenIGTLinkServer.cxx.

◆ SetDataCollector()

virtual void vtkPlusOpenIGTLinkServer::SetDataCollector ( vtkPlusDataCollector )
virtual

Set data collector instance

◆ SetDefaultClientReceiveTimeoutSec()

virtual void vtkPlusOpenIGTLinkServer::SetDefaultClientReceiveTimeoutSec ( float  )
virtual

◆ SetDefaultClientSendTimeoutSec()

virtual void vtkPlusOpenIGTLinkServer::SetDefaultClientSendTimeoutSec ( float  )
virtual

◆ SetDelayBetweenRetryAttemptsSec()

virtual void vtkPlusOpenIGTLinkServer::SetDelayBetweenRetryAttemptsSec ( double  )
protectedvirtual

◆ SetIgtlMessageCrcCheckEnabled()

virtual void vtkPlusOpenIGTLinkServer::SetIgtlMessageCrcCheckEnabled ( bool  )
protectedvirtual

Set IGTL CRC check flag (0: disabled, 1: enabled)

◆ SetKeepAliveIntervalSec()

virtual void vtkPlusOpenIGTLinkServer::SetKeepAliveIntervalSec ( double  )
protectedvirtual

◆ SetListeningPort()

virtual void vtkPlusOpenIGTLinkServer::SetListeningPort ( int  )
virtual

Set server listening port

◆ SetLogWarningOnNoDataAvailable()

virtual void vtkPlusOpenIGTLinkServer::SetLogWarningOnNoDataAvailable ( bool  )
protectedvirtual

◆ SetMaxNumberOfIgtlMessagesToSend()

virtual void vtkPlusOpenIGTLinkServer::SetMaxNumberOfIgtlMessagesToSend ( int  )
protectedvirtual

◆ SetMaxTimeSpentWithProcessingMs()

virtual void vtkPlusOpenIGTLinkServer::SetMaxTimeSpentWithProcessingMs ( double  )
virtual

◆ SetMissingInputGracePeriodSec()

virtual void vtkPlusOpenIGTLinkServer::SetMissingInputGracePeriodSec ( double  )
virtual

◆ SetNumberOfRetryAttempts()

virtual void vtkPlusOpenIGTLinkServer::SetNumberOfRetryAttempts ( int  )
protectedvirtual

◆ SetSendValidTransformsOnly()

virtual void vtkPlusOpenIGTLinkServer::SetSendValidTransformsOnly ( bool  )
virtual

◆ SetTransformRepository()

virtual void vtkPlusOpenIGTLinkServer::SetTransformRepository ( vtkIGSIOTransformRepository *  )
virtual

Set transform repository instance

◆ Start()

PlusStatus vtkPlusOpenIGTLinkServer::Start ( vtkPlusDataCollector dataCollector,
vtkIGSIOTransformRepository *  transformRepository,
vtkXMLDataElement *  serverElement,
const std::string &  configFilePath 
)

Configures and starts the server from the provided PlusOpenIGTLinkServer XML element

Definition at line 1320 of file vtkPlusOpenIGTLinkServer.cxx.

◆ StartOpenIGTLinkService()

PlusStatus vtkPlusOpenIGTLinkServer::StartOpenIGTLinkService ( )

Start server

Definition at line 158 of file vtkPlusOpenIGTLinkServer.cxx.

◆ Stop()

PlusStatus vtkPlusOpenIGTLinkServer::Stop ( )

Configures and starts the server from the provided device set configuration file

Definition at line 1346 of file vtkPlusOpenIGTLinkServer.cxx.

◆ StopOpenIGTLinkService()

PlusStatus vtkPlusOpenIGTLinkServer::StopOpenIGTLinkService ( )

Stop server

Definition at line 201 of file vtkPlusOpenIGTLinkServer.cxx.

◆ vtkGetMacroConst() [1/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( ListeningPort  ,
int   
)

Get server listening port

◆ vtkGetMacroConst() [2/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( MissingInputGracePeriodSec  ,
double   
)

◆ vtkGetMacroConst() [3/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( MaxTimeSpentWithProcessingMs  ,
double   
)

◆ vtkGetMacroConst() [4/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( SendValidTransformsOnly  ,
bool   
)

◆ vtkGetMacroConst() [5/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( DefaultClientSendTimeoutSec  ,
float   
)

◆ vtkGetMacroConst() [6/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( DefaultClientReceiveTimeoutSec  ,
float   
)

◆ vtkGetMacroConst() [7/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( DataCollector  ,
vtkPlusDataCollector  
)

◆ vtkGetMacroConst() [8/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( TransformRepository  ,
vtkIGSIOTransformRepository *   
)

◆ vtkGetMacroConst() [9/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( IgtlMessageCrcCheckEnabled  ,
bool   
)
protected

Get IGTL CRC check flag (0: disabled, 1: enabled)

◆ vtkGetMacroConst() [10/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( LogWarningOnNoDataAvailable  ,
bool   
)
protected

◆ vtkGetMacroConst() [11/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( MaxNumberOfIgtlMessagesToSend  ,
int   
)
protected

◆ vtkGetMacroConst() [12/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( NumberOfRetryAttempts  ,
int   
)
protected

◆ vtkGetMacroConst() [13/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( DelayBetweenRetryAttemptsSec  ,
double   
)
protected

◆ vtkGetMacroConst() [14/14]

vtkPlusOpenIGTLinkServer::vtkGetMacroConst ( KeepAliveIntervalSec  ,
double   
)
protected

◆ vtkGetStdStringMacro() [1/2]

vtkPlusOpenIGTLinkServer::vtkGetStdStringMacro ( OutputChannelId  )

◆ vtkGetStdStringMacro() [2/2]

vtkPlusOpenIGTLinkServer::vtkGetStdStringMacro ( ConfigFilename  )

◆ vtkSetStdStringMacro() [1/2]

vtkPlusOpenIGTLinkServer::vtkSetStdStringMacro ( OutputChannelId  )
protected

◆ vtkSetStdStringMacro() [2/2]

vtkPlusOpenIGTLinkServer::vtkSetStdStringMacro ( ConfigFilename  )
protected

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