View Issue Details

IDProjectCategoryView StatusLast Update
0003501Slicer4Module OpenIGTLinkIFpublic2014-03-06 10:17
Reporterlassoan Assigned Totokuda  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003501: Send all OpenIGTLink outputs to newly connected clients
Description

I send transforms from Slicer to an OpenIGTLink client. It works well except that Slicer only sends the transforms when they change. It is generally a good behavior, but the issue is that when the client connects it doesn’t get the current value of the transforms (unless they are changed).

Would it be possible to implement in OpenIGTLinkIF to automatically send all the current OpenIGTLink outputs to the client when the connection is established?

TagsNo tags attached.

Activities

tokuda

tokuda

2013-11-17 13:11

developer   ~0010323

Last edited: 2013-11-17 13:12

Thanks for the suggestion. It makes sense to have such feature in the OpenIGTLink IF module.
Since there are some applications which do not want to push all the messages upon connection, I would add a flag (as an attribute) for outgoing MRML nodes. I pushed a test implementation to:

https://github.com/tokjun/OpenIGTLinkIF/tree/3501-send-all-outputs-on-connection

With this implementation, you can activate the suggested feature by setting "OpenIGTLinkIF.pushOnConnection" attribute to "1" in each MRML node. To test this:

  1. Start the ReceiveServer sample program of OpenIGTLink (run "ReceiveServer 18944")

  2. Create a connector node from OpenIGTLink IF module as a client ("localhost"/18944)

  3. Create a new transform node. Suppose the node ID is "vtkMRMLTransformNode4"

  4. Add the transform node under "OUT" branch in the I/O configuration interface in the OpenIGTLink IF module.

  5. Open Python Interactor in Slicer and run:

    tnode1 = slicer.mrmlScene.GetNodeByID('vtkMRMLLinearTransformNode4')
    tnode1.SetAttribute('OpenIGTLinkIF.pushOnConnection', '1')

  6. Activate the connector from OpenIGTLinkIF. The ReceiveServer will output a message that it received a transform from Slicer.

Please let me know what you think. If this works, the next step would be implementation of a GUI to control this attribute.

lassoan

lassoan

2013-11-17 16:07

developer   ~0010324

Thanks a lot for developing this so quickly! I test it and let you know how it works.

lassoan

lassoan

2013-11-17 18:52

developer   ~0010325

Thank you, I've tested it on Win7-64 and it works flawlessly!

Just one thing to consider: when a connection is established, there is no need to push the output nodes to all connections, only to the new connection that has been just established. If it's complicated to send selectively then it's OK to keep the current behavior.

GUI: Probably the simplest would be to add one more column to the I/O configuration table.

Some info that may be useful: I'm not sure if you know about this feature, the Data module has a MRML node inspector that can be used for adding/modifying custom node attributes, so there is no need for finding out the node ID, and entering python commands.

An unrelated enhancement request: when I create a new OpenIGTLink connection I have to click: +, the new connection name, Client radio button, and Active (4 clicks, quite far from each other, in different directions). It would be much more convenient (I could add an active connection by clicking on just two buttons, quite close to each other) if the new connection would be selected automatically and by default the 'Client' type would be selected by default.

Thanks again for the quick and good work!

tokuda

tokuda

2013-11-18 06:12

developer   ~0010326

There is no need to push the output nodes to all connections, only to the new connection that has been just established. If it's complicated to send selectively then it's OK to keep the current behavior.

Thanks for the feedback. This behavior is actually from vtkMRMLIGTLConnectorNode::PushNode() function. I implemented the requested feature by calling PushNode(), but this function only invokes an event that triggers data transfer , which could affect all connector nodes in the scene. I think this function should only push data to the specific connector.

GUI: Probably the simplest would be to add one more column to the I/O configuration table.

I was thinking about the same solution. I will work on this.

lassoan

lassoan

2013-11-18 06:31

developer   ~0010327

Great, thanks!

tokuda

tokuda

2013-11-18 09:30

developer   ~0010330

I addressed those two issues in tokjun/OpenIGTLinkIF 499186193e6be9a6f39ef5836213f4f8d4b8703f :

  • vtkMRMLIGTLConnectorNode::PushNode() now pushes only nodes under the connector node.
  • "Push on Connect" checkbox is added to I/O configuration

Please also note that "OpenIGTLinkIF.pushOnConnection" attribute is now renamed to "OpenIGTLinkIF.pushOnConnect" and only allows "true" / "false" values instead of "1"/ "0".

lassoan

lassoan

2013-11-18 11:16

developer   ~0010335

Thank you, I've tested it and works very well. There is only one strange thing: the "Push on connect" checkbox is displayed for the IN nodes as well. Does the checkbox have an effect for the IN nodes? If not, then probably it's better to hide or disable the checkbox for the IN nodes.

tokuda

tokuda

2013-11-18 12:22

developer   ~0010336

I agree. I removed the check boxes for the IN nodes.

tokuda

tokuda

2013-11-22 11:07

developer   ~0010362

The code has been merged to the main repository of OpenIGTLinkIF:

https://github.com/openigtlink/OpenIGTLinkIF/pull/18

lassoan

lassoan

2013-12-04 03:29

developer   ~0010397

Tested with latest nightly on Windows and it works well

jcfr

jcfr

2013-12-12 07:51

administrator   ~0010430

For reference, this was fixed with r22727

jcfr

jcfr

2014-03-06 05:25

administrator   ~0011222

Closing resolved issues that have not been updated in more than 3 months

Issue History

Date Modified Username Field Change
2013-11-16 14:46 lassoan New Issue
2013-11-16 14:46 lassoan Status new => assigned
2013-11-16 14:46 lassoan Assigned To => tokuda
2013-11-17 13:11 tokuda Note Added: 0010323
2013-11-17 13:12 tokuda Note Edited: 0010323
2013-11-17 16:07 lassoan Note Added: 0010324
2013-11-17 18:52 lassoan Note Added: 0010325
2013-11-18 06:12 tokuda Note Added: 0010326
2013-11-18 06:31 lassoan Note Added: 0010327
2013-11-18 09:30 tokuda Note Added: 0010330
2013-11-18 10:46 jcfr Target Version => Slicer 4.4.0
2013-11-18 11:16 lassoan Note Added: 0010335
2013-11-18 12:22 tokuda Note Added: 0010336
2013-11-22 11:07 tokuda Note Added: 0010362
2013-11-22 11:07 tokuda Status assigned => resolved
2013-11-22 11:07 tokuda Resolution open => fixed
2013-12-04 03:29 lassoan Note Added: 0010397
2013-12-04 03:29 lassoan Status resolved => closed
2013-12-04 03:29 lassoan Fixed in Version => Slicer 4.3.2
2013-12-11 11:50 lassoan Status closed => resolved
2013-12-12 07:51 jcfr Note Added: 0010430
2014-03-06 05:25 jcfr Note Added: 0011222
2014-03-06 05:28 jcfr Status resolved => closed
2014-03-06 10:17 nicole Fixed in Version Slicer 4.3.2 => Slicer 4.4.0