Skip to content

Instantly share code, notes, and snippets.

@mwaskom
mwaskom / SDT_Tutorial.ipynb
Last active June 11, 2024 15:48
Translation of Justin Gardner's Signal Detection Theory tutorial from MATLAB into Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / diffusion_tutorial.ipynb
Created March 23, 2016 18:02
Translation of Justin Gardner's drift diffusion tutorial from MATLAB into Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / palmer_ddm.py
Created March 22, 2016 04:22
Context-dependent proportional-rate diffusion model
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats
from scipy.optimize import minimize
def ddm_pc(x, k, A, lam):
"""Bernouli likelihood given diffusion model parameters."""
return lam + (1 - 2 * lam) * (1 / (1 + np.exp(-2 * A * k * x)))
@mwaskom
mwaskom / better_color_wheel.ipynb
Last active December 15, 2016 11:59
Better circular colormap using CIE Lch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / seaborn_dark_background.ipynb
Created December 3, 2015 19:49
Use seaborn with a dark background, if you like that sort of thing.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / unpack_sticks.py
Last active September 1, 2015 00:37
Organize data after downloading from nims
"""Unpack nims data into the lyman directory structure.
Should be run from the root data directory.
"""
from __future__ import print_function
import os
import sys
import os.path as op
import shutil
from glob import glob
@mwaskom
mwaskom / grab_image_from_scanner.py
Last active August 29, 2015 14:20
Retrieve an image from the current exam off the scanner DICOM server.
#! /usr/bin/env python
"""Retrieve an image from a specific series in the current exam."""
from __future__ import print_function
import sys
import argparse
from dcmstack import DicomStack
# Change this path to point to where the rtfmri code lives
sys.path.insert(0, "/home/cniuser/git/rtfmri")
from rtfmri import ScannerClient
@mwaskom
mwaskom / nicer_barplots.ipynb
Created March 15, 2015 22:04
Three options to improve a plot with one numeric variable and two categorical variables.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mwaskom
mwaskom / coordinate_surface_normalization.ipynb
Last active August 29, 2015 14:16
Surface-based coordinate normalization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.