Skip to content

Commit

Permalink
mri_cor2label.cpp. #NF. Added ability to make a label by simply thres…
Browse files Browse the repository at this point in the history
…holding the input
  • Loading branch information
Douglas Greve committed Jun 1, 2021
1 parent 9c65eef commit ff0d610
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions mri_cor2label/mri_cor2label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ LABEL *lb;
int xi,yi,zi, c, nlabel;
float x,y,z;
char *subject_name = NULL;
int DoSurf = 0;
char surfpath[2000];
int doit;
int synthlabel = 0;
int verbose = 0;
Expand Down Expand Up @@ -203,8 +205,11 @@ int main(int argc, char **argv) {

if(hemi != NULL){
SUBJECTS_DIR = getenv("SUBJECTS_DIR");
sprintf(tmpstr,"%s/%s/surf/%s.%s",SUBJECTS_DIR,subject_name,hemi,surfname);
printf("Loading %s\n",tmpstr);
sprintf(surfpath,"%s/%s/surf/%s.%s",SUBJECTS_DIR,subject_name,hemi,surfname);
}

if(DoSurf){
printf("Loading %s\n",surfpath);
surf = MRISread(tmpstr);
if(surf == NULL) exit(1);
if(nv != surf->nvertices){
Expand Down Expand Up @@ -379,25 +384,29 @@ static int parse_commandline(int argc, char **argv) {
nargs = 1;
}

/* ---- label id ---------- */
else if (!strcmp(option, "--surf")) {
if(nargc < 2) argnerr(option,1);
if(nargc < 2) argnerr(option,3);
subject_name = pargv[1];
hemi = pargv[2];
nargs = 3;
if(nargc > 3 && !CMDisFlag(pargv[3])){
surfname = pargv[3];
nargs ++;
}
DoSurf = 1;
}

/* ---- label id ---------- */
else if (!strcmp(option, "--sd")) {
if(nargc < 2) argnerr(option,1);
setenv("SUBJECTS_DIR",pargv[1],1);
nargs = 2;
}

else if (!strcmp(option, "--surf-path")) {
if(nargc < 1) argnerr(option,1);
strcpy(surfpath,pargv[1]);
DoSurf = 1;
}

/* ---- opt-thresholded label ---------- */
else if (!strcmp(option, "--opt")) {
if(nargc < 4) argnerr(option,3); // target delta valmap
Expand Down

0 comments on commit ff0d610

Please sign in to comment.