Skip to content
Snippets Groups Projects
Commit caeafcd4 authored by Stephen Smith's avatar Stephen Smith
Browse files

*** empty log message ***

parent 1a899c3b
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
/* avwhd.c - show image header
Steve Smith and Mark Jenkinson, FMRIB Image Analysis Group
With memset(string) suggestion from Bettyann Chodkowski
Copyright (C) 2000-2004 University of Oxford */
......@@ -22,7 +23,7 @@ void usage(void);
void usage(void)
{
printf("\nUsage: avwhd [-x] <input>\n");
printf(" The -x option specifies that a xml-style nifti header will be written\n");
printf(" -x : instead print an XML-style NIFTI header\n");
exit(1);
}
......@@ -102,10 +103,11 @@ void ShowHdr(char *fileName, FSLIO* fslio)
for(i=0;i<8;i++)
printf("dim%d %d\n", i, hdr->dime.dim[i]);
memset(string,0,128);
strncpy(string,hdr->dime.vox_units,4);
printf("vox_units %s\n", string);
memset(string,0,128);
strncpy(string,hdr->dime.cal_units,8);
printf("cal_units %s\n", string);
printf("unused1 %d\n", hdr->dime.unused1);
......@@ -127,12 +129,15 @@ void ShowHdr(char *fileName, FSLIO* fslio)
printf("glmin %d\n", hdr->dime.glmin);
/* Data History */
memset(string,0,128);
strncpy(string,hdr->hist.descrip,80);
printf("descrip %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.aux_file,24);
printf("aux_file %s\n", string);
printf("orient %d\n", hdr->hist.orient);
memset(string,0,128);
strncpy(string,hdr->hist.originator,10);
printf("originator %s\n", string);
{
......@@ -143,21 +148,27 @@ void ShowHdr(char *fileName, FSLIO* fslio)
printf("origin3 %d\n",blah[2]);
}
memset(string,0,128);
strncpy(string,hdr->hist.generated,10);
printf("generated %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.scannum,10);
printf("scannum %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.patient_id,10);
printf("patient_id %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.exp_date,10);
printf("exp_date %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.exp_time,10);
printf("exp_time %s\n", string);
memset(string,0,128);
strncpy(string,hdr->hist.hist_un0,10);
printf("hist_un0 %s\n", string);
......@@ -268,15 +279,15 @@ void ShowHdr(char *fileName, FSLIO* fslio)
printf("file_code %d\n", fslio->niftiptr->nifti_type);
/* Data History */
memset(string,0,128);
strncpy(string,fslio->niftiptr->descrip,80);
printf("descrip %s\n", string);
memset(string,0,128);
strncpy(string,fslio->niftiptr->aux_file,24);
printf("aux_file %s\n", string);
/* printf("orient %d\n", hdr->hist.orient); */
return;
}
/* }}} */
......
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