Hello!
I have created a NIFTI file with, what I thought, minimalistic header.
What I mean is that I created a file with minimal set of fields different
from zero:
h = memset(h,0,sizeof(struct nifti_1_header));
h->sizeof_hdr = 348;
h->dim[0] = 7;
h->dim[1] = h->dim[2] = h->dim[3] = 1;
h->dim[4] = h->dim[5] = h->dim[6] = h->dim[7] = 1;
h->bitpix = 32;
h->datatype = NIFTI_TYPE_FLOAT32;
h->vox_offset = 348;
h->scl_slope = 1.0;
sprintf(h->magic,"ni1"); /* 1-file NIFTI file magic */
And then I set the dimensions:
h->dim[1] = NX;
h->dim[2] = NY;
h->dim[3] = NZ;
I thought that this should be enough for avwhd/fslview to open the file.
However, an error is generated:
** ERROR: nifti_convert_nhdr_to_nim: bad filename
Segmentation fault
Am I forgetting something or FSL needs more info to open a file? If yes,
what?
Thank you for your help
Lazar
|