• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ErrorInit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ErrorInit函数的典型用法代码示例。如果您正苦于以下问题:C++ ErrorInit函数的具体用法?C++ ErrorInit怎么用?C++ ErrorInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ErrorInit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

/*---------------------------------------------------------------*/
int main(int argc, char *argv[]) {
  int nargs;

  nargs = handle_version_option (argc, argv, vcid, "$Name: stable5 $");
  if (nargs && argc - nargs == 1) exit (0);
  argc -= nargs;
  cmdline = argv2cmdline(argc,argv);
  uname(&uts);
  getcwd(cwd,2000);

  Progname = argv[0] ;
  argc --;
  argv++;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;
  if (argc == 0) usage_exit();
  parse_commandline(argc, argv);
  check_options();
  if (checkoptsonly) return(0);
  dump_options(stdout);

  SUBJECTS_DIR = getenv("SUBJECTS_DIR");
  if (SUBJECTS_DIR == NULL) {
    printf("ERROR: SUBJECTS_DIR not defined in environment\n");
    exit(1);
  }

  return 0;
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:30,代码来源:mris_fbirn_annot.c


示例2: main

int
main(int argc, char *argv[]) {
  char         **av, *in_fname, *out_fname ;
  int          ac, nargs ;
  MRI_SURFACE  *mris ;
  float        alpha, beta, gamma ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mris_rotate.c,v 1.6 2011/03/02 00:04:33 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 6)
    usage_exit() ;

  in_fname = argv[1] ;
  if (sscanf(argv[2], "%f", &alpha) != 1)
    ErrorExit(ERROR_BADPARM, "%s: could not scan alpha from %s",
              Progname, argv[2]) ;
  if (sscanf(argv[3], "%f", &beta) != 1)
    ErrorExit(ERROR_BADPARM, "%s: could not scan beta from %s",
              Progname, argv[3]) ;
  if (sscanf(argv[4], "%f", &gamma) != 1)
    ErrorExit(ERROR_BADPARM, "%s: could not scan gamma from %s",
              Progname, argv[4]) ;
  out_fname = argv[5] ;

  mris = MRISfastRead(in_fname) ;
  if (!mris)
    ErrorExit(ERROR_NOFILE, "%s: could not read surface file %s",
              Progname, in_fname) ;

  alpha = RADIANS(alpha) ;
  beta = RADIANS(beta) ;
  gamma = RADIANS(gamma) ;
  MRIScenter(mris, mris) ;
  MRISrotate(mris, mris, alpha, beta, gamma) ;
  if (!mris)
    ErrorExit(ERROR_NOFILE, "%s: could not rotate surface", Progname) ;

  if (Gdiag & DIAG_SHOW)
    fprintf(stderr, "writing rotated surface to %s\n", out_fname) ;
  MRISwrite(mris, out_fname) ;

  exit(0) ;
  return(0) ;  /* for ansi */
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:60,代码来源:mris_rotate.c


示例3: player_sd_init

player_sd_t* 
player_sd_init(void)
{
  player_sd_t* sd;
  player_sd_mdns_t* mdns;

  sd = (player_sd_t*)malloc(sizeof(player_sd_t));
  assert(sd);
  sd->devs = NULL;
  sd->devs_len = 0;

  mdns = (player_sd_mdns_t*)malloc(sizeof(player_sd_mdns_t));
  assert(mdns);
  mdns->browseRef_valid = 0;
  mdns->mdnsDevs = NULL;
  mdns->mdnsDevs_len = 0;
  mdns->callb = NULL;
  mdns->flags = 0;
  sd->sdRef = mdns;

  pthread_mutex_init(&(mdns->mutex),NULL);

  // Initialize the interface table, so that we can decode the interface
  // strings names that are used in TXT records.
  itable_init();

  // Pick a default debug level
  ErrorInit(1,NULL);

  return(sd);
}
开发者ID:brunoellll,项目名称:player-git-svn,代码行数:31,代码来源:playersd_mdns.c


示例4: main

int
main(int argc, char *argv[]) {
  char        **av, *out_vol ;
  int         ac, nargs ;
  MRI         *mri_time1, *mri_time2, *mri_tmp, *mri_atrophy ;
  TRANSFORM   *transform1, *transform2 ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mri_map_atrophy.c,v 1.4 2011/03/02 00:04:22 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 6)
    usage_exit() ;

  out_vol = argv[argc-1] ;

  printf("reading volume from %s...\n", argv[1]) ;
  mri_time1 = MRIread(argv[1]) ;
  if (!mri_time1)
    ErrorExit(ERROR_NOFILE, "%s: could not read MRI volume %s", Progname, argv[2]) ;
  mri_time2 = MRIread(argv[2]) ;
  if (!mri_time2)
    ErrorExit(ERROR_NOFILE, "%s: could not read MRI volume %s", Progname, argv[2]) ;

  transform1 = TransformRead(argv[3]) ;
  if (!transform1)
    ErrorExit(ERROR_NOFILE, "%s: could not read transform from %s", Progname, argv[3]) ;

  transform2 = TransformRead(argv[4]) ;
  if (!transform2)
    ErrorExit(ERROR_NOFILE, "%s: could not read transform from %s", Progname, argv[4]) ;

  mri_tmp = TransformApplyType(transform1, mri_time1, NULL, SAMPLE_NEAREST);
  MRIfree(&mri_time1) ;
  mri_time1 = mri_tmp ;
  mri_tmp = TransformApplyType(transform2, mri_time2, NULL, SAMPLE_NEAREST);
  MRIfree(&mri_time2) ;
  mri_time2 = mri_tmp ;
  mri_atrophy = make_atrophy_map(mri_time1, mri_time2, NULL, transform1, transform2, gray_labels, ngray, csf_labels, ncsf) ;

  MRIwrite(mri_atrophy, out_vol) ;

  exit(0) ;
  return(0) ;  /* for ansi */
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:59,代码来源:mri_map_atrophy.c


示例5: main

int
main(int argc, char *argv[]) {
  char   **av ;
  int    ac, nargs ;
  MRI    *mri_src, *mri_dst = NULL ;
  char   *in_fname, *out_fname ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mri_polv.c,v 1.6 2011/03/02 00:04:24 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 1)
    argc = 1 ;

  if (argc < 1)
    ErrorExit(ERROR_BADPARM, "%s: no input name specified", Progname) ;
  in_fname = argv[1] ;

  if (argc < 2)
    ErrorExit(ERROR_BADPARM, "%s: no output name specified", Progname) ;
  out_fname = argv[2] ;

  if (verbose)
    fprintf(stderr, "reading from %s...", in_fname) ;
  mri_src = MRIread(in_fname) ;
  if (!mri_src)
    ErrorExit(ERROR_NO_FILE, "%s: could not open source file %s",
              Progname, in_fname) ;

  if (verbose)
    fprintf(stderr, "done.\ncalculating plane of least variance...") ;
  mri_dst = MRIcentralPlaneOfLeastVarianceNormal(mri_src, NULL, window_size) ;
  if (!mri_dst)
    ErrorExit(ERROR_BADPARM, "%s: plane of least variance calculation failed",
              Progname) ;

  if (verbose)
    fprintf(stderr, "\ndone. writing output to %s", out_fname) ;
  MRIwrite(mri_dst, out_fname) ;
  if (verbose)
    fprintf(stderr, "\n") ;
  exit(0) ;
  return(0) ;
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:58,代码来源:mri_polv.c


示例6: main

int
main(int argc, char *argv[]) {
  char   **av ;
  int    ac, nargs ;
  MRI    *mri_src, *mri_dst ;
  char   *in_fname, *out_fname ;
  int    label, nvox ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mri_copy_values.c,v 1.5 2011/03/02 00:04:14 nicks Exp $", "$Name:  $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 2)
    ErrorExit(ERROR_BADPARM, "%s: no input name specified", Progname) ;
  in_fname = argv[1] ;

  if (argc < 3)
    ErrorExit(ERROR_BADPARM, "%s: no value specified", Progname) ;
  label = atoi(argv[2]) ;

  if (argc < 4)
    ErrorExit(ERROR_BADPARM, "%s: no output name specified", Progname) ;
  out_fname = argv[3] ;

  fprintf(stderr, "reading from %s...\n", in_fname) ;
  mri_src = MRIread(in_fname) ;
  if (!mri_src)
    ErrorExit(ERROR_NOFILE, "%s: could not read input volume %s",
              Progname, in_fname) ;
  mri_dst = MRIread(out_fname) ;
  if (!mri_dst)
    ErrorExit(ERROR_NOFILE, "%s: could not read destination volume %s",
              Progname, out_fname) ;
  nvox = MRIcopyLabel(mri_src, mri_dst, label) ;
  fprintf(stderr, "%d voxels copied from input to output volume...\n", nvox);

  fprintf(stderr, "writing to %s...\n", out_fname) ;
  MRIwrite(mri_dst, out_fname) ;
  MRIfree(&mri_dst) ;
  MRIfree(&mri_src) ;
  exit(0) ;
  return(0) ;
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:57,代码来源:mri_copy_values.c


示例7: main

int
main(int argc, char *argv[]) {
  char   **av ;
  int    ac, nargs, i ;
  MRI    *mri_src, *mri_dst = NULL ;
  char   *in_fname, *out_fname ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mri_reduce.c,v 1.7 2011/03/02 00:04:24 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 1)
    argc = 1 ;

  if (argc < 1)
    ErrorExit(ERROR_BADPARM, "%s: no input name specified", Progname) ;
  in_fname = argv[1] ;

  if (argc < 2)
    ErrorExit(ERROR_BADPARM, "%s: no output name specified", Progname) ;
  out_fname = argv[2] ;

  fprintf(stderr, "reading from %s...", in_fname) ;
  mri_src = MRIread(in_fname) ;

  i = 0 ;
  do {
    if (i)
      mri_src = MRIcopy(mri_dst, NULL) ;
    fprintf(stderr, "\nreducing by 2");

    mri_dst = MRIallocSequence(mri_src->width/2, mri_src->height/2, mri_src->depth/2, MRI_FLOAT, mri_src->nframes);
    MRIreduce(mri_src, mri_dst) ;
    MRIfree(&mri_src) ;
  } while (++i < reductions) ;

  fprintf(stderr, "\nwriting to %s", out_fname) ;
  MRIwrite(mri_dst, out_fname) ;
  fprintf(stderr, "\n") ;
  exit(0) ;
  return(0) ;
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:56,代码来源:mri_reduce.c


示例8: main

int
main(int argc, char *argv[]) {
  char   **av ;
  int    ac, nargs ;
  MRI    *mri_src, *mri_ref, *mri_tmp ;
  double accuracy ;
  MRI_REGION box ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mri_label_accuracy.c,v 1.2 2011/03/02 00:04:22 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 3)
    usage_exit(1) ;

  mri_src = MRIread(argv[1]) ;
  if (mri_src == NULL)
    ErrorExit(ERROR_BADPARM, "%s: could not read input volume %s\n", Progname,argv[1]);
  MRIboundingBox(mri_src, 0, &box) ;
  mri_tmp = MRIextractRegionAndPad(mri_src, NULL, &box, PAD) ;
  MRIfree(&mri_src) ; mri_src = mri_tmp ;
  if (mri_src->type == MRI_SHORT)
  {
    mri_tmp = MRIchangeType(mri_src, MRI_FLOAT, 0, 0, 0) ;
    MRIfree(&mri_src) ; mri_src = mri_tmp ;
  }

  mri_ref = MRIread(argv[2]) ;
  if (mri_ref == NULL)
    ErrorExit(ERROR_BADPARM, "%s: could not read reference volume %s\n", Progname,argv[1]);
  MRIboundingBox(mri_ref, 0, &box) ;
  mri_tmp = MRIextractRegionAndPad(mri_ref, NULL, &box, PAD) ;
  MRIfree(&mri_ref) ; mri_ref = mri_tmp ;

  accuracy = MRIcomputeLabelAccuracy(mri_src, mri_ref, MRI_MEAN_MIN_DISTANCE, stdout) ;

  if (Gdiag_fp)
    fclose(Gdiag_fp) ;
  exit(0) ;
  return(0) ;
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:55,代码来源:mri_label_accuracy.c


示例9: main

int
main(int argc, char *argv[]) {
  char         **av ;
  int          ac, nargs, nsize ;
  MRI_SURFACE  *mris ;
  MRI          *mri ;

  nargs = handle_version_option (argc, argv, "$Id: mris_nudge.c,v 1.2 2011/03/02 00:04:31 nicks Exp $", "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Gx = Gy = Gz = -1 ;
  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 7)
    usage_exit(1) ;

  mris = MRISread(argv[1]) ;
  if (mris == NULL)
    ErrorExit(ERROR_NOFILE, "%s: could not read surface from %s", Progname, argv[1]) ;
  MRIScomputeMetricProperties(mris) ;
  MRISstoreMetricProperties(mris) ;

  mri = MRIread(argv[2]) ;
  if (mri == NULL)
    ErrorExit(ERROR_NOFILE, "%s: could not read volume from %s", Progname, argv[2]) ;

  target_vnos[nvertices] = atoi(argv[3]) ;
  target_vals[nvertices] = atof(argv[4]) ;
  nsize = atoi(argv[5]) ;

  printf("nudging %d vertex region around vertex %d to target val %2.1f\n", 
         nsize, target_vnos[nvertices], target_vals[nvertices]) ;
  nvertices++ ;

  MRISerodeRipped(mris, nsize) ;
  MRISrepositionSurface(mris, mri, target_vnos, target_vals, nvertices, nsize, sigma) ;

  MRISunrip(mris) ;
  printf("writing repositioned surface to %s\n", argv[6]) ;
  MRISwrite(mris, argv[6]) ;
  return(0) ;
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:54,代码来源:mris_nudge.c


示例10: main

//------------------------------------------------------------------------------
int main( int argc, char* argv[] )
{
  if (argc < 3) {
    printf("Too few arguments!\nUsage: orbittarget <robot_name> <neighbour_name> [config_file]\n");
    return 1;
  }

  // init general stuff
  ErrorInit ( 1, false );
  initRandomNumberGenerator();

  printf("-----------------------------------\n");
  printf("Chatterbox Orbit Target\n");
  printf("  build %s %s \n", __DATE__, __TIME__);
  printf("  compiled against RAPI version %s (%s) build %s\n", RAPI_VERSION(),
           RAPI_GIT_VERSION(), RAPI_BUILD() );
  printf("\n");
  printf("Lifting the robot up disables motors\n");

  if (signal(SIGINT, quitSig) == SIG_ERR) {
     PRT_ERR1("Error resetting signal handler %s", strerror(errno));
  }

  // Create robot and its controller
  robot = new Rapi::CCBRobot ();
  if ( robot->init() == 0) {
    Rapi::rapiError->print();
    delete robot;
    exit(-1);
  }
  robot->setName(argv[1]);

  if (argc > 3)
    robotCtrl = new COrbitTarget ( robot, std::string(argv[3]) );
  else  
    robotCtrl = new COrbitTarget ( robot );

  robotCtrl->setNNName(std::string(argv[2]));

  // Blocking call
  robot->run();

  // Clean up robot controller
  if (robotCtrl) {
    delete robotCtrl;
    robotCtrl = NULL;
  }

  // Clean up robot
  if (robot)
    delete (robot);
  return 1;
}
开发者ID:jacobperron,项目名称:orbittarget-CoSLAM,代码行数:54,代码来源:main.cpp


示例11: WSAHtonl

void SocketUdp::Bind(const EndPoint& ep)
{
	SOCKADDR_IN	sin;

	if (!ep.getIp())
		 WSAHtonl(this->socket_, INADDR_ANY, &sin.sin_addr.s_addr);
	else
		sin.sin_addr.s_addr = inet_addr(ep.getIpStr().c_str());
	sin.sin_family = AF_INET;
	WSAHtons(this->socket_, ep.getPort(), &sin.sin_port);
	if ((bind(this->socket_, reinterpret_cast<SOCKADDR*>(&sin), sizeof sin)) == SOCKET_ERROR)
		throw ErrorInit("Cannot bind the socket");
}
开发者ID:fiahil,项目名称:R-Type,代码行数:13,代码来源:WinSocketUdp.cpp


示例12: ErrorHashCreate

PARSEDLLSPEC int ErrorHashCreate(struct _Error *m, int many)
{
    struct _Error **fpnew;
    int it, ip;
    int key;

    if(_ErrorFirst)
    {
        ErrorInit();
    }

    for(it=0; it<many; it++)
    {
        //
        // compute hash key
        //
        key=ErrorHashKey(m[it].code);
        //
        // see if we need to create more room
        //
        if(EH[key].many>=EH[key].max)
        {
            fpnew=(struct _Error **)malloc((EH[key].max+EENTRY)*sizeof(struct _Error *));
            if(fpnew!=0)
            {
                if(EH[key].many>0 && EH[key].fptr!=0)
                {
                    for(ip=0; ip<EH[key].many; ip++)
                    {
                        fpnew[ip]=EH[key].fptr[ip];
                    }
                    free(EH[key].fptr);
                }
                EH[key].fptr=fpnew;
                EH[key].max+=EENTRY;
            }
            else
            {
                ErrorHashDestroy();
                return -1;
            }
        }
        //
        // now we should be able to stick the new one in the structure
        //
        EH[key].fptr[EH[key].many]= &m[it];
        EH[key].many++;
    }

    return 0;
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:51,代码来源:ErrorPrint.c


示例13: ErrorForward

PARSEDLLSPEC void ErrorForward(int art, int code, char *ttype, char *message)
{
    struct _Error *mptr;
    int response;
	int type;

    if(_ErrorFirst)
    {
        ErrorInit();
    }

	type=ErrorTypeParse(ttype);
    mptr=ErrorFind(code);
    if(mptr==0)
    {
        if(type>=0 && type<sizeof(_ErrorResponse)/sizeof(_ErrorResponse[0]))
        {
            response=_ErrorResponse[type];
        }
        else
        {
            response=0;
        }
	}
    else
    {
        type=mptr->type&0xff;
        response=(mptr->type>>8)&0xff;
        if(response==0)
        {
            if(type>=0 && type<sizeof(_ErrorResponse)/sizeof(_ErrorResponse[0]))
            {
                response=_ErrorResponse[type];
            }
            else
            {
                response=0;
            }
        }
	}
    response&=(~(1<<ErrorResponseSpecial));
    //
    // here is where we format the message
    //
    if(response!=0)
    {
        ErrorPrintIt(art,code,type,response,message);
	}
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:49,代码来源:ErrorPrint.c


示例14: main

/***-------------------------------------------------------****/
int main(int argc, char *argv[])
{
  int  nargs, index, ac, nvolumes;
  char **av ;
  MRI  *mri_and = NULL, *mri ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, vcid, "$Name:  $");
  if (nargs && argc - nargs == 1)
    exit (0);
  Progname = argv[0] ;
  argc -= nargs;
  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++)
  {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  nvolumes = argc-2 ;
  if (nvolumes <= 0)
    usage_exit() ;
  printf("processing %d input files\n", nvolumes) ;

  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  for (index = 0 ; index < nvolumes ; index++)
  {
    char *fname = argv[index+1] ;
    printf("processing input volume %d of %d: %s\n",
           index+1, nvolumes, fname) ;
    mri = MRIread(fname) ;
    if (index == 0)
      mri_and = MRIcopy(mri, NULL) ;
    else
      MRIand(mri, mri_and, mri_and, 0) ;

    MRIfree(&mri) ;
  }

  printf("writing output to %s\n", argv[argc-1]) ;
  MRIwrite(mri_and, argv[argc-1]) ;
  exit(0);

} /* end main() */
开发者ID:ewong718,项目名称:freesurfer,代码行数:49,代码来源:mri_and.c


示例15: main

int
main(int argc, char *argv[]) 
{
  MRI_SURFACE  *mris ;
  char         **av, *in_fname, *out_fname ;
  int          ac, nargs ;
  MRI          *mri_distance ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option
          (argc, argv,
           "$Id: mris_distance_map.c,v 1.2 2011/03/02 00:04:31 nicks Exp $",
           "$Name: stable5 $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 3) usage_exit() ;

  in_fname = argv[1] ;
  out_fname = argv[2] ;
  mris = MRISread(in_fname) ;
  if (mris == NULL)
    ErrorExit(ERROR_NOFILE, "%s: could not load surface %s", Progname, out_fname) ;

  mri_distance = MRIScomputeDistanceMap(mris, NULL, ref_vertex_no) ;

  MRIwrite(mri_distance, out_fname) ;
  MRISfree(&mris) ;

  exit(0) ;

  return(0) ;  /* for ansi */
}
开发者ID:guo2004131,项目名称:freesurfer,代码行数:46,代码来源:mris_distance_map.c


示例16: main

/*---------------------------------------------------------------*/
int main(int argc, char *argv[]) {
  int nargs;
  char *surf1_fname ;
  char *surf2_fname ;
  char *out_fname ;
  MRI_SURFACE *mris1, *mris2 ;

  nargs = handle_version_option (argc, argv, vcid, "$Name:  $");
  if (nargs && argc - nargs == 1) exit (0);
  argc -= nargs;
  cmdline = argv2cmdline(argc,argv);
  uname(&uts);
  getcwd(cwd,2000);

  Progname = argv[0] ;
  argc --;
  argv++;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;
  if (argc == 0) usage_exit();
  parse_commandline(argc, argv);
  check_options();
  if (checkoptsonly) return(0);
  dump_options(stdout);

  SUBJECTS_DIR = getenv("SUBJECTS_DIR");
  if (SUBJECTS_DIR == NULL) {
    printf("ERROR: SUBJECTS_DIR not defined in environment\n");
    exit(1);
  }

  surf1_fname = argv[0] ; surf2_fname = argv[1] ; out_fname = argv[2] ; 
  mris1 = MRISread(surf1_fname) ;
  if (mris1 == NULL)
    ErrorExit(ERROR_NOFILE, "could not read surface 1 from %s", surf1_fname) ;
  mris2 = MRISread(surf2_fname) ;
  if (mris2 == NULL)
    ErrorExit(ERROR_NOFILE, "could not read surface 2 from %s", surf2_fname) ;

  compute_surface_distance(mris1, mris2, mris1) ;
  MRISwriteValues(mris1, out_fname) ;
  return 0;
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:44,代码来源:mris_surface_change.c


示例17: main

int
main(int argc, char *argv[]) {
  char         **av, *in_fname, *out_fname ;
  int          ac, nargs ;
  MRI_SURFACE  *mris ;
  float        radius, scale ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mris_rescale.c,v 1.5 2011/03/02 00:04:33 nicks Exp $", "$Name:  $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 3)
    usage_exit() ;

  in_fname = argv[1] ;
  out_fname = argv[2] ;

  mris = MRISread(in_fname) ;
  if (!mris)
    ErrorExit(ERROR_NOFILE, "%s: could not read surface file %s",
              Progname, in_fname) ;
  radius = MRISaverageRadius(mris) ;
  scale = DEFAULT_RADIUS / radius ;
  MRISscaleBrain(mris, mris, scale) ;
  MRISwrite(mris, out_fname) ;

  exit(0) ;
  return(0) ;  /* for ansi */
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:43,代码来源:mris_rescale.c


示例18: main

int
main(int argc, char *argv[]) {
  char          **av, *out_fname, *in_fname ;
  int           ac, nargs ;
  MRI_SURFACE   *mris ;
  MRI           *mri_interior, *mri_template = NULL, *mri_buffer = NULL;

  char cmdline[CMD_LINE_LEN] ;

  make_cmd_version_string
  (argc, argv,
   "$Id: mris_fill.c,v 1.6 2011/03/02 00:04:32 nicks Exp $", "$Name:  $",
   cmdline);

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: mris_fill.c,v 1.6 2011/03/02 00:04:32 nicks Exp $", "$Name:  $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc != 3)
    usage_exit() ;

  in_fname = argv[1] ;
  out_fname = argv[2] ;

  fprintf(stderr, "reading surface from %s...\n", in_fname) ;
  mris = MRISread(in_fname) ;

  if (template)
开发者ID:ewong718,项目名称:freesurfer,代码行数:42,代码来源:mris_fill.c


示例19: main

int
main(int argc, char *argv[]) {
  char   **av, fname[STRLEN] ;
  int    ac, nargs, i ;
  char   *in_fname, *out_fname ;
  int          msec, minutes, seconds ;
  struct timeb start ;

  /* rkt: check for and handle version tag */
  nargs = handle_version_option (argc, argv, "$Id: main_template.c,v 1.5 2011/03/02 00:04:40 nicks Exp $", "$Name:  $");
  if (nargs && argc - nargs == 1)
    exit (0);
  argc -= nargs;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;

  TimerStart(&start) ;

  ac = argc ;
  av = argv ;
  for ( ; argc > 1 && ISOPTION(*argv[1]) ; argc--, argv++) {
    nargs = get_option(argc, argv) ;
    argc -= nargs ;
    argv += nargs ;
  }

  if (argc < 3)
    usage_exit(1) ;


  msec = TimerStop(&start) ;
  seconds = nint((float)msec/1000.0f) ;
  minutes = seconds / 60 ;
  seconds = seconds % 60 ;
  fprintf(stderr, "inverse operator application took %d minutes"
          " and %d seconds.\n", minutes, seconds) ;
  exit(0) ;
  return(0) ;
}
开发者ID:ewong718,项目名称:freesurfer,代码行数:41,代码来源:main_template.c


示例20: main

int
main(int argc, char *argv[])
{
  double           thresh ;
  MRI              *mri, *mri_abs ;
  char             *out_stem, fname[STRLEN] ;
  MRI_SEGMENTATION *mriseg ;
  int              s ;
  LABEL            *area ;

  Progname = argv[0] ;
  ErrorInit(NULL, NULL, NULL) ;
  DiagInit(NULL, NULL, NULL) ;
  mri = MRIread(argv[1]) ;
  if (mri == NULL)
    ErrorExit(ERROR_NOFILE, "%s: could not load MRI from %s\n", Progname, argv[1]) ;

  if (use_abs)
    mri_abs = MRIabs(mri, NULL) ;
  else
    mri_abs = MRIcopy(mri, NULL) ;

  thresh = atof(argv[2]) ;
  out_stem = argv[3] ;

  mriseg = MRIsegment(mri, thresh, 1e10) ;
  MRIremoveSmallSegments(mriseg, size_thresh) ;
  printf("segmenting volume at threshold %2.1f yields %d segments\n", thresh, mriseg->nsegments) ;

  for (s = 0 ; s < mriseg->nsegments ; s++)
  {
    area = MRIsegmentToLabel(mriseg, mri_abs, s) ;
    sprintf(fname, "%s.%3.3d.label", out_stem, s) ;
    LabelWrite(area, fname) ;
    
  }
  return(0) ;
}
开发者ID:neurodebian,项目名称:freesurfer,代码行数:38,代码来源:mri_make_labels.c



注:本文中的ErrorInit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ErrorInvalidOperation函数代码示例发布时间:2022-05-30
下一篇:
C++ ErrorHandler函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap