This file contains 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
#!/bin/bash | |
# Install DiscordChatExporter.Cli from: | |
# https://github.com/Tyrrrz/DiscordChatExporter | |
# | |
# .NET runtime also needs to be installed: | |
# https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md | |
# | |
# Find your token and server ID ('guild'): | |
# https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md |
This file contains 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
#!/bin/bash | |
# set global variables: | |
subject_list = "XXXXX1 XXXXX2 XXXXX3 XXXXX4" | |
comp = 0 # for the first component | |
dir = "/XXXX/XXX" # location of data | |
zone_rois = ".... | |
# find local extrema within each zone for each individual |
This file contains 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
# run the following conversion for each individual left and right hemisphere matrix separately | |
# convert matrices to nifti1: | |
wb_command -cifti-convert -to-nifti input.dconn.nii output.nii | |
# convert matrices to vista: | |
# after install lipsia: | |
export dir=[directory with data] | |
docker run -v ${dir}:${dir} lipsia vnifti -in ${dir}/output.nii -out ${dir}/output.v |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>IPyWidget export</title> | |
</head> | |
<body> | |
<!-- Load require.js. Delete this if your page already loads require.js --> |
This file contains 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 numpy as np | |
import nibabel as nib | |
from surfdist.load import load_freesurfer_label, get_freesurfer_label | |
from surfdist.utils import surf_keep_cortex, translate_src | |
import gdist | |
import os | |
base_dir = '/Applications/freesurfer/subjects/' | |
surf = nib.freesurfer.read_geometry(os.path.join(base_dir, 'fsaverage5/surf/lh.pial')) | |
cort = np.sort(nib.freesurfer.read_label(os.path.join(base_dir, 'fsaverage5/label/lh.cortex.label'))) |
This file contains 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
def plot_surf_stat_multidim(coords, faces, face_colors=None, stat_map=None, | |
elev=0, azim=0, | |
cmap=None, | |
threshold=None, bg_map=None, | |
mask=None, | |
bg_on_stat=False, | |
alpha='auto', | |
vmax=None, symmetric_cbar="auto", | |
figsize=(14,11), label=None, lenient=None, | |
**kwargs): |
This file contains 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 nibabel as nib, numpy as np, os, sys | |
#sys.path.insert(0,'../') | |
import surfdist as sd | |
from surfdist import viz, load, utils | |
# function to calculate distance matrix: | |
def dist_calc_matrix(surf, cortex, labels, exceptions = ['Unknown', 'Medial_wall'], dist_type='min'): | |
""" | |
dist_type='min' or 'mean' | |
returns: |
This file contains 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 nipype.pipeline.engine as pe | |
import nipype.interfaces.utility as util | |
import nipype.interfaces.io as nio | |
from nipype.interfaces.freesurfer import SampleToSurface | |
'''directories''' | |
preprocDir = "/scr/adenauer1/Franz/nki_nilearn" | |
freesurferDir = "/scr/ilz2/nilearn_vol2surf_wd/freesurfer" | |
workingDir = "/scr/ilz2/nilearn_vol2surf_wd/" | |
sinkDir = "/scr/ilz1/nilearn_vol2surf_sink/" |
This file contains 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 numpy as np | |
import nibabel as nib # git clone --branch enh/cifti2 https://github.com/satra/nibabel.git | |
from sklearn.metrics import pairwise_distances | |
# install mapalign: (comment if already installed) | |
! pip install git+https://github.com/satra/mapalign | |
from mapalign import embed | |
# Load data and Fisher's z-to-r transform | |
# load connectivity matrix as numpy array |
This file contains 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
def write_cifti(data, fname, dtype = 'dscalar', labels = None, tpl = None): | |
import subprocess | |
import os | |
assert data.shape[0] == 91282, "You must have 91282 vertices on the first dimension (rows)" | |
if tpl is None: | |
tpl = '/Users/marcel/projects/HCP/Connectivity_coordinate_system/rsFC_eigenvectors.dscalar.nii' |
NewerOlder