Markups - highlight selected markup clicked in 3D view?

Right click is a fairly new feature. Perhaps you are running an older build?

Ditto on the use case. We have similar ones too…

I’m running May 5 nightly. I’ll grab a newer one.

Thanks! Hope you guys are well.

Right-click should be available in May 5 version. Do you use a Mac? I’ve noticed that on some touchpad/mouse on Mac create many pointer events, even when the point is not or barely moved, which defeats the current click detection mechanism. Maybe we need to increase the click detection’s motion tolerance.

I am on a Mac, yes. I was looking through the commits since May 5 and didn’t see anything obvious, so I was wondering why it doesn’t work.

I am using an external mouse, not a touchpad, if that makes a difference.

In qSlicerMarkupsModuleWidget.cxx, I see a connection for right-click in the activeMarkupTableWidget. Is there a different place where the signal comes from the 3D view or a slice view (presumably to the same slot)?

Markup node selection is initiated by the 2D/3D markups widget and it ends with calling qSlicerMarkupsModuleWidget::setEditedNode. Markups ID could be passed in the context argument.

OK. But this is implemented already? I was mostly looking for where it might be not working. Sorry for my confusion!

Yes, context menu on right-click is implemented and it works already. If the context menu does not appear for you then it is a bug.

yeah, it does not appear to work. I’m right-clicking very carefully with an external mouse so it does not appear to be a trackpad/touchpad noisy-right-click-with-two-fingers issue.

Odd, it works fine for me on mac with either mouse or trackpad.

You are right clicking after the fiducial color changed from red to blue (meaning it is selected), right? Otherwise it doesn’t work? Any chance you might have interactions disabled?

Do you have a debug-mode build? It would be awesome if you could track this down. I would suspect that your mouse driver generates a mouse event between pressing and releasing the button, even if you don’t physically move the mouse (or maybe you move it by 0.00001mm) and that confuses the click detection logic here: If indeed this is the problem then it could be fixed by checking how much the mouse was moved instead of just detecting that a mouse move event was fired.

OK, this is odd. This is an older file I’m working with, maybe from January or so. When I just download sample data (CTACardio), place a fiducial, and right click in the 3D view, it works fine.

I took a look at the fcsv file and for my older file that does not work, I do not have entries for associatedNodeID for most of the entries, whereas the newer one I just made from the demo data has vtkMRMLScalarVolumeNode1 for all fiducials.

I also have CoordinateSystem=0 at the top, whereas the file I just created has LPS.

I did try hand-changing the coordinate system to LPS but this moves all my fiducials, and right click still doesn’t work.

I also added vtkMRMLScalarVolumeNode1 (which is a real, correct node) to all lines and right click still doesn’t work.

I really do think this is some kind of pilot error (me), or possibly an old file incompatibility (less likely).

Any ideas?


Can you upload the scene .mrb file that reproduces this somewhere and post the link here?

Oy, the MRB is kinda big. Couple of GB. I can see if I can trim it down… It’s an insect, of course, so no worries about making it anonymous, ha ha.

It is NOT the fcsv file - I copied my FCSV file from my setup that does not work into the one I just created with CTACardio, and I can right-click and it works fine. Likewise, if I copy the F.fcsv file from CTCardio to my setup that does not work, and I can’t right click. So it’s something in the MRML file. I’m checking the 3 blocks that have to do with markups.

Then try @muratmaga’s suggestion of making sure that the markups node is not locked (Control points/Interaction in Views enabled).

Interaction in views was enabled. Still didn’t work.

I was finally able to get it working by deleting the node, then re-loading it. I’m slowly looking through the diffs in the XML between the working and non-working ones and I’ll let you know if I find the smoking gun.

Thanks very much for your help!

1 Like

Just a quick follow-up on this. I wasn’t able to tell which bit of XML was making it fail, but it appears to be some file version incompatibility in the MRML file. It is a very simple workaround/fix though-

  1. Go to Data module
  2. Delete markups node
  3. Go to “Add data”
  4. re-load markups fcsv file

Murat @muratmaga and Andras @lassoan - Thanks for taking the time to look at it. I can probably make up a mrb that reproduces it but because it’s such a simple procedure to update the file, I see very little benefit in tracking down what’s going on in the code, but let me know.

Can you share the original scene that reproduces the problem? You can share a few-gigabyte scene file via OneDrive or Google Drive.

Thanks to the example scene that @hherhold shared, we found a subtle error in subject hierarchy module’s context menu observation mechanism setup that is not fixed. With this fix, context menu now always appears when the markup is right-clicked.

1 Like