Example #1
0
/*------------------------------------------------------------*/
static int getfmtid(char *fname) {
  int fmtid;
  fmtid = mri_identify(fname);
  if (fmtid == MRI_VOLUME_TYPE_UNKNOWN) {
    printf("ERROR: cannot determine format of %s\n",fname);
    exit(1);
  }
  return(fmtid);
}
Example #2
0
void dummy_identify(void) {

  int type;
  struct stat stat_buf;

  if (fname == NULL)
    usage(1);

  if (stat(fname, &stat_buf) < 0) {
    printf("fail\n");
    printf("can't stat file %s\n",fname);
    exit(1);
  }

  type = mri_identify(fname);

  if (type < 0) {
    printf("fail\nunknown file type\n");
    exit(1);
  } else if (type == MRI_CORONAL_SLICE_DIRECTORY)
    printf("succeed\ncoronal slice directory\n");
  else if (type == GENESIS_FILE)
    printf("succeed\ngenesis\n");
  else if (type == GE_LX_FILE)
    printf("succeed\nGE LX\n");
  else if (type == MRI_MGH_FILE)
    printf("succeed\nmgh\n");
  else if (type == MRI_MINC_FILE)
    printf("succeed\nminc\n");
  else if (type == MRI_ANALYZE_FILE)
    printf("succeed\nanalyze\n");
  else if (type == SIEMENS_FILE)
    printf("succeed\nsiemens\n");
  else if (type == BRIK_FILE)
    printf("succeed\nbrik\n");
  else if (type == BSHORT_FILE)
    printf("succeed\nbshort\n");
  else if (type == SDT_FILE)
    printf("succeed\nsdt\n");
  else {
    printf("fail\n");
    printf("%s: positive file type, but unknown to this program\n", short_prog_name);
    printf("%s: yell at your friendly neighborhood programmer\n", short_prog_name);
    exit(1);
  }

}  /*  end dummy_identify()  */