How to use the slicer.util.errorDisplay 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 / View on Github external
def onStateChanged(self, newState):
    stdout, stderr = super(DICOMDirectorySender, self).onStateChanged(newState)
    if stderr and stderr.size():
      slicer.util.errorDisplay("An error occurred. For further information click 'Show Details...'",
                               windowTitle=self.__class__.__name__, detailedText=str(stderr))
    return stdout, stderr
github faustomilletari / TOMAAT-Slicer / TOMAAT / View on Github external
if "fingerprint" in result.keys():
                # untrusted host -> ask to add to keystore
                if slicer.util.confirmYesNoDisplay(
                        "{}\nDo you want to consider the following data as trusted in the future:\n{}".format(result['msg'], str(
                    host, port, fprint = result['fingerprint']
                    # write to SSLUtil
                    SSLUtil.fingerprintsLocal.update({fprint: {"port": port, "host": host}})
                    return True
                return False

                # no connection to host
                return False
        return True
github SlicerDMRI / SlicerDMRI / Modules / Scripted / TractographyDownsample / View on Github external
def run(self, inputFiberBundle, outputFiberBundle, fiberStepSize, fiberPercentage, fiberMinPoints, fiberMinLength, fiberMaxLength, enableScreenshots=0, advanced=0):
    Run the actual algorithm

    if not advanced:
      if not self.isValidInputOutputData(inputFiberBundle, outputFiberBundle):
        slicer.util.errorDisplay('Input fiberBundle is the same as output fiberBundle. Choose a different output fiberBundle.')
        return False'Processing started')

    # Compute the thresholded output fiberBundle using the Threshold Scalar FiberBundle CLI module
    #cliParams = {'InputFiberBundle': inputFiberBundle.GetID(), 'OutputFiberBundle': outputFiberBundle.GetID(), 'ThresholdValue' : fiberStepSize, 'ThresholdType' : 'Above'}
    #cliNode =, None, cliParams, wait_for_completion=True)

    # access input data object
    pd = inputFiberBundle.GetPolyData()
    # create a new polydata to hold the output
    outpd = vtk.vtkPolyData()

    # log information about input'Input Fiber Bundle Stats:')
github SlicerProstate / SliceTracker / SliceTracker / SliceTrackerUtils / steps / plugins / View on Github external
def unzipFileAndCopyToDirectory(self, filepath, copyToDirectory):
    import zipfile
      zip_ref = zipfile.ZipFile(filepath, 'r')
      destination = filepath.replace(os.path.basename(filepath), "")
      logging.debug("extracting to %s " % destination)
      self.copyDirectory(filepath.replace(".zip", ""), copyToDirectory)
    except zipfile.BadZipfile as exc:
      if self.session.preopDICOMReceiver:
      slicer.util.errorDisplay("An error appeared while extracting %s. If the file is corrupt, please delete it and try "
                               "again." % filepath, detailedText=str(exc.message))