Is it possible to send a customized polydata over OpenIGTLink. In an earlier version, I was able to send the data by setting the igtl::PolyDataMessage::Pointer and then sending the data by directly calling vtkMRMLIGTLConnectorNode::SendData to send the polydata message.
It looks like in the new version of OpenIGTLink, SendData method has been removed. Do I need to set the polydata to a vtkMRMLModelNode and then push the node over OpenIGTLink? Can you let me know how if there is an easier way of sending the customized polydata message.
I may be missing something here since it doesn’t look like it works. As a toy example, I tried to extract the polydata from a model and then send it over OpenIGTLink by creating a vtkMRMLModelNode and pushing the node. The code snippet is included below:
//Creating some dummy polydata
vtkPolyData* polyData = modelNode->GetPolyData();
// send the data
vtkSmartPointer<vtkMRMLModelNode> modelClientNode = vtkSmartPointer<vtkMRMLModelNode>::New();
modelClientNode->SetAndObservePolyData(polyData);
modelClientNode->Modified();
connectorNode->RegisterOutgoingMRMLNode(modelClientNode);
connectorNode->PushNode(modelClientNode);
connectorNode->UnregisterOutgoingMRMLNode(modelClientNode);
I don’t receive the polydata on the server side. Please let me know your suggestions.
I am using Slicer 4.13.0-2021-01-13. It occurs with every vtk model that I try to send. Not sure where the problem is.
In fact, even if I try to send the model from the OpenIGTLink module in Slicer (not programmatically), I run into the same problem with the following error:
Unable to create vtkPolyData from incoming POLYDATA message. Failed to unpack the message