This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source ${FSLDIR}/etc/fslconf/fsl.sh | |
jupyter-lab --ip=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set +x | |
# This bash script: | |
# 1. adds the CRAN repository | |
# 2. installs R | |
# 3. installs R packages for AFNI | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script merges multiple ReproZip version 2 pack files. | |
# | |
# Example: | |
# | |
# bash merge_packfiles.sh -o merged.rpz packA.rpz packB.rpz packC.rpz | |
# | |
# | |
# Requires reprozip and rsync. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Example of how to get volume of tumor from mask NIfTI.""" | |
import nibabel as nb | |
# The mask nifti image has contains a 1 in voxels that contain | |
# tumor and a 0 in voxels that do not contain tumor. | |
mask_filepath = "/path/to/tumor_mask.nii.gz" | |
img = nb.load(mask_filepath) | |
data = img.get_fdata() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import neurodocker | |
specs = {'pkg_manager': 'apt', 'instructions': [['base', 'debian'], ['install', ['git', 'vim']]]} | |
dockerfile_string = neurodocker.Dockerfile(specs).render() | |
print(dockerfile_string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:trusty | |
RUN apt-get -qq update \ | |
&& apt-get install -yq --no-install-recommends \ | |
curl \ | |
git \ | |
graphviz \ | |
libgraphviz-dev \ | |
pkg-config \ | |
software-properties-common \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Filter slides with red titles from powerpoints, and save the filtered slides as one PDF file. | |
This script can only be run on Windows because it requires some Windows-specific libraries. | |
How to use | |
---------- | |
- Install comtypes, pypdf2, and python-pptx using pip. Powerpoint must also be installed. | |
- Put all of the powerpoints to be filtered in one directory. | |
- Navigate to that directory in a terminal. | |
- Run this script. After some time, a file will be created named "output.pdf" with the filtered slides. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Training a bayesian neural network with mirrored strategy. | |
# When using `model.fit`, the keras symbolic tensor error arises, and the common fix of | |
# experimental_run_tf_function=False does not fix it. Creating our own training loop seems to fix it. | |
# With lots of help from https://www.tensorflow.org/tutorials/distribute/custom_training#training_loop | |
from nobrainer.models import bayesian | |
import numpy as np | |
import tensorflow as tf | |
# Set up multi-gpu things. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"math" | |
"os" | |
"path" | |
"sort" |
OlderNewer