Python code for getting current displayed slice on a red window

Hi all!
Would you please share to me python snippet on how to get a slice index which is shown on a red window?
Please point me to similar post if already answered. I couldn’t find it though.

Thanks a lot!

Do you mean the slice offset (in mm, displayed in the top right corner of the view)?
If so, you can do:

redSliceNode = slicer.util.getNode('vtkMRMLSliceNodeRed')
redSliceNode.GetSliceOffset()
1 Like

Alright, thanks. And how to convert it to image coordinate (IJK)? @rfenioux