Operating system: Windows 10
Slicer version: 4.8.1
Expected behavior: No significant performance drop (at least in 3D view) while receiving messages.
Actual behavior: significant performance drop
When using openigtlink module in slicer in server mode, if the received message rate exceeds 10 message/second there’s visible frame rate drop in the 3D view drops. I’ve been using a matlab script to connect to the server and send messages. (not sure if this extends to whole slicer performance or only the 3D view; I assume it’s the former). To reproduce this:
Create an IGTLink server node in slicer and set check for CRC off with:
getNode("IGTLCon*").SetCheckCRC(0)
You can use this script to rotate the 3D scene. The jitters can be seen while rotating with the mouse as well.
layoutManager = slicer.app.layoutManager()
layoutManager.setLayout(4) # 3D only
threeDWidget = layoutManager.threeDWidget(0)
threeDView = threeDWidget.threeDView()
threeDView.resetFocalPoint()
threeDController = threeDWidget.threeDController()
threeDController.spinView(True)
threeDView.setAnimationIntervalMs(5)
threeDView.setSpinIncrement(1)
Run the performance_drop_test_slicer.m script in this repo or any other openigtlink client to send messages to the slicer server.
There’s an FPS drop in the 3D viewer while the messages are being sent. As you can see here:
On a side note, the SetCheckCRC function doesn’t work in the current nightly build (4.9.0-2018-06-05), is there a substitute for it?
A problem that I have with running this with the nightly is that I can’t turn off the CRC check of the IGTLink node. SetCheckCRC(0) doesn’t work in the nightly version. ( I get an error saying the node doesn’t have a SetCRCCheck attribute).
The node type seems to be different in nightly (vtkSlicerOpenIGTLinkIFModuleMRMLPython.vtkMRMLIGTLConnectorNode) vs stable (vtkCommonCorePython.vtkMRMLIGTLConnectorNode)
I’ve checked the code and indeed, as a result of some recent refactoring, CRC check is not exposed in the MRML node interface. I’ve submitted a pull request that adds back this feature: https://github.com/openigtlink/SlicerOpenIGTLink/pull/37. It’ll be probably integrated within a few days.
Thanks @lassoan@leochan2009 . I tested the nightly, SetCheckCRC is exposed now but slicer crashes when it receives a message. There’s no error message, it’s just closed. I assume it can be reproduced with any openIGTLInk, but you can use the matlab script in my original post. It can be found here: github.com/roozbehshams/MatlabOpenIGTLink/tree/NativeMatlabTCPIP/src , the performance_drop_test_slicer script.
Hi,
I tested the OpenIGTLinkIF module using the TrackerServer program in OpenIGTLink library.
The receiving message is working well and Set/GetCheceCRC functions are working as well.
Unfortunately i don’t have Matlab, so i could not check your code.
Probably Andras could check this issue at the same time @lassoan
Thanks for looking into it. The problem happens when slicer is used in server mode. I think you should be able to reproduce it if you use the TrackerClient.
I just checked with TrackerClient, slicer doesn’t crash either.
When you use the trackerClient for testing, just add one line to set the device name.
transMsg-> SetDeviceName(“Tracker”);
otherwise, in slicer you will received bunch of transformation nodes.
I could not reproduce the performance drop with latest nightly version of Slicer. Update rate of 3D view on my computer is about 150FPS - with and without continuously streaming messages from Matlab using your script (I’ve changed for t=0:0 to for t=0:1000 to send many messages).