Skip to content

Instantly share code, notes, and snippets.

View arokem's full-sized avatar
🎯
Focusing

Ariel Rokem arokem

🎯
Focusing
View GitHub Profile
@arokem
arokem / fmri_tnsr.py
Created April 22, 2011 20:29
This is a program for calculating TSNR images from fMRI nifti files
"""
Compute the TSNR of a bunch of nifti files and generate the equivalent nifti
SNR 3Ds.
Depends on nibabel, matplotlib and scipy
"""
import os
"""
Stochastic Gradient Descent
This is adapted from Kendrick Kay's Matlab SGD code.
"""
import scipy.sparse as sps
import numpy as np
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import json
import tempfile
import os
import os.path as op
import numpy as np
import nibabel as nib
from bids.layout import BIDSLayout
def touch(fname, times=None):
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arokem
arokem / dicom2nifti.py
Created April 22, 2011 20:33
This runs FSL motion correction on a bunch of epis and plots the motion correction params
"""
This script takes the raw dicoms as they come off the scanner,
converts to nifti and runs FSL motion correction.
Also makes a plot of the motion correction parameters.
Depends on matplotlib, FSL, dcm2nii
"""
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.