Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed-up BA exvivo labels projection with python #183

Merged
merged 12 commits into from
Sep 1, 2022
Prev Previous commit
Next Next commit
use fsaverage from FREESURFER_HOME
  • Loading branch information
m-reuter committed Sep 1, 2022
commit 556a0116719d45a3318605af49f85c7c566dbc47
14 changes: 5 additions & 9 deletions recon_surf/fs_balabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
h_sid = 'subject id (name of directory within the subject directory)'
h_sd = 'subject directory path'
h_hemi = 'optioal: "lh" or "rh" (default run both hemispheres)'
h_fsaverage = 'optional: path to fsaverage (default is subject_dir/fsaverage)'
h_fsaverage = 'optional: path to fsaverage (default is $FREESURFER_HOME/subjects/fsaverage)'


def options_parse():
Expand All @@ -79,8 +79,6 @@ def options_parse():

if options.sid is None or options.sd is None:
sys.exit('\nERROR: Please specify --sid and --sd !\n Use --help to see all options.\n')
if options.fsaverage is None:
options.fsaverage=options.sd+"/fsaverage"
if options.hemi is None:
options.hemi = ["lh","rh"]
else:
Expand Down Expand Up @@ -134,7 +132,10 @@ def read_colortables(colnames,colappend,drop_unknown=True):
if sdir != options.sd:
print("WARNING environment $SUBJECTS_DIR is set differently to --sd !")
os.environ['SUBJECTS_DIR'] = options.sd

if options.fsaverage is None:
options.fsaverage=os.path.join(fshome,"subjects","fsaverage")


# read and stack colortable labels
ba = os.path.join(fshome,"average","colortable_BA.txt")
vpnl = os.path.join(fshome,"average","colortable_vpnl.txt")
Expand Down Expand Up @@ -188,8 +189,3 @@ def read_colortables(colnames,colappend,drop_unknown=True):

print("...done\n")