Instantly share code, notes, and snippets.

View CornerstoneDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View volume_labelmap.py
from glob import glob
import os
cur_glob = '/Volumes/NO NAME/*seg.nii'
files_to_process = glob(cur_glob)
print('Processing', len(files_to_process), 'files')
def process_file(in_path):
slicer.mrmlScene.Clear(0)
[success, loadedVolumeNode] = slicer.util.loadVolume(in_path, returnNode=True)
outputLabelMap = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')
vol_logic = slicer.modules.volumes.logic()
View jupyanno.html
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Thebe Lab examples</title>
<link rel="stylesheet" type="text/css" href="index.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js">
</script>
<!-- Configure and load Thebe !-->
View ImageEnhancementPlayground.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View README.md

How to display output

How to display reasonable output from a RCNN in JS

View CNN_MNIST_PlaidML.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View AnalysisSubmitTool.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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.