# vtkMRMLModelDisplayableManager issue

**URL:** <https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709>\
**Category:** Development\
**Created:** [November 10, 2018, 12:23am UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709 "2018-11-10T00:23:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [November 10, 2018, 12:23am UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709/1 "2018-11-10T00:23:33Z")

</div>

Hello,  
I would like to identify the picked display node after a fiducial is placed using the markups module. While attempting this, I came across what seems to be a bug in the vtkMRMLModelDisplayableManager.

The Pick function attempts to set the picked display node using the internal function FindPickedDisplayNodeFromMesh. The mesh is obtained via:  
this-\>Internal-\>CellPicker-\>GetDataSet().

However, no mesh is returned. The picked cell id is set correctly using:  
this-\>Internal-\>CellPicker-\>GetCellId()

I have also tried:  
this-\>Internal-\>FindFirstPickedDisplayNodeFromPickerProp3Ds();

to identify the picked display node. Is this a known issue with the vtkMRMLModelDisplayableManager? I would appreciate any advice or suggestions.  
Thanks,  
Sara

---

<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:** [November 26, 2018, 3:34pm UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709/2 "2018-11-26T15:34:54Z")

</div>

Hi @smrolfe -

Sorry for the slow reply on this - I had a chance to step through the `vtkMRMLModelDisplayableManager::Pick` code and things seem to be working for me with a small example.

If this is still an issue for you let’s try to write a small test script that can replicate what you are seeing.

Best,  
Steve

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [November 26, 2018, 10:34pm UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709/3 "2018-11-26T22:34:14Z")

</div>

Hi @pieper,  
Thanks for your reply, I’ll write a test script and then post an update.  
Best,  
Sara

---

<div class="post-metadata">

**Author:** ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)\
**Post date:** [November 30, 2018, 8:52pm UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709/4 "2018-11-30T20:52:47Z")

</div>

Hi @pieper -  
Here’s a few lines of code that I expected to return the volume node when a fiducial is placed on a 3D rendered volume:

```auto
fidList = getNode('F')
fidIndex = 0
volumeID = fidList.GetNthFiducialAssociatedNodeID(fidIndex)
volumeNode = getNode(volumeID)

```

This code is from an old Slicer thread archived here:  
[http://massmail.spl.harvard.edu/public-archives/slicer-devel/2014/015761.html](http://massmail.spl.harvard.edu/public-archives/slicer-devel/2014/015761.html)

When I use this method, I do not get any node associated with the fiducial. Is this something that was changed from a previous version of Slicer? I traced the issue back to the vtkMRMLDisplayableManager, which is using:  
this-\>Internal-\>FindPickedDisplayNodeFromMesh(mesh, pickPoint);

to get the associated node. Since there is no mesh when only volume data is loaded, this is setting the associated node to null. I tried subbing the function FindFirstPickedDisplayNodeFromPickerProp3Ds, but this was not working for volume data either.

Could you let me know if you have any suggestions?

---

<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:** [December 1, 2018, 8:53pm UTC](https://discourse.slicer.org/t/vtkmrmlmodeldisplayablemanager-issue/4709/5 "2018-12-01T20:53:01Z")

</div>

Hi @smrolfe -

Thanks for the extra info - I see now you’d like to get the volume node but currently the code only only adds an associated node in the case of clicking on a model.

I [just added a fix](https://github.com/Slicer/Slicer/commit/f1b55fc99e948629e8a048c619d685a25ac0ba4d) so that the nodeID is set for either model or volume nodes.

So now, if I do this:

1. download the MRHead from SampleData
2. make it visible in the VolumeRendering module
3. place a fiducial on it

Then this code prints out `"MRHead"`.

```auto
fidList = getNode('F')
fidIndex = 0
volumeID = fidList.GetNthFiducialAssociatedNodeID(fidIndex)
volumeNode = getNode(volumeID)
print(volumeNode.GetName())

```

Let me know how it goes for you.

Cheers,  
-Steve
