Slicer
5.2
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
logging
2
3
import
slicer
4
5
6
#
7
# Abstract class of python scripted subject hierarchy plugins
8
#
9
10
class
AbstractScriptedSubjectHierarchyPlugin
:
11
""" Abstract scripted subject hierarchy plugin for python scripted plugins
12
13
USAGE: Instantiate scripted subject hierarchy plugin adaptor class from
14
module (e.g. from setup function), and set python source:
15
16
from SubjectHierarchyPlugins import *
17
...
18
class [Module]Widget(ScriptedLoadableModuleWidget):
19
...
20
def setup(self):
21
...
22
scriptedPlugin = slicer.qSlicerSubjectHierarchyScriptedPlugin(None)
23
scriptedPlugin.setPythonSource(VolumeClipSubjectHierarchyPlugin.filePath)
24
...
25
26
Example can be found here: https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#subject-hierarchy-plugin-offering-view-context-menu-action
27
"""
28
29
def
__init__
(self, scriptedPlugin):
30
self.
scriptedPlugin
= scriptedPlugin
31
32
# Register plugin on initialization
33
self.
register
()
34
35
def
register
(self):
36
pluginHandlerSingleton = slicer.qSlicerSubjectHierarchyPluginHandler.instance()
37
pluginHandlerSingleton.registerPlugin(self.
scriptedPlugin
)
38
logging.debug(
'Scripted subject hierarchy plugin registered: '
+ self.
scriptedPlugin
.name)
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:10
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.__init__
def __init__(self, scriptedPlugin)
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:29
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.scriptedPlugin
scriptedPlugin
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:30
Python.AbstractScriptedSubjectHierarchyPlugin.AbstractScriptedSubjectHierarchyPlugin.register
def register(self)
Definition:
AbstractScriptedSubjectHierarchyPlugin.py:35
Generated on Thu Nov 24 2022 07:48:28 for Slicer by
1.8.14