How to toggle slice display in 3D using python code?

Hi everyone,

I have a question about window control using python codes.

What are the possible functions to call in order to to toggle slice display in 3D using python code?

image

Thank you so much in advance!

You can toggle slice visibility like this:

sliceNode = getFirstNodeByClassByName("vtkMRMLSliceNode", "Red")
sliceNode.SetSliceVisible(True)
2 Likes

Thank you so much, Kyle!