本文整理汇总了C++中DiagInit函数的典型用法代码示例。如果您正苦于以下问题:C++ DiagInit函数的具体用法?C++ DiagInit怎么用?C++ DiagInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DiagInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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 */
}
示例3: 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 */
}
示例4: 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) ;
}
示例5: 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) ;
}
示例6: 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) ;
}
示例7: 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) ;
}
示例8: 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) ;
}
示例9: 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() */
示例10: 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 */
}
示例11: 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;
}
示例12: 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 */
}
示例13: 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)
示例14: 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) ;
}
示例15: 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) ;
}