How to use the slicer.app.processEvents function in slicer

To help you get started, we’ve selected a few slicer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github QIICR / SlicerDevelopmentToolbox / SlicerDevelopmentToolboxUtils / forms / FormsDialog.py View on Github external
def onResize(self, caller=None, event=None):
    slicer.app.processEvents()
    self.adjustSize()
github Radiomics / SlicerRadiomics / SlicerRadiomics / SlicerRadiomics.py View on Github external
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:
github Kitware / SlicerSALT / Modules / Scripted / Home / Home.py View on Github external
# Set text color based on log level
        if logLevel >= logging.ERROR:
          message = '<font color="red">' + message + '</font>'
        elif logLevel &gt;= 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)