PlusLib
2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
|
This class provides a network interface for data acquired by Plus as an OpenIGTLink server. More...
#include <src/PlusServer/vtkPlusOpenIGTLinkServer.h>
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 vtkPlusOpenIGTLinkServer * | New () |
static vtkPlusOpenIGTLinkServer * | SafeDownCast (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) |
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.
typedef vtkObject vtkPlusOpenIGTLinkServer::Superclass |
Definition at line 94 of file vtkPlusOpenIGTLinkServer.h.
|
protected |
Definition at line 79 of file vtkPlusOpenIGTLinkServer.cxx.
|
protectedvirtual |
Definition at line 115 of file vtkPlusOpenIGTLinkServer.cxx.
|
staticprotected |
Thread for client connection handling
Definition at line 237 of file vtkPlusOpenIGTLinkServer.cxx.
|
protected |
Converts a command response to an OpenIGTLink message that can be sent to the client
Definition at line 1363 of file vtkPlusOpenIGTLinkServer.cxx.
|
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.
|
staticprotected |
Thread for sending data to clients
Definition at line 318 of file vtkPlusOpenIGTLinkServer.cxx.
|
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.
|
virtual |
|
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.
|
virtual |
|
virtual |
|
virtual |
Get number of connected clients
Definition at line 1237 of file vtkPlusOpenIGTLinkServer.cxx.
|
protected |
Definition at line 1314 of file vtkPlusOpenIGTLinkServer.cxx.
|
virtual |
|
static |
|
protectedvirtual |
Send status message to clients to keep alive the connection
Definition at line 1197 of file vtkPlusOpenIGTLinkServer.cxx.
|
static |
|
virtual |
Definition at line 152 of file vtkPlusOpenIGTLinkServer.cxx.
int vtkPlusOpenIGTLinkServer::ProcessPendingCommands | ( | ) |
Execute all commands in the queue from the current thread (useful if commands should be executed from the main thread)
Definition at line 1308 of file vtkPlusOpenIGTLinkServer.cxx.
|
protected |
Add a response to the queue for sending to the client
Definition at line 124 of file vtkPlusOpenIGTLinkServer.cxx.
|
virtual |
Read the configuration file in XML format and set up the devices
Definition at line 1261 of file vtkPlusOpenIGTLinkServer.cxx.
|
static |
|
staticprotected |
Process the command replies queue and send messages
Definition at line 531 of file vtkPlusOpenIGTLinkServer.cxx.
|
staticprotected |
Attempt to send any unsent frames to clients, if unsuccessful, accumulate an elapsed time
Definition at line 416 of file vtkPlusOpenIGTLinkServer.cxx.
|
staticprotected |
Process the message replies queue and send messages
Definition at line 495 of file vtkPlusOpenIGTLinkServer.cxx.
|
protectedvirtual |
Tracked frame interface, sends the selected message type and data to all clients
Definition at line 1018 of file vtkPlusOpenIGTLinkServer.cxx.
|
virtual |
Set data collector instance
|
virtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
Set IGTL CRC check flag (0: disabled, 1: enabled)
|
protectedvirtual |
|
virtual |
Set server listening port
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
|
virtual |
|
protectedvirtual |
|
virtual |
|
virtual |
Set transform repository instance
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.
PlusStatus vtkPlusOpenIGTLinkServer::StartOpenIGTLinkService | ( | ) |
Start server
Definition at line 158 of file vtkPlusOpenIGTLinkServer.cxx.
PlusStatus vtkPlusOpenIGTLinkServer::Stop | ( | ) |
Configures and starts the server from the provided device set configuration file
Definition at line 1346 of file vtkPlusOpenIGTLinkServer.cxx.
PlusStatus vtkPlusOpenIGTLinkServer::StopOpenIGTLinkService | ( | ) |
Stop server
Definition at line 201 of file vtkPlusOpenIGTLinkServer.cxx.
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | ListeningPort | , |
int | |||
) |
Get server listening port
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | MissingInputGracePeriodSec | , |
double | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | MaxTimeSpentWithProcessingMs | , |
double | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | SendValidTransformsOnly | , |
bool | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | DefaultClientSendTimeoutSec | , |
float | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | DefaultClientReceiveTimeoutSec | , |
float | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | DataCollector | , |
vtkPlusDataCollector * | |||
) |
vtkPlusOpenIGTLinkServer::vtkGetMacroConst | ( | TransformRepository | , |
vtkIGSIOTransformRepository * | |||
) |
|
protected |
Get IGTL CRC check flag (0: disabled, 1: enabled)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
vtkPlusOpenIGTLinkServer::vtkGetStdStringMacro | ( | OutputChannelId | ) |
vtkPlusOpenIGTLinkServer::vtkGetStdStringMacro | ( | ConfigFilename | ) |
|
protected |
|
protected |