Issue with Receiving PolyData using pyigtl
I am experiencing an issue with receiving PolyData using the pyigtl library. The sending script appears to execute without errors, but the receiving script remains stuck and does not seem to receive the data.
The sending script: ` import pyigtl import vtk import logging
logging.basicConfig(level=logging.INFO)
reader = vtk.vtkPLYReader() reader.SetFileName("cube.ply") reader.Update() polydata = reader.GetOutput()
port = 18944 server = pyigtl.OpenIGTLinkServer(port=port) server.start()
logging.info(f"Server listening on port {port}...")
try: # Invia il polydata al server OpenIGTLink polydata_message = pyigtl.PolyDataMessage(polydata, device_name='Mesh') server.send_message(polydata_message, wait=True) logging.info("Polydata sent successfully.") except Exception as e: logging.error(f"An error occurred while sending the polydata: {e}") finally: logging.info("Server closed.") server.stop() `
the receiving script: `import pyigtl import vtk import logging
logging.basicConfig(level=logging.INFO)
client = pyigtl.OpenIGTLinkClient() client.start()
try: input_message = client.wait_for_message("Mesh") polydata = input_message.polydata logging.info("Polydata received successfully.")
writer = vtk.vtkPLYWriter()
writer.SetFileName("received_cube.ply")
writer.SetInputData(polydata)
writer.Write()
logging.info("Polydata saved to 'received_cube.ply'.")
except Exception as e: logging.error(f"An error occurred while receiving the polydata: {e}") finally: client.stop() `
- I have verified that both scripts are running on the same network and that the port is not blocked by a firewall.
- I have tried increasing the logging level to DEBUG, but did not find any additional useful information.
- pyigtl version 0.3.1
- vtk 9.2.6