parameters: (self, confirm=True)
docstring: delete the currently selected structure
docstring_summary: delete the currently selected structure
docstring_tokens: delete the currently selected structure
function: def deleteSelectedStructure(self, confirm=True):
      """delete the currently selected structure"""
  
      merge = self.merge
      if not merge:
        return
  
      selectionModel = self.structuresView.selectionModel()
      selected = selectionModel.currentIndex().row()
  
      if selected >= 0:
  
        structureName = self.structures.item(selected,2).text()
        labelNode = slicer.util.getNode(self.structures.item(selected,3).text())
  
        if confirm:
          if not slicer.util.confirmOkCancelDisplay("Delete \'%s\' volume?" % structureName, windowTitle='Editor'):
            return
  
        slicer.mrmlScene.SaveStateForUndo()
  
        slicer.mrmlScene.RemoveNode( labelNode )
        self.updateStructures()
        if self.structures.rowCount() > 0:
          self.selectStructure((selected-1) if (selected-1 >= 0) else 0)
        else:
          EditUtil.setActiveVolumes(self.master, merge)
          self.edit(0)
function_tokens: def deleteSelectedStructure ( self , confirm = True ) : merge = self . merge if not merge : return selectionModel = self . structuresView . selectionModel ( ) selected = selectionModel . currentIndex ( ) . row ( ) if selected >= 0 : structureName = self . structures . item ( selected , 2 ) . text ( ) labelNode = slicer . util . getNode ( self . structures . item ( selected , 3 ) . text ( ) ) if confirm : if not slicer . util . confirmOkCancelDisplay ( "Delete \'%s\' volume?" % structureName , windowTitle = 'Editor' ) : return slicer . mrmlScene . SaveStateForUndo ( ) slicer . mrmlScene . RemoveNode ( labelNode ) self . updateStructures ( ) if self . structures . rowCount ( ) > 0 : self . selectStructure ( ( selected - 1 ) if ( selected - 1 >= 0 ) else 0 ) else : EditUtil . setActiveVolumes ( self . master , merge ) self . edit ( 0 )