Is it possible to make crosshair node invisible in yellow slice view window?

i have found some code to make node with display node to be invisible in yellow slice view window like the code below

pointListNode = getNode("F")
pointListDisplayNode = pointListNode.GetDisplayNode()
pointListDisplayNode.SetVisibility(False) # Hide all points
pointListDisplayNode.SetVisibility(True) # Show all points
pointListDisplayNode.SetSelectedColor(1,1,0) # Set color to yellow
pointListDisplayNode.SetViewNodeIDs(["vtkMRMLSliceNodeRed", "vtkMRMLViewNode1"]) # Only show in red slice view and first 3D view

but crosshair node don’t have display node ,is it possible to make crosshair node invisible in yellow slice view window?

may be you need to hard code into C++ code?

I would indeed expect the following code to work:

for viewerName in ["Red", "Green", "Yellow"]:

    sliceNode = slicer.util.getNode(f"vtkMRMLSliceNode{viewerName}")
    sliceLogic =

    # The vtkMRMLSliceDisplayNode controls appearance of slice intersections
    # in slice views and slices in 3D views.
    sliceDisplayNode = sliceLogic.GetSliceDisplayNode()

    # Display slice intersection on all views expect the "Yellow" one
    sliceDisplayNode.SetViewNodeIDs(["vtkMRMLViewNode1", "vtkMRMLSliceNodeRed", "vtkMRMLSliceNodeGreen"])

After a cursory check, this feature is missing, it could be added to the following functions:

  • vtkMRMLSliceIntersectionInteractionRepresentation::UpdateFromMRML()
  • vtkMRMLSliceIntersectionInteractionRepresentation2D::UpdateFromMRML()

Is it something you could help with ?

thank you @jcfr ,these code may work for intersection line , do you know how to make crosshair node invisible in the Yellow Slice Window?