This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* General styling */ | |
QWidget { | |
background-color: #2a2a2a; | |
color: #B7B7B7; | |
} | |
QPushButton { | |
background-color: #434343; | |
border: 2px #434343; | |
border-radius: 3px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slicer.mrmlScene.Clear() | |
shNode = slicer.mrmlScene.GetSubjectHierarchyNode() | |
import SampleData | |
node = SampleData.downloadSample('MRHead') | |
subjectItem = shNode.CreateSubjectItem(shNode.GetSceneItemID(),'Greg') | |
studyItem = shNode.CreateStudyItem(subjectItem, 'Study1') | |
nodeItem = shNode.GetItemByDataNode(node) | |
shNode.SetItemParent(nodeItem, studyItem) | |
widget = slicer.qMRMLSubjectHierarchyTreeView() | |
widget.setMRMLScene(slicer.mrmlScene) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getActiveVolume(): | |
lm = slicer.app.layoutManager() | |
sliceLogic = lm.sliceWidget('Red').sliceLogic() | |
compositeNode = sliceLogic.GetSliceCompositeNode() | |
return compositeNode.GetBackgroundVolumeID() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toggleVolumeRenderVisibility(self, visible): | |
volumeNode = <volume node however you get it> | |
NodeCombo = slicer.util.findChild(self.volumerenderWidget, 'VolumeNodeComboBox') | |
VisibilityCheckBox = slicer.util.findChild(self.volumerenderWidget, 'VisibilityCheckBox') | |
volRenLogic = slicer.modules.volumerendering.logic() | |
if volumeNode is not NodeCombo.currentNode(): | |
displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode) | |
displayNode.SetVisibility(visible) | |
displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName("CT-AAA")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def onConnectAppButton(self): | |
import win32gui | |
import win32con | |
import time | |
# Launch the application | |
proc = qt.QProcess() | |
proc.setProgram("/path/to/application") | |
proc.startDetached() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import unittest | |
import logging | |
import vtk, qt, ctk, slicer | |
from slicer.ScriptedLoadableModule import * | |
from slicer.util import VTKObservationMixin | |
# | |
# SequenceToImageStack | |
# |