Skip to content

Instantly share code, notes, and snippets.

View pieper's full-sized avatar

Steve Pieper pieper

View GitHub Profile
@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 / 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' )
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="description"
content="Open Health Imaging Foundation DICOM Viewer"
/>
<meta
@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())
"""
@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())
import os
import shutil
archiveFilePath = os.path.join(slicer.app.temporaryPath, "master.zip")
outputDir = os.path.join(slicer.app.temporaryPath, "SlicerImageStacks")
try:
os.remove(archiveFilePath)
except FileNotFoundError:
pass
@pieper
pieper / make.log
Created August 1, 2020 19:49
make package output on mac
pieper@hive Slicer-build % time make package
[ 0%] Built target ExtensionWizard-Resources
[ 0%] Built target SlicerPythonResources
[ 3%] Built target CopySlicerPythonScriptFiles
[ 3%] Built target CompileSlicerPythonFiles
[ 9%] Built target CopySlicerPythonResourceFiles
[ 12%] Built target SlicerData
[ 12%] Configuring vtkSlicerVersionConfigure.h
-- Configuring Slicer release type [Experimental]
-- Found Git: /usr/local/bin/git
#!/usr/bin/env python
comment = """
You can use this script with either Slicer's python wrapped VTK or with pip installed VTK like this:
~/Downloads/Slicer-4.13.0-2021-06-18-linux-amd64/bin/PythonSlicer vr-depth-crop.py
python vr-depth-crop.py
"""
@pieper
pieper / slicer-compute.py
Created May 21, 2022 20:57
Slicer with python WebGPU compute shader
"""
Install wgpu as described here: https://github.com/pygfx/wgpu-py
Tested with Slicer 5.0.2 and wgpu 537c3eab68e9eef77681fc5545532380df26d8cc (basically 0.8.1)
exec(open("./slicer-compute.py").read())
"""