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
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.
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?
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 so that the nodeID is set for either model or volume nodes.