Updating script repository with a command to enable crosshair visibility

I’m not sure if this is the correct place for such a request, however:

There are a lot of examples with the Crosshair in the script repository, however, none of them actually says that you have to make the crosshair visible (and how to do that). It took me quite some time to figure out why the crosshair was not showing.

Maybe it’s obvious for some, but I think adding a line of code that explains that would be helpful for beginners.

In the end, that’s what I used (but maybe there’s a better way):

crosshairNode = slicer.util.getNode("Crosshair")
crosshairNode.SetCrosshairMode(1)
1 Like

This is a great suggestion. Would you mind trying to edit the script repository your self and make a pull request? You will find the ‘Edit on GitHub’ link in the upper right of the read the docs page. If we all get in the habit of doing this it will help make sure contributions are reviewed and acted on and that credit for the contributions is recorded.

Small suggestion: instead of hard-coding the number 1 you could use slicer.vtkMRMLCrosshairNode.ShowBasic.

2 Likes