Skip to content

Instantly share code, notes, and snippets.

Avatar

Kambiz Tavabi ktavabi

View GitHub Profile
View Keybase.md

Keybase proof

I hereby claim:

  • I am ktavabi on github.
  • I am ktavabi (https://keybase.io/ktavabi) on keybase.
  • I have a public key ASDfx1uYa6Pbzq6hMXPsi1cmRYHRnaFE53NxmAL83f9shgo

To claim this, I am signing this object:

@ktavabi
ktavabi / README-Template.md
Created Mar 20, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ktavabi
ktavabi / t-test_test.py
Last active Dec 1, 2016
Permutation t-test for given time interval across subjects in sensor space
View t-test_test.py
for si, subj in enumerate(subjects):
evoked = read_evokeds(evoked_file, baseline=(None,0))
evoked.pick_types(meg='grad', eeg=False, stim=False, eog=True,
include=[], exclude=[])
# Store data in ndarray
if subj == subjects[0]:
erf_data = np.zeros((len(subjects), len(evoked.info['chs']),
len(evoked.times)))
erf_data[si] = evoked.data # nsubj x chs x time
@ktavabi
ktavabi / qc_gist.py
Created Nov 30, 2016
Code for testing cHPI SNR weighted averaging of phantom data
View qc_gist.py
# -*- coding: utf-8 -*-
""" Testing script for cHPI SNR weighted averaging ELEKTA phantom data """
# Authors: Kambiz Tavabi <ktavabi@uw.edu>
import os
import mne
import numpy as np
from matplotlib import pyplot as plt
@ktavabi
ktavabi / sense_permute.py
Created Jul 8, 2016
ERF sensor permutations on epochs in mne-python
View sense_permute.py
"""For each individual ERF data test if the signal across gradiometers
significantly deviates from 0 in the interval 175-250ms post-stimulus
onset, i.e., reliability of evoked response."""
import os
from os import path as op
import matplotlib.pyplot as plt
import numpy as np
from scipy.fftpack import fft
import mne
@ktavabi
ktavabi / group analysis.ipynb
Created Jun 16, 2016
Jupyter notebook for group level analysis of adult (N=30) MEEG data
View group analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View remove_output.py
"""
usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
"""
import sys
import io
from IPython.nbformat import current
@ktavabi
ktavabi / CUDA setup
Created May 6, 2016
Command history for setting up CUDA on Linux 14.04
View CUDA setup
# query nvidia card
lspci -vnn | grep -i VGA -A 12
# install nvidia driver 352.63
sudo apt-get install nvidia-352
sudo reboot
# Download OS-Arch CUDA Toolkit package from https://developer.nvidia.com/cuda-downloads
cd ~/Downloads
wget -O cuda.deb http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
@ktavabi
ktavabi / meg_mri_transform
Created Apr 1, 2016
Test case for transforming dipole locations from MEG subject head coordinates to MRI template (+RAS) head coordinates.
View meg_mri_transform
import numpy as np
from os import path as op
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import mne
from mne.bem import (_fit_sphere, fit_sphere_to_headshape)
def transform(loc_headcoord_subj, ctr_sphere_headcoord_subj, rad_template,
ctr_sphere_headcoord_template, rad_subj):
# remove offset to sphere from head coordinates (+RAS)
@ktavabi
ktavabi / am_tone_group.ipynb
Created Mar 12, 2016
Testing effect of transforms on grand average ERF topography
View am_tone_group.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.