-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path3d startup file.txt
37 lines (28 loc) · 1.52 KB
/
3d startup file.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Python commands in this file are executed on Slicer startup
# Examples:
#
# Load a scene file
# slicer.util.loadScene('c:/Users/SomeUser/Documents/SlicerScenes/SomeScene.mrb')
#
# Open a module (overrides default startup module in application settings / modules)
#slicer.util.mainWindow().moduleSelector().selectModule('SegmentEditor')
#
slicer.util.findChild(slicer.util.mainWindow(), 'LogoLabel').visible = False#remove logo to make space
#change colours of 3d viewer to be a black-white gradient
viewNode = slicer.app.layoutManager().threeDWidget(0).mrmlViewNode()
viewNode.SetBackgroundColor(1,1,1)
viewNode.SetBackgroundColor2(0,0,0)
#remove bounding box and orientation axes (a,s,r)
viewNode.SetBoxVisible(0)
viewNode.SetAxisLabelsVisible(0)
shortcuts = [
('Ctrl+b', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpRedSliceView)),
('Ctrl+n', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpYellowSliceView)),
('Ctrl+m', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpGreenSliceView)),
('Ctrl+,', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView)),
('Ctrl+.', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUp3DView))
]
for (shortcutKey, callback) in shortcuts:
shortcut = qt.QShortcut(slicer.util.mainWindow())
shortcut.setKey(qt.QKeySequence(shortcutKey))
shortcut.connect( 'activated()', callback)