Skip to content

Instantly share code, notes, and snippets.

View bodokaiser's full-sized avatar
😀
Happy to be here!

Bodo Kaiser bodokaiser

😀
Happy to be here!
View GitHub Profile
@bodokaiser
bodokaiser / init.vim
Last active March 18, 2017 12:30
Neovim config
set nocompatible
syntax on
filetype off
set termguicolors
set novisualbell
set nobackup
set noswapfile
set number
@bodokaiser
bodokaiser / transform.py
Created March 6, 2017 08:00
Crops a pair of MRI and US images such that there are no zero areas.
import numpy as np
from skimage.filters import threshold_otsu
class RegionCrop(object):
def __call__(self, mr: np.ndarray, us: np.ndarray):
if np.any(mr) and np.any(us):
mask = us > threshold_otsu(us)
@bodokaiser
bodokaiser / Makefile
Created November 19, 2016 20:47
Directory iteration
PATH := /opt/minc-itk4/bin:$(PATH)
#patients := $(foreach p, $(wildcard data/*), $(p:data/%=%))
#patients := $(foreach p, $(wildcard data/*), $(dir $(p)))
patients := $(shell find data -depth 1 -type d | sed -e "s/data\///g")
process:
@for p in $(patients); do \
mincconvert -2 \
def read_label(queue):
reader = tf.TextLineReader(1)
_, buffer = reader.read(queue)
return decode_label(buffer)
def decode_label(buffer):
return tf.decode_csv(buffer, [[''],[0]])
def read_image(queue):
reader = tf.WholeFileReader()
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('/tmp/mnist', one_hot=True)
sess = tf.Session(
config=tf.ConfigProto(
gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.3)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* save under ./app/index.js */
import React, {Component} from 'react'
import {render} from 'react-dom'
import {Link, Router, Route, browserHistory} from 'react-router'
class Home extends Component {
render() {
return (
var vo = require('vo')
var nightmare = require('nightmare')
// vo ist eine Hilfe um Funktionen mit einem "*" auszuführen
// Funktionen mit einem "*" können nämlich einfacher Operationen
// machen wo man warten muss (z.B. eine Seite laden)
vo(crawl)((err,res) => {
if (err) throw err;
// hier geben wir das Ergebnis unseres Besuches aus
@bodokaiser
bodokaiser / opencv.rb
Created April 23, 2015 17:42
Homebrew opencv file with python3 support.
class Opencv < Formula
homepage "http://opencv.org/"
head "https://github.com/Itseez/opencv.git"
stable do
url "https://github.com/Itseez/opencv/archive/2.4.11.tar.gz"
sha256 "b5331ea85a709b0fe871b1ce92e631afcd5ae822423863da6b559dd2cb7845bc"
# Avoid explicit links to a Python framework
# https://github.com/Itseez/opencv/pull/3865
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.