Skip to content
Snippets Groups Projects
Commit c52c3643 authored by Tom Nichols's avatar Tom Nichols
Browse files

Indenting argument processing

parent 60214cb7
No related branches found
No related tags found
1 merge request!2Fix indenting in siena_diff.cc
......@@ -60,92 +60,89 @@ double total, voxel_volume, voxel_area;
// {{{ process arguments
if (argc<3)
usage();
usage();
string argv1(argv[1]), argv2(argv[2]);
sprintf(fsldir,"%s",getenv("FSLDIR"));
for (i = 3; i < argc; i++) {
if (!strcmp(argv[i], "-i"))
ignore_z=1;
// else if (!strcmp(argv[i], "-e"))
// erode_mask=1;
else if (!strcmp(argv[i], "-d"))
debug=1;
else if (!strcmp(argv[i], "-2"))
seg2=1;
else if (!strcmp(argv[i], "-c"))
// {{{ apply self-calibrating factor
{
i++;
if (argc<i+1)
{
printf("Error: no factor given following -c\n");
usage();
for (i = 3; i < argc; i++)
{
if (!strcmp(argv[i], "-i"))
ignore_z=1;
// else if (!strcmp(argv[i], "-e"))
// erode_mask=1;
else if (!strcmp(argv[i], "-d"))
debug=1;
else if (!strcmp(argv[i], "-2"))
seg2=1;
else if (!strcmp(argv[i], "-c"))
// {{{ apply self-calibrating factor
{
i++;
if (argc<i+1)
{
printf("Error: no factor given following -c\n");
usage();
}
calib=atof(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-m"))
edge_masking=1;
else if (!strcmp(argv[i], "-t"))
// {{{ ignore n slices at top
{
i++;
if (argc<i+1)
{
printf("Error: no number of slices given following -t\n");
usage();
}
ignore_top_slices=atoi(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-b"))
// {{{ ignore n slices at bottom
{
i++;
if (argc<i+1)
{
printf("Error: no number of slices given following -b\n");
usage();
}
ignore_bottom_slices=atoi(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-s"))
// {{{ segmentation options
{
i++;
segoptions[0]=0;
while(i<argc)
{
strcat(segoptions,argv[i]);
strcat(segoptions," ");
i++;
}
}
calib=atof(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-m"))
edge_masking=1;
else if (!strcmp(argv[i], "-t"))
// {{{ ignore n slices at top
{
i++;
if (argc<i+1)
{
printf("Error: no number of slices given following -t\n");
// }}}
else
usage();
}
ignore_top_slices=atoi(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-b"))
// {{{ ignore n slices at bottom
{
i++;
if (argc<i+1)
{
printf("Error: no number of slices given following -b\n");
usage();
}
ignore_bottom_slices=atoi(argv[i]);
}
// }}}
else if (!strcmp(argv[i], "-s"))
// {{{ segmentation options
{
i++;
segoptions[0]=0;
while(i<argc)
{
strcat(segoptions,argv[i]);
strcat(segoptions," ");
i++;
}
}
// }}}
else
usage();
}
}
// }}}
// {{{ transform images and masks
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment