Skip to content

Instantly share code, notes, and snippets.

View haehn's full-sized avatar
🤠

Daniel Haehn haehn

🤠
View GitHub Profile
@haehn
haehn / gist:1274156
Created October 9, 2011 20:50
Extract YouTube Annotations
import xml.dom.minidom
import urllib2
import sys
from urlparse import urlparse
from datetime import datetime
import time
def sort(adict):
''' sort a map by keys '''
items = adict.items()
@haehn
haehn / gist:5614966
Created May 20, 2013 19:52
Load an ITK transform file in Python.
def readITKtransform( transform_file ):
'''
'''
# read the transform
transform = None
with open( transform_file, 'r' ) as f:
for line in f:
# check for Parameters:
@haehn
haehn / trackvis.py
Last active December 17, 2015 13:49 — forked from satra/trackvis.py
import numpy as np
from nibabel import load
import nibabel.trackvis as nibtrk
# filename = "DeterministicTractography/QBALLRecon/hardiO10.trk"
trkfilename = "/software/data/STUT/DTI_TV/PWS04/dtk_35/dti_35.trk" #%hardiO10.trk_cross_streamline_id_20.trk"
trkfilename_out = "newtracks.trk"
bfilename = "/software/data/STUT/DTI_TV/PWS04/dt_recon/lowb.nii"
mrfilename = "/software/data/MIBR/data/PWS04/head.nii"

Keybase proof

I hereby claim:

  • I am haehn on github.
  • I am haehn (https://keybase.io/haehn) on keybase.
  • I have a public key whose fingerprint is 848A E455 F72E 75BE 2776 C457 BFE5 EA96 3DA6 5BA3

To claim this, I am signing this object:

@haehn
haehn / creative_commons_4_by_license.tex
Created January 12, 2019 21:23
Creative Commons Attribution 4.0 International Public License LaTeX Code
%
%
% Creative Commons Attribution 4.0 International Public License
% from: https://creativecommons.org/licenses/by/4.0/legalcode
%
\RequirePackage{enumitem} % we need this
\setlistdepth{9} % and this
\section{Creative Commons Attribution 4.0 International Public License}
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>CS460 Assignment 2</title>
<style>
body {
background-color: black;
color: white; /* font color */
font-family: sans-serif;
@haehn
haehn / index.html
Created September 27, 2019 03:33
CS460 Assignment 3
<html>
<head>
<meta charset="UTF-8" />
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden !important;
@haehn
haehn / solution.html
Created October 9, 2019 02:36
CS460 Assignment 4
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Vanilla WebGL!</title>
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;
@haehn
haehn / index.html
Created October 18, 2019 02:49
CS460 Assignment 5
<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 23, 2019 19:18
CS460 Assignment 6 Code from Wednesday
<html>
<head>
<meta charset="UTF-8" />
<style>
html, body {
background-color:#000;
margin: 0;
padding: 0;
height: 100%;
overflow: hidden !important;