This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nilearn.plotting import plot_glass_brain | |
| fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(10, 12)) | |
| for gidx, roi in enumerate(rois): | |
| plot_glass_brain(roi, plot_abs=False, symmetric_cbar=False, | |
| black_bg=True, display_mode='lyrz', colorbar=True, axes=axes[gidx], | |
| title=roi_ids[gidx]) | |
| plt.savefig(savepath + 'glass_summary.png', dpi=300) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root=pat/to/root | |
| cd ${root} | |
| for tiffile in *.tif; do | |
| echo $tiffile | |
| in_file=${tiffile} | |
| out_file=${in_file%.*}_whitebg.tif | |
| convert -fill white -opaque black ${in_file} ${out_file} | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for sub in {01..26}; do | |
| echo sub-${sub} | |
| mkdir /Users/ilkay.isik/MPI-Documents/hack_19/data/analysis/sub-${sub} | |
| mkdir /Users/ilkay.isik/MPI-Documents/hack_19/data/analysis/sub-${sub}/pfobloc | |
| src=/Users/ilkay.isik/project_folder_temp/fc_content/MRI_data/lscp_data/derivatives/analysis/sub-${sub}/pfobloc/pfobloc.feat | |
| dest=/Users/ilkay.isik/MPI-Documents/hack_19/data/analysis/sub-${sub}/pfobloc/pfobloc.feat | |
| echo ${src} '****' ${dest} | |
| cp -r ${src} ${dest} | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| import seaborn as sns | |
| for s in range(nr_subjects): | |
| fig, ax = plt.subplots(5, 6, sharex=True, sharey=True, figsize=(15, 20)) | |
| sns.despine() | |
| ax = ax.flatten() | |
| for m in range(nr_movies): | |
| ax[m].plot(cdt[s, m, :]) | |
| ax[m].plot(cdrt[s, m, :]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var="hello/my/name/is" | |
| # everything after the first slash: | |
| echo "${var#*/}" | |
| # everything after the last slash: | |
| echo "${var##*/}" | |
| # everything before the first slash: | |
| echo "${var%%/*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # to be used to save jupyter notebooks as html files | |
| import os | |
| from ilkay_tools.jupyter_save import save_nb, output_html | |
| import time | |
| %%javascript | |
| IPython.notebook.kernel.execute(`notebookName = '${IPython.notebook.notebook_name}'`); | |
| nb_fdir = os.getcwd() | |
| nb_name = notebookName.split('.', 1)[0] # discard the extension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root='/Users/ilkay.isik/project_folder_temp/fc_content/MRI_data/lscp_data/derivatives' | |
| input=path/to/2mm_input.nii | |
| output=path_to_1mm_output.nii | |
| ref=path_to_1mm_ref.nii | |
| c3d ${ref} ${input} -int 0 -reslice-identity -o ${output} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for fname_full in $(ls $sub_ses/prepro/source_files/*.nii); do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from glob import glob | |
| sub_exc = [0, 1, 2, 15, 18] | |
| sub_list = ['sub-{:02d}'.format(s+1) for s in sub_exc] | |
| files1 = [i for i in files1 if i.rsplit('analysis/',1 )[1].split('/')[0] not in sub_list] | |
| files2 = [i for i in files2 if i.rsplit('analysis/',1 )[1].split('/')[0] not in sub_list] | |
| files3 = [i for i in files3 if i.rsplit('analysis/',1 )[1].split('/')[0] not in sub_list] | |
| files = [files1, files2, files3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tksurferfv fsaverage lh inflated -aparc -overlay sig.mgh -fminmax 2 3 |