Skip to content

Instantly share code, notes, and snippets.

View utooley's full-sized avatar

Ursula Tooley utooley

View GitHub Profile
@dfsp-spirit
dfsp-spirit / gist:d63a6b56f2c11c92086a81911138b453
Last active September 7, 2021 20:08
Modyfying meshes in fsbrain's interactive view using a pre-render hook
# This currently requires fsbrain dev, >= 0.5.0.
#
# You will need to install with:
#
# devtools::install_github("dfsp-spirit/fsbrain", ref="geodesic");
#
# until 0.5.0 is available on CRAN.
#
library(fsbrain)
@gavinsimpson
gavinsimpson / animated-basis-functions.R
Created November 8, 2019 01:36
Animation showing how weighted basis functions combine to yield a cubic regression spline
## Procuces an animation showing how weighted basis functions combine to produce a sline
## - this version is for a cubic regression spline basis
## packages required
library('ggplot2')
library('tibble')
library('tidyr')
library('dplyr')
library('mgcv')
library('mvnfast')
#!/usr/bin/env python
import pandas as pd
import numpy as np
from argparse import ArgumentParser
import sys
import os
def parse_outliers(outliers, volumes):
if not outliers:
@tsalo
tsalo / assign_intendedfor.py
Created April 18, 2017 21:39
Add "IntendedFor" field to BIDS field map jsons for the associated fMRI and DWI scans based on acquisition time.
import json
import bisect
from glob import glob
from os.path import join, splitext
from bids.grabbids import BIDSLayout
from dateutil.parser import parse
# subj_dir *must* have trailing /
subj_dir = '/scratch/tsalo006/dset/sub-01/'
sess = '01'