Пример #1
0
static int
translate_indices_to_annotations(MRI_SURFACE *mris, char *translation_fname) {
  int    vno ;
  VERTEX *v ;

  read_named_annotation_table(translation_fname) ;

  for (vno = 0 ; vno < mris->nvertices ; vno++) {
    v = &mris->vertices[vno] ;
    if (v->ripflag)
      continue ;
    v->annotation = index_to_annotation((int)v->val) ;
    if (v->annotation == -1)
      v->annotation = (unknown_label > 0) ? unknown_label : 0 ;
  }
  return(NO_ERROR) ;
}
Пример #2
0
/*----------------------------------------------------------------------
  Parameters:

  Description:
  ----------------------------------------------------------------------*/
static int
get_option(int argc, char *argv[]) {
  int  nargs = 0 ;
  char *option ;

  option = argv[1] + 1 ;            /* past '-' */
  if (!stricmp(option, "sdir")) {
    strcpy(sdir, argv[2]) ;
    printf("using SUBJECTS_DIR=%s\n", sdir) ;
    nargs = 1 ;
  } else switch (toupper(*option)) {
    case 'C':
      if (read_named_annotation_table(argv[2]) != NO_ERROR)
        ErrorExit(ERROR_NOFILE, "%s: could not read lookup table %s",
                  Progname, argv[2]) ;
      nargs = 1 ;
      printf("using lookup table %s...\n", argv[2]) ;
      break ;
    case 'T':
      in_label = atoi(argv[2]) ;
      out_label = atoi(argv[3]) ;
      nargs = 2 ;
      printf("translating label %d to label %d\n", in_label, out_label) ;
      break ;
    case 'L':
      log_fname = argv[2] ;
      nargs = 1 ;
      /*    fprintf(stderr, "logging results to %s\n", log_fname) ;*/
      break ;
    case 'P':
      compute_pct = 1 ;
      break ;
    case '?':
    case 'U':
      usage_exit(0) ;
      break ;
    default:
      fprintf(stderr, "unknown option %s\n", argv[1]) ;
      exit(1) ;
      break ;
    }

  return(nargs) ;
}