Slicer
4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Modules
Loadable
SubjectHierarchy
Widgets
Python
AbstractScriptedSubjectHierarchyPlugin.py
Go to the documentation of this file.
1
import
os
2
import
vtk, qt, ctk, slicer, logging
3
4
#
5
# Abstract class of python scripted subject hierarchy plugins
6
#
7
8
class
AbstractScriptedSubjectHierarchyPlugin
(object):
9
""" Abstract scripted subject hierarchy plugin for python scripted plugins
10
11
USAGE: Instantiate scripted subject hierarchy plugin adaptor class from
12
module (e.g. from setup function), and set python source:
13
14
from SubjectHierarchyPlugins import *
15
...
16
class [Module]Widget(ScriptedLoadableModuleWidget):
17
...
18
def setup(self):
19
...
20
scriptedPlugin = slicer.qSlicerSubjectHierarchyScriptedPlugin(None)
21
scriptedPlugin.setPythonSource(VolumeClipSubjectHierarchyPlugin.filePath)
22
...
23
24
Example can be found here: https://subversion.assembla.com/svn/slicerrt/trunk/VolumeClip/src
25
"""
26
27
def
__init__
(self, scriptedPlugin):
28
self.
scriptedPlugin
= scriptedPlugin
29
30
# Register plugin on initialization
31
self.
register
()
32
33
def
register
(self):
34
pluginHandlerSingleton = slicer.qSlicerSubjectHierarchyPluginHandler.instance()
35
pluginHandlerSingleton.registerPlugin(self.
scriptedPlugin
)
36
logging.debug(
'Scripted subject hierarchy plugin registered: '
+ self.
scriptedPlugin
.name)
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:8
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.__init__
def __init__(self, scriptedPlugin)
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:27
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.scriptedPlugin
scriptedPlugin
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:28
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.register
def register(self)
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:33
Generated on Mon May 2 2022 16:14:14 for Slicer by
1.8.14