GetSelected() update to Slicer3D

Hi, i’mt trying to convert this code in Slicer 4.10.2, but i don’t know how to update the function GetSelected(). Can you help me?

self.LabeledVolumeSelector = slicer.vtkSlicerNodeSelectorWidget()
self.SelectedVolumeSelector = slicer.vtkSlicerNodeSelectorWidget()

labeledImage = self.LabeledVolumeSelector.GetSelected().GetImageData()
selectedImage = self.SelectedVolumeSelector.GetSelected().GetImageData()

Looks like this was answered here:

I solved my problem using currentNode()

1 Like