Skip to content

Instantly share code, notes, and snippets.

@sjh26
Created October 14, 2022 14:55
Show Gist options
  • Save sjh26/96bd8a8f9fb878b676861cae87aa0d04 to your computer and use it in GitHub Desktop.
Save sjh26/96bd8a8f9fb878b676861cae87aa0d04 to your computer and use it in GitHub Desktop.
get active volume
def getActiveVolume():
lm = slicer.app.layoutManager()
sliceLogic = lm.sliceWidget('Red').sliceLogic()
compositeNode = sliceLogic.GetSliceCompositeNode()
return compositeNode.GetBackgroundVolumeID()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment