I have imported a Dicom file containing various volumes of pelvic and ankle of different slice thicknesses. The view window always shows the last volume imported. I can switch between different volumes by going to the ‘Data’ Module. But I am trying to implement this functionality in python. Could anyone suggest how should I proceed?
Thanks Steve for your answer. The link has proven really helpful.
I was able to solve using the following code. Maybe it might be helpful to someone else also.
def displaySelectVolume(self, a):
layoutManager = slicer.app.layoutManager()
for sliceViewName in layoutManager.sliceViewNames():
view = layoutManager.sliceWidget(sliceViewName).sliceView()
sliceNode = view.mrmlSliceNode()
sliceLogic = slicer.app.applicationLogic().GetSliceLogic(sliceNode)
compositeNode = sliceLogic.GetSliceCompositeNode()
Here ‘a’ is the Mrml Node ID