Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def onResize(self, caller=None, event=None):
slicer.app.processEvents()
self.adjustSize()
def onApplyButton(self):
if not self.outputTableSelector.currentNode():
tableNode = slicer.vtkMRMLTableNode()
slicer.mrmlScene.AddNode(tableNode)
self.outputTableSelector.setCurrentNode(tableNode)
logic = SlicerRadiomicsLogic()
# Lock GUI
self.applyButton.text = 'Working...'
self.applyButton.setEnabled(False)
slicer.app.processEvents()
imageNode = self.inputVolumeSelector.currentNode()
maskNode = self.inputMaskSelector.currentNode()
if self.manualCustomizationRadioButton.checked:
# Set up customization
featureClasses = self.getCheckedFeatureClasses()
settings = {
'binWidth': self.binWidthSliderWidget.value,
'symmetricalGLCM': self.symmetricalGLCMCheckBox.checked
}
enabledImageTypes = {'Original': {}}
logKernelSizesValue = self.logKernelSizes.text
if logKernelSizesValue:
# Set text color based on log level
if logLevel >= logging.ERROR:
message = '<font color="red">' + message + '</font>'
elif logLevel >= logging.WARNING:
message = '<font color="orange">' + message + '</font>'
# Show message in status bar
doc = qt.QTextDocument()
doc.setHtml(message)
slicer.util.showStatusMessage(doc.toPlainText(),3000)
# Show message in log window at the bottom of the module widget
self.sampleDataTabTextEdit.insertHtml(message)
self.sampleDataTabTextEdit.insertPlainText('\n')
self.sampleDataTabTextEdit.ensureCursorVisible()
self.sampleDataTabTextEdit.repaint()
logging.log(logLevel, message)
slicer.app.processEvents(qt.QEventLoop.ExcludeUserInputEvents)