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 python | |
# -*- coding: utf-8 -*- | |
""" | |
rpca_gpu | |
implementations of RPCA on the GPU (leveraging pytorch) | |
for low-rank and sparse matrix decomposition as well as | |
a nuclear-norm minimization routine via singular value | |
thresholding for matrix completion |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
nii_to_tif | |
command line executable to convert 3d nifti images to | |
individual tiff images along a user-specified axis | |
call as: python nii_to_tif.py /path/to/nifti /path/to/tif | |
(append optional arguments to the call as desired) |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
tif_to_nii | |
command line executable to convert a directory of tif images | |
(from one image) to a nifti image stacked along a user-specified axis | |
call as: python tif_to_nii.py /path/to/tif/ /path/to/nifti | |
(append optional arguments to the call as desired) |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
nii_to_tif | |
convert all mha files in a directory to nifti | |
Author: Jacob Reinhold (jacob.reinhold@jhu.edu) | |
""" |
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
--- | |
title: "On the distribution of p-values" | |
output: html_notebook | |
--- | |
```{r} | |
sample.sizes <- seq(5, 100, 10) | |
num.trials <- 1000 | |
num.experiments <- 1 | |
null.mu <- 0.0 |
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 python | |
# -*- coding: utf-8 -*- | |
"""Normalize the intensity of an image by | |
finding a tissue mean in the foreground and | |
voxel-wise dividing the image by that value | |
Author: Jacob Reinhold | |
""" | |
import sys | |
from argparse import ArgumentParser |
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
let swap arr i j = | |
let tmp = arr.(j) in | |
arr.(j) <- arr.(i); | |
arr.(i) <- tmp | |
let partition arr l h = | |
let pivot = arr.(h) in | |
let i = ref @@ (l - 1) in | |
for j = l to h - 1 do | |
if arr.(j) <= pivot then begin |
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
let swap arr i j = | |
let tmp = arr.(j) in | |
arr.(j) <- arr.(i); | |
arr.(i) <- tmp | |
let partition arr l h = | |
let pivot = arr.(h) in | |
let i = ref @@ (l - 1) in | |
for j = l to h - 1 do | |
if arr.(j) <= pivot then begin |
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
# pymedio is used here because it opens a wide variety of | |
# medical image formats but you can use 'nibabel', 'pydicom', | |
# or 'SimpleITK' and extract the pixel data as an array and | |
# use the same functions to test equality | |
from pymedio.image import Image | |
# 'query_image' and 'target_image' can be most common medical | |
# image formats, e.g., NIfTI, directory of DICOM frames, etc. | |
query = Image.from_path("path/to/query_image") | |
target = Image.from_path("path/to/target_image") |
NewerOlder