Skip to content

Instantly share code, notes, and snippets.

@margulies
Created March 26, 2021 16:31
Show Gist options
  • Save margulies/b99a9b04bb363f4a5fb9b6ed3868793b to your computer and use it in GitHub Desktop.
Save margulies/b99a9b04bb363f4a5fb9b6ed3868793b to your computer and use it in GitHub Desktop.
To calculate the DMN nodes on the individual level based on the principal gradient
#!/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
for s in ${subject_list};
do
for z in "0 1 2 3 4 5 6 7";
do
for h in "L R"; # run for each hemiphere
do
surf = "...${h}.gii" # path to surface file to use -- standard space is fine; only topology is relevant, not geometry
gradient = "${dir}/${s}_comp$c}_${h}.gii"
output = ${dir}/${s}_zone${z}_${h}.gii
wb_command -metric-extrema ${surf} ${gradient} 30 ${output} -presmooth 6 -only-maxima -column 0
# note: look into -consolidate-mode option
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment