Skip to content

Instantly share code, notes, and snippets.

Kevin Mader kmader

  • Magic Leap
  • Zurich, Switzerland
Block or report user

Report or block kmader

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View R Snippet for reading dicom headers
library(tidyverse)
library(oro.dicom)
knime.in$Location %>%
plyr::ldply(function(in_path) {
readDICOMFile(as.character(in_path), pixelData = F)$hdr %>%
group_by(name) %>% summarize_all(funs(first)) %>% # remove duplicate names
select(name, value) %>% spread(name, value) %>% # reformat as a table
head(1)
}
) -> all_header
@kmader
kmader / material_switch.css
Last active Jul 26, 2017
Here is a collection of useful CSS files that I 'host' on gist for use in dash-apps
View material_switch.css
.material-switch > input[type="checkbox"] {
display: none;
}
.material-switch > label {
cursor: pointer;
height: 0px;
position: relative;
width: 40px;
}
View DashDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / Overview.md
Created May 8, 2017
pyspark change environment and serializer
View Overview.md

Change Configuration / Environment

Often it is important to change a core configuration setting in pyspark before running (like a serializer, PYTHONHASHSEED for python3 users, or

from pyspark import SparkContext
from pyspark.serializers import PickleSerializer
new_conf = sc._conf.setExecutorEnv('PYTHONHASHSEED', '1234')
sc.stop()
sc = pyspark.SparkContext(conf = new_conf, serializer = PickleSerializer())
@kmader
kmader / 0-Overview.md
Last active Mar 21, 2017
KNIME DICOM Reading Issue
View 0-Overview.md

Loading Issue

I think the image loading problem is related to the 'Load group files' checkbox, if you leave it unchecked it seems to work fine.

The error message is:

ERROR Image Reader         3:38       Execute failed: Encountered duplicate row ID  "/Users/mader/Documents/TCGA_DICOMS/DOI/TCGA-17-Z011/1.3.6.1.4.1.14519.5.2.1.7777.9002.119175415668704314181906368452/1.3.6.1.4.1.14519.5.2.1.7777.9002.147921136202653008422021343284/000000.dcm" at row number 3

The test file is attached as 000000.dcm

View stage1_labels.csv
id cancer
0015ceb851d7251b8f399e39779d1e7d 1
0030a160d58723ff36d73f41b170ec21 0
003f41c78e6acfa92430a057ac0b306e 0
006b96310a37b36cccb2ab48d10b49a3 1
008464bb8521d09a42985dd8add3d0d2 1
0092c13f9e00a3717fdc940641f00015 0
00986bebc45e12038ef0ce3e9962b51a 0
00cba091fa4ad62cc3200a657aeb957e 0
00edff4f51a893d80dae2d42a7f45ad1 1
@kmader
kmader / README.md
Last active Jan 17, 2017
DictDialog in pyqt
View README.md

Overview

Creates a simple dialog box based on a dictionary with various keys like (check, list, and linedit)

@kmader
kmader / Simple_Submission.ipynb
Created Dec 11, 2016
A python script for making a submission to the InClass Kaggle competition for Micro and Nano Tomography
View Simple_Submission.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / README.md
Last active Oct 21, 2016
Important Docker Python Packages
View README.md

Deep Learning / Tensorflow

# Install Python 3 Tensorflow
RUN conda install --quiet --yes 'tensorflow=0.9.0'
# Keras
RUN conda install --channel https://conda.anaconda.org/KEHANG --quiet --yes 'keras=1.0.8'

Elephas

@kmader
kmader / README.md
Created Oct 20, 2016
UNET to KNIME
View README.md

Goal: Keras to KNIME

Model Conversion

JSON -> KNIME Workflow

The model file is below as a json output.

Weight Importing

Original (better)

Original weights are stored in HDF5

You can’t perform that action at this time.