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 slicer | |
from __main__ import qt | |
from __main__ import ctk | |
######################################################### | |
# | |
# | |
comment = """ |
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
>>> o = vtk.vtkOBJExporter() | |
>>> o.SetFilePrefix('/tmp/obj/fibers') | |
>>> lm = slicer.app.layoutManager() | |
>>> tdv = lm.threeDWidget(0).threeDView() | |
>>> rw = tdv.renderWindow() | |
>>> o.SetRenderWindow(rw) | |
>>> o.Write() |
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 | |
from __main__ import vtk, qt, ctk, slicer | |
# | |
# VolumeScroller | |
# | |
class VolumeScroller: | |
def __init__(self, parent): |
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
""" | |
Run this with a label map loaded in the slicer editor. | |
Change this path to be wherever you save this file and then paste | |
the line into the slicer python console: | |
execfile('/Users/pieper/Dropbox/hacks/slicer/decruft.py') | |
This script will apply the algorithm and display the result. | |
You can use the editor's undo operation to get back to the |
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
""" | |
The following can be pasted into the python console to examine the headers | |
of all the dicom objects in the database | |
""" | |
import DICOMLib | |
parent = qt.QWidget() | |
layout = qt.QVBoxLayout() | |
parent.setLayout(layout) |
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
lm = slicer.app.layoutManager() | |
tw = lm.threeDWidget(0) | |
tv = tw.threeDView() | |
rw = tv.renderWindow() | |
ren = rw.GetRenderers().GetItemAsObject(0) | |
wti = vtk.vtkWindowToImageFilter() | |
wti.SetMagnification(4) | |
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
var current = document.createElement('p'); | |
document.body.appendChild(current); |
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
diffs: | |
#6 Slicer (support-qt5 *$>)$ git diff | |
diff --git a/Base/QTGUI/qSlicerWebWidget.h b/Base/QTGUI/qSlicerWebWidget.h | |
index 4eb852681..362115fd8 100644 | |
--- a/Base/QTGUI/qSlicerWebWidget.h | |
+++ b/Base/QTGUI/qSlicerWebWidget.h | |
@@ -40,7 +40,8 @@ class QWebEngineView; | |
#endif |
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 WebServer | |
tracts = ['AF', 'CST_M1', 'IFOF', 'ILF', 'UF']; | |
exportDirectory = '/Volumes/encrypted/data/AG/AG1611-SlicerWeb/tracts' | |
targetTubeCount = 100 | |
for tract in tracts: | |
tubeNodes = slicer.util.getNodes('vtkMRMLFiberBundleTubeDisplayNode*', useLists=True).values() | |
for tubeNode in tubeNodes[0]: |
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
// This can be pasted into the wip-add-dcmjs branch of [email protected]:ohif/Viewers | |
// to store current length measurements back to the source DICOMweb server. | |
function parametersFromImageId(imageId) { | |
const decodedImageId = decodeURIComponent(imageId); | |
return(new URLSearchParams(decodedImageId)); | |
} | |
function parametersFromToolState() { | |
const imageToolState = cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState(); |
OlderNewer