Author: Ron Kneusel (---.ittvis.com)
Date: 04-13-09 11:30
Rick-
> What version of niftilib do you have?
nifti library version 1.35 (3 Aug, 2008)
>Do you really want the fslio routines for something?
No. I was just looking for the simplest way to open a file and get the
data and the header into IDL. The interface code for IDL is pure C, so
that is the layer I'm working in. I am not trying to write IDL code to
read the files directly.
So, for example, a simple interface might be:
IDL> data = nifti_read('somefile.nii', HEADER=header)
Where the variable data will hold all the data for the file, 2D if an
image, 3D if a volume, or 4D if a series of volumes. The variable
header will hold the nifti header. Similarly, something like this for
write:
IDL> nifti_write, data, header, 'mynewfile.hdr.gz'
The trick being that the various formats (nii or hdr/img, gzip or no) be
supported as well. Ie, the nifti_write call would create a gzip hdr/img
pair of files.
The header can be manipulated as an IDL structure which maps the
appropriate C structure down in the interface code.
Ron
|
|