How to use the slicer.mrmlScene.Clear 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 SlicerDMRI / SlicerDMRI / Modules / Loadable / TractographyDisplay / Testing / Python / test_tractography_display.py View on Github external
def setUp(self):
    """ Do whatever is needed to reset the state - typically a scene clear will be enough.
    """
    slicer.mrmlScene.Clear(0)
    #
    # first, get some data
    #
    import urllib
    downloads = (
        ('http://slicer.kitware.com/midas3/download?items=5768', 'tract1.vtk', slicer.util.loadFiberBundle),
        )

    for url,name,loader in downloads:
      filePath = slicer.app.temporaryPath + '/' + name
      if not os.path.exists(filePath) or os.stat(filePath).st_size == 0:
        print('Requesting download %s from %s...\n' % (name, url))
        urllib.urlretrieve(url, filePath)
      if loader:
        print('Loading %s...\n' % (name,))
        loader(filePath)
github SlicerRt / SlicerRT / SegmentEditor / SegmentEditor.py View on Github external
def setUp(self):
    """ Do whatever is needed to reset the state - typically a scene clear will be enough.
    """
    slicer.mrmlScene.Clear(0)
github SlicerRt / SlicerRT / Segmentations / Testing / Python / SegmentationsModuleTest1.py View on Github external
def setUp(self):
    """ Do whatever is needed to reset the state - typically a scene clear will be enough.
    """
    slicer.mrmlScene.Clear(0)
github SlicerHeart / SlicerHeart / CardiacDeviceSimulator / CardiacDeviceSimulator.py View on Github external
def setUp(self):
    """ Do whatever is needed to reset the state - typically a scene clear will be enough.
    """
    slicer.mrmlScene.Clear(0)
github smclach / PedicleScrewSimulator / PedicleScrewSimulator / PedicleScrewSimulator.py View on Github external
def setUp(self):
    """ Do whatever is needed to reset the state - typically a scene clear will be enough.
    """
    slicer.mrmlScene.Clear(0)