Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠

Daniel Haehn haehn

🤠
View GitHub Profile
@haehn
haehn / stack.html
Last active Apr 15, 2022
Cornerstone.js DICOM Stack+Brush
View stack.html
<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 Apr 9, 2022
Cornerstone.js DICOM Brush Example
View brush.html
<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 Apr 9, 2022
Cornerstone.js DICOM Viewer
View view.html
<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 Apr 9, 2022
Cornerstone.js DICOM Minimal example
View load.html
<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;
View cornerstoneSobel.js
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;
View Robot.js with SkinnedMesh (WIP)
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 Nov 5, 2021
Assignment 6 Solution 2021
View index.html
<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 Oct 29, 2020
Lecture 21 Robot OO Code
View robot.js
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 Oct 16, 2020
XTK + Three.js renderer
View index.html
<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 Oct 5, 2020
WebGL uniform code
View index.html
<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;