How to display markups node only in a specific slice view?

Hi all

I would like to make marksupNode and marksupCurveNode visible only in the red slice. (I prefer them to remain invisible in the green and yellow slices.)

Could you please provide an example for achieving this?

You can do it with something like this:

markupsNode.GetDisplayNode().SetViewNodeIDs(["vtkMRMLSliceNodeRed"])

You just need to specify the ids for all of the views in which it should be visible.

https://apidocs.slicer.org/main/classvtkMRMLDisplayNode.html#a8fd9a8d62109f08b3720edc8e174a546