Skip to content

Instantly share code, notes, and snippets.

View haehn's full-sized avatar
🤠

Daniel Haehn haehn

🤠
View GitHub Profile
@haehn
haehn / stack.html
Last active April 15, 2022 01:09
Cornerstone.js DICOM Stack+Brush
<html>
<head>
<script src="https://unpkg.com/cornerstone-core/dist/cornerstone.min.js
"></script>
<script src="https://unpkg.com/cornerstone-wado-image-loader"></script>
<script src="https://unpkg.com/dicom-parser"></script>
<script src="https://unpkg.com/cornerstone-math"></script>
<script src="https://unpkg.com/cornerstone-tools"></script>
<script src="https://unpkg.com/hammerjs"></script>
<script>
@haehn
haehn / brush.html
Created April 9, 2022 22:52
Cornerstone.js DICOM Brush Example
<html>
<head>
<script src="https://unpkg.com/cornerstone-core/dist/cornerstone.min.js
"></script>
<script src="https://unpkg.com/cornerstone-wado-image-loader"></script>
<script src="https://unpkg.com/dicom-parser"></script>
<script src="https://unpkg.com/cornerstone-math"></script>
<script src="https://unpkg.com/cornerstone-tools"></script>
<script src="https://unpkg.com/hammerjs"></script>
<script>
@haehn
haehn / view.html
Last active April 9, 2022 21:50
Cornerstone.js DICOM Viewer
<html>
<head>
<script src="https://unpkg.com/cornerstone-core/dist/cornerstone.min.js
"></script>
<script src="https://unpkg.com/cornerstone-wado-image-loader"></script>
<script src="https://unpkg.com/dicom-parser"></script>
<script>
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
@haehn
haehn / load.html
Created April 9, 2022 21:30
Cornerstone.js DICOM Minimal example
<html>
<head>
<script src="https://unpkg.com/cornerstone-core/dist/cornerstone.min.js
"></script>
<script src="https://unpkg.com/cornerstone-wado-image-loader"></script>
<script src="https://unpkg.com/dicom-parser"></script>
<script>
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
element = cornerstone.getEnabledElements()[0];
pixels = element.image.getPixelData();
new_pixels = Sobel(pixels, element.image.width, element.image.height);
pixels.set(new_pixels);
element.needsRedraw = true;
Robot = function(x, y, z) {
// create head, neck, and torso
var fromhelper = HELPER.cylinderSkeletonMesh(3, 5, 'blue')
var geometry = fromhelper[0];
var material = fromhelper[1];
var bones = fromhelper[2];
var mesh = new THREE.SkinnedMesh( geometry, material );
var skeleton = new THREE.Skeleton( bones );
@haehn
haehn / index.html
Last active November 4, 2022 15:35
Assignment 6 Solution 2022
<html>
<head>
<meta charset="UTF-8" />
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden !important;
@haehn
haehn / robot.js
Created October 29, 2020 10:31
Lecture 21 Robot OO Code
Robot = function(x, y, z) {
this.head = new THREE.Bone();
this.head.position.x = x; // world coordinates
this.head.position.y = y;
this.head.position.z = z;
this.neck = new THREE.Bone();
this.neck.position.y = -10;
@haehn
haehn / index.html
Created October 16, 2020 01:31
XTK + Three.js renderer
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<style>
html, body {
background-color: #000;
margin: 0;
padding: 0;
@haehn
haehn / index.html
Created October 5, 2020 02:05
WebGL uniform code
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Default WebGL!</title>
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;