# Is it possible to control the crosshair to only be visible in certain views?

**URL:** <https://discourse.slicer.org/t/is-it-possible-to-control-the-crosshair-to-only-be-visible-in-certain-views/35406>\
**Category:** Development\
**Created:** [April 10, 2024, 9:31am UTC](https://discourse.slicer.org/t/is-it-possible-to-control-the-crosshair-to-only-be-visible-in-certain-views/35406 "2024-04-10T09:31:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrosica0808](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/matrosica0808/32/69966_2.png) [@matrosica0808](https://discourse.slicer.org/u/matrosica0808)\
**Post date:** [April 10, 2024, 9:31am UTC](https://discourse.slicer.org/t/is-it-possible-to-control-the-crosshair-to-only-be-visible-in-certain-views/35406/1 "2024-04-10T09:31:09Z")

</div>

The extension is configured to enable tracking of data at various points in time.  
I want to use crosshair according to each point of view. Is there a way to create a crosshair instance as below? If you do this, they all have the same address value.

```auto
crosshairNode = slicer.util.getNode("Crosshair")
    crosshairNode.SetCrosshairColor(1.0,0.0,0.0)
    crosshairNode.SetCrosshairMode(slicer.vtkMRMLCrosshairNode.ShowSmallIntersection)
    crosshairNode.SetCrosshairToThick()

    crosshairNode2 = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLCrosshairNode')
    crosshairNode2.SetCrosshairColor(0.0,1.0,0.0)
    crosshairNode2.SetCrosshairMode(slicer.vtkMRMLCrosshairNode.ShowSmallIntersection)
    crosshairNode2.SetCrosshairToThick()

    crosshairNode3 = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLCrosshairNode')
    crosshairNode3.SetCrosshairColor(0.0,0.0,1.0)
    crosshairNode3.SetCrosshairMode(slicer.vtkMRMLCrosshairNode.ShowSmallIntersection)
    crosshairNode3.SetCrosshairToThick()

```

And I want to make them visible only to certain views.  
As shown in the picture below, when there are 9 views, I would like to display only 1 row each. What should I do?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/6/16feb50b4c744ff3b29f72204e1a7334a774cbad.jpeg)

Also, when you hover the mouse over a specific view (Axial View at the top left in the picture above), is there a way to get the name and RAS coordinates of that view?

---

<div class="post-metadata">

**Author:** ![koeglfryderyk](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/koeglfryderyk/32/14638_2.png) [@koeglfryderyk](https://discourse.slicer.org/u/koeglfryderyk)\
**Post date:** [April 23, 2024, 9:48am UTC](https://discourse.slicer.org/t/is-it-possible-to-control-the-crosshair-to-only-be-visible-in-certain-views/35406/2 "2024-04-23T09:48:21Z")

</div>

to answer the RAS part of your second question:

you can get the RAS coordinates like so:

```auto
crosshairNode=slicer.util.getNode("Crosshair")
ras=[0,0,0]
crosshairNode.GetCursorPositionRAS(ras)

```

take a look at the script repository, I got this code from [here](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-scalar-values-at-surface-of-a-model)

(but I don’t know how to get the name of the view)
