# Problem using RegisterOutgoingMRMLNode in Slicer 4.10

**URL:** https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942
**Category:** Development
**Tags:** openigtlink
**Created:** [February 27, 2019, 8:14am UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942 "2019-02-27T08:14:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)
#### Post date: [February 27, 2019, 8:14am UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/1 "2019-02-27T08:14:31Z")

</div>

Hi Community,

I would again need some help with an issue I have with Slicer 4.10. I want to register an outgoing node for to an OpenIGTLink Connection (Server). The node is of type “vtkMRMLTextNode”. As soon as I call RegisterOutgoingMRMLNode the application freezes and then crashes.  
The same code works properly with Slicer 4.8. I found out that if I instead use a “vtkMRMLLinearTransformNode” the code runs fine with Slicer 4.10 as well. But thats not what we need.  
Any ideas what could be wrong or why we cannot use the TextNode anymore? Here a small code snipped which leads to the crash:

```
connector_node = slicer.vtkMRMLIGTLConnectorNode()
connector_node.SetTypeServer(18946)
connector_node.SetName("DeviceNodeName")
slicer.mrmlScene.AddNode(connector_node)

tnode = slicer.vtkMRMLTextNode()
tnode.SetName("MessageTextNode")
slicer.mrmlScene.AddNode(tnode)
connector_node.RegisterOutgoingMRMLNode(tnode)

```

I also tried starting the connector node before registering but this did not help.

Thanks for any hints on how to correctly use this.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [February 27, 2019, 12:37pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/2 "2019-02-27T12:37:07Z")

</div>

Are you able to use a debugger to get a stack trace? This sounds like memory corruption of some kind.

---

<div class="post-metadata">

### Author: ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)
#### Post date: [February 27, 2019, 1:04pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/3 "2019-02-27T13:04:34Z")

</div>

Unfortunately not. I can debug into the Python code but can’t debug into the Slicer sources. I just downloaded the Slicer Release version without any source code or PDB files on I could attach a debugger.  
I also don’t get any exceptions on Python. Slicer crashes silently with the message “The Program has stopped working”.  
Is there an easy way to get a stack trace up and running? I once tried to compile Slicer on my own but had no luck because of the many dependencies.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [February 27, 2019, 1:36pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/4 "2019-02-27T13:36:40Z")

</div>

I’m hoping one of the OpenIGTLink developers can replicate the crash in a developer build. Let’s see if someone chimes in.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [February 27, 2019, 2:04pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/5 "2019-02-27T14:04:28Z")

</div>

I could reproduce the crash by adding a new node by calling `slicer.mrmlScene.AddNewNodeByClass("vtkMRMLTextNode")` then adding it as an outgoing node. @Sunderlandkyl could you please check?

---

<div class="post-metadata">

### Author: ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)
#### Post date: [February 27, 2019, 3:24pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/6 "2019-02-27T15:24:49Z")

</div>

I found the problem (uninitialized char\* is treated as a string). In the process of investigating, I’ve also found that outgoing nodes are not being registered/observed correctly.

I have a fix for the first issue, and I hope to have the second issue fixed shortly.

---

<div class="post-metadata">

### Author: ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)
#### Post date: [February 27, 2019, 3:35pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/7 "2019-02-27T15:35:39Z")

</div>

Wow, that was a quick one! The support in this community is really great by the way!

Will there be a new release soon with the fix? I was hoping that Slicer 4.10.2 will be release some day. I am also hoping for a fix for this issue:  
[https://issues.slicer.org/view.php?id=4634](https://issues.slicer.org/view.php?id=4634)

Thanks again for the great support.

---

<div class="post-metadata">

### Author: ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)
#### Post date: [February 27, 2019, 3:39pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/8 "2019-02-27T15:39:04Z")

</div>

The SlicerOpenIGTLink fix should be available in the next nightly (edit: and stable) build tomorrow (~8am EST).  
You can check for the update in the extension manager.

---

<div class="post-metadata">

### Author: ![mcfly3001](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mcfly3001/32/6437_2.png) [@mcfly3001](https://discourse.slicer.org/u/mcfly3001)
#### Post date: [February 27, 2019, 3:41pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/9 "2019-02-27T15:41:34Z")

</div>

Does this mean I need to install the nightly build version?  
Or can I use the stable release and find it in the extension manager as well? Probably I will need to switch to the nightly, right?

Thanks.

---

<div class="post-metadata">

### Author: ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)
#### Post date: [February 27, 2019, 3:44pm UTC](https://discourse.slicer.org/t/problem-using-registeroutgoingmrmlnode-in-slicer-4-10/5942/10 "2019-02-27T15:44:50Z")

</div>

It should be available in both the stable and nightly versions.
