Skip to content

Instantly share code, notes, and snippets.

View jcreinhold's full-sized avatar

Jacob Reinhold jcreinhold

View GitHub Profile
@jcreinhold
jcreinhold / to_float32.py
Created October 19, 2018 00:29
Cast all NIfTI images in a directory to float32 data type
#/usr/bin/env python
# convert all nifti files in a directory to float32
import argparse
from glob import glob
import os
import sys
import nibabel as nib
@jcreinhold
jcreinhold / prune_on_dim.py
Last active October 19, 2018 01:03
Remove or move NIfTI images in a directory that are not the most common size
#!/usr/bin/env python
# prune files from a directory that are different dimensions than the mode
import argparse
from collections import Counter
from glob import glob
import os
import shutil
import sys
@jcreinhold
jcreinhold / test_transforms.ipynb
Last active April 1, 2019 20:37
test fastai transforms with nifti images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / 3dconv.ipynb
Created October 25, 2018 19:55
test 3d network with Learner class in fastai
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / itemlist.ipynb
Last active November 17, 2018 17:47
implement an itemlist to load in nifti files (as source and target)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / cyclegan.ipynb
Last active December 7, 2018 02:51
fastai CycleGAN
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / rpca_cpu.py
Created December 11, 2018 23:38
CPU RPCA and SVT
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
rpca_cpu
implementations of RPCA on the CPU for low-rank and sparse
matrix decomposition as well as a nuclear-norm
minimization routine via singular value thresholding
for matrix completion
@jcreinhold
jcreinhold / rpca_gpu.py
Last active November 10, 2024 14:41
GPU RPCA and SVT
#!/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
@jcreinhold
jcreinhold / test_flux_gpu.ipynb
Created December 23, 2018 20:25
Test Flux with GPU
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / nii_to_tif.py
Last active August 1, 2023 18:23
Convert NIfTI images into multiple TIF images
#!/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)