I have two buttons: Add
and Delete
. The Add
uses to add a node, while the Delete
is for node removing. The Add
function is implemented as follows:
self.roiNodes =[]
for i in range (10):
node = slicer.vtkMRMLAnnotationROINode()
node.SetXYZ(0, 0, 0)
node.SetRadiusXYZ(25, 25, 25)
node.Initialize(slicer.mrmlScene)
node.SetName("A")
self.node_list.append(node)
The delete function will delete the node base on the seletected row in the table (10 rows)
slicer.mrmlScene.RemoveNode(self.node_list[self.table.currentRow()])
self.table.removeRow(self.table.currentRow())
self.node_list.pop(self.table.currentRow())
The add function works well, while the delete function does not work. Any wrong implementation in my code? Thanks