def __validateInputVolumeSelection__(self):
        inputVolumeId = self.inputVolumeSelector.currentNodeID
        if inputVolumeId == '':
            qt.QMessageBox.warning(slicer.util.mainWindow(), 'Warning', 'Please select an input volume')
            return False
        return True
Check there is a valid input and/or output volume selected. Otherwise show a warning message
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_LesionModel/CIP_LesionModel.py/CIP_LesionModelWidget.__validateInputVolumeSelection__