Skip to content

Instantly share code, notes, and snippets.

View sdres's full-sized avatar

Sebastian Dresbach sdres

View GitHub Profile
@sdres
sdres / computeT1w.py
Last active September 20, 2022 10:12
Computes T1w image in EPI-space from motion-corrected 'nulled' and 'notnulled' timeseries as acquired with SS-SI VASO.
'''
Computes T1w image in EPI-space from motion-corrected 'nulled' and 'notnulled'
timeseries as acquired with SS-SI VASO.
'''
import numpy as np
import nibabel as nb
from scipy import signal
@sdres
sdres / make_colorbar.py
Created September 15, 2022 08:12
Make various color-bars
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
def colorFader(c1,c2,mix=0): #fade (linear interpolate) from color c1 (at mix=0) to c2 (mix=1)
c1=np.array(mpl.colors.to_rgb(c1))
c2=np.array(mpl.colors.to_rgb(c2))
return mpl.colors.to_hex((1-mix)*c1 + mix*c2)
#!/usr/bin/python
import pandas as pd
import matplotlib.pyplot as plt
from collections import Counter
sheet_id = '1REpJa7gl4i7Dxbw-JHcF-dhne3UFgqwkKE_If1nXrmY'
sheet_name = 'Included'
url = f'https://docs.google.com/spreadsheets/d/{sheet_id}/gviz/tq?tqx=out:csv&sheet={sheet_name}'
data = pd.read_csv(url).sort_values(by=['Count','First Author'])