Skip to content
Snippets Groups Projects
Commit d8b23c91 authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Added basename option to avwsplit

parent 4938cf7b
No related branches found
No related tags found
No related merge requests found
...@@ -21,12 +21,13 @@ int main(int argc, char **argv) ...@@ -21,12 +21,13 @@ int main(int argc, char **argv)
size_t bufsz; size_t bufsz;
void *buffer; void *buffer;
unsigned int i; unsigned int i;
char units[1024]; /* char units[1024]; */
char filename[10000]; char filename[10000];
char basename[10000];
if (argc<2) if (argc<2)
{ {
printf("\nUsage: avwsplit <inputfile.hdr>\n\n"); printf("\nUsage: avwsplit <inputfile.hdr> [basename]\n\n");
exit(1); exit(1);
} }
...@@ -37,6 +38,13 @@ int main(int argc, char **argv) ...@@ -37,6 +38,13 @@ int main(int argc, char **argv)
exit(-1); exit(-1);
} }
if (argc>=3) {
strcpy(basename,argv[2]);
} else {
strcpy(basename,"vol");
}
FslGetDim(src,&x,&y,&z,&v); FslGetDim(src,&x,&y,&z,&v);
FslGetVoxDim(src,&vx,&vy,&vz,&tr); FslGetVoxDim(src,&vx,&vy,&vz,&tr);
...@@ -49,7 +57,7 @@ int main(int argc, char **argv) ...@@ -49,7 +57,7 @@ int main(int argc, char **argv)
FslReadVolumes(src, buffer, 1); FslReadVolumes(src, buffer, 1);
sprintf(opfn, "vol%04d", i); sprintf(opfn, "%s%04d", basename, i);
/*printf("Writing %s\r", opfn);*/ /*printf("Writing %s\r", opfn);*/
dest = FslOpen(opfn, "w"); dest = FslOpen(opfn, "w");
......
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