Skip to content

Instantly share code, notes, and snippets.

View pieper's full-sized avatar

Steve Pieper pieper

View GitHub Profile
@pieper
pieper / facehead.py
Created May 19, 2020 15:25
Slicer, open3d, azure kinect, MRHead
"""
pip_install("open3d")
rename "/c/Program\ Files/Azure\ Kinect\ SDK\ v1.4.0/tools/k4a.dll" by changing 1.4 to 1.2
path="c:/pieper/facenav/facenav.py"
exec(open(path).read())
@pieper
pieper / guide.py
Last active December 26, 2022 00:16
Slicer CPPYY example
# Copyright Steve Pieper
# https://github.com/Slicer/Slicer/blob/master/License.txt
# Demo video: https://youtu.be/xcQKj4yp2nw
"""
exec(open('/Users/pieper/slicer/latest/SlicerTMSGuide/guide.py', 'r').read())
"""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="description"
content="Open Health Imaging Foundation DICOM Viewer"
/>
<meta
et install libqt5webchannel5-dev
63 rm -rm *
64 rm -rf *
65 ~/Support/cmake-3.13.4-Linux-x86_64/bin/cmake ../slicer/
66 rm -rf *
67 apt-file search Qt5WebEngineWidgetsConfig.cmake
68 sudo apt-get install qtwebengine5-dev
69 ~/Support/cmake-3.13.4-Linux-x86_64/bin/cmake ../slicer/
70 rm -rf *
71 apt-file search Qt5XmlPatternsConfig.cmake
@pieper
pieper / workflow.py
Created March 3, 2019 21:01
example workflow for robot control
#
# create classes defining the behavior of each step
#
class sInitial(ctk.ctkWorkflowWidgetStep, ) :
"""Initial state of the MRRobot workflow"""
def __init__(self, stepid, workflowWidget):
self.initialize(stepid)
self.workflowWidget = workflowWidget
self.setName( 'Create or load a case' )
@pieper
pieper / iodide-dcmjs-vtkjs
Created November 22, 2018 20:09
iodide example of dicom SEG plus vtkjs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>dcmjs-example - iodide</title>
<link rel="stylesheet" type="text/css" href="https://iodide.io/stable/iodide.stable.css">
</head>
<body>
<script id="jsmd" type="text/jsmd">
%% meta
@pieper
pieper / stowSR.js
Last active May 8, 2018 13:17
save OHIFVIewer length as SR
// This can be pasted into the wip-add-dcmjs branch of git@github.com: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();
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]:
@pieper
pieper / gist:59de820ad08cf3c0f7a33926397e612d
Created January 30, 2017 14:47
slicer-qt5 mac build work in progress
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
var current = document.createElement('p');
document.body.appendChild(current);