Go to the documentation of this file.
24 #if !defined(__FSLIO_H)
104 #define FSL_TYPE_ANALYZE 0
105 #define FSL_TYPE_NIFTI 1
106 #define FSL_TYPE_NIFTI_PAIR 2
107 #define FSL_TYPE_MINC 4
108 #define FSL_TYPE_ANALYZE_GZ 100
109 #define FSL_TYPE_NIFTI_GZ 101
110 #define FSL_TYPE_NIFTI_PAIR_GZ 102
111 #define FSL_TYPE_MINC_GZ 104
114 #define FSL_RADIOLOGICAL -1
115 #define FSL_NEUROLOGICAL 1
141 FSLIO *
FslXOpen(
const char *filename,
const char *opts,
int filetype);
142 int FslSeekVolume(
FSLIO *fslio,
size_t vols);
157 int FslFileExists(
const char *filename);
158 char *FslMakeBaseName(
const char *fname);
159 int FslCheckForMultipleFileNames(
const char* filename);
160 int FslGetEnvOutputType(
void);
162 void FslSetIgnoreMFQ(
int flag);
163 int FslGetIgnoreMFQ(
void);
164 void FslSetOverrideOutputType(
int type);
165 int FslGetOverrideOutputType(
void);
168 int FslGetFileType(
const FSLIO *fslio);
169 void FslSetFileType(
FSLIO *fslio,
int filetype);
170 int FslIsSingleFileType(
int filetype);
171 int FslIsCompressedFileType(
int filetype);
172 int FslBaseFileType(
int filetype);
175 int FslGetWriteMode(
const FSLIO *fslio);
176 void FslSetWriteMode(
FSLIO *fslio,
int mode);
178 void AvwSwapHeader(
struct dsr *avw);
179 int FslReadRawHeader(
void *buffer,
const char* filename);
185 void FslInitHeader(
FSLIO *fslio,
short t,
186 size_t x,
size_t y,
size_t z,
size_t v,
187 float vx,
float vy,
float vz,
float tr,
189 void FslSetInit(
FSLIO* fslio);
190 void FslCloneHeader(
FSLIO *dest,
const FSLIO *src);
195 size_t FslGetVolSize(
FSLIO *fslio);
197 void FslSetDim(
FSLIO *fslio,
short x,
short y,
short z,
short v);
198 void FslGetDim(
FSLIO *fslio,
short *x,
short *y,
short *z,
short *v);
199 void FslSetDimensionality(
FSLIO *fslio,
size_t dim);
200 void FslGetDimensionality(
FSLIO *fslio,
size_t *dim);
201 void FslSetVoxDim(
FSLIO *fslio,
float x,
float y,
float z,
float tr);
202 void FslGetVoxDim(
FSLIO *fslio,
float *x,
float *y,
float *z,
float *tr);
203 void FslGetCalMinMax(
FSLIO *fslio,
float *min,
float *max);
204 void FslSetCalMinMax(
FSLIO *fslio,
float min,
float max);
205 void FslGetAuxFile(
FSLIO *fslio,
char *aux_file);
206 void FslSetAuxFile(
FSLIO *fslio,
const char *aux_file);
207 void FslSetTimeUnits(
FSLIO *fslio,
const char *units);
208 void FslGetTimeUnits(
FSLIO *fslio,
char *units);
209 void FslSetDataType(
FSLIO *fslio,
short t);
210 size_t FslGetDataType(
FSLIO *fslio,
short *t);
211 int FslGetIntensityScaling(
FSLIO *fslio,
float *slope,
float *intercept);
212 void FslSetIntent(
FSLIO *fslio,
short intent_code,
float p1,
float p2,
float p3);
213 short FslGetIntent(
FSLIO *fslio,
short *intent_code,
float *p1,
float *p2,
217 short FslGetStdXform(
FSLIO *fslio,
mat44 *stdmat);
218 void FslSetStdXform(
FSLIO *fslio,
short sform_code,
mat44 stdmat);
219 void FslGetMMCoord(
mat44 stdmat,
float voxx,
float voxy,
float voxz,
220 float *mmx,
float *mmy,
float *mmz);
222 void FslGetVoxCoord(
mat44 stdmat,
float mmx,
float mmy,
float mmz,
223 float *voxx,
float *voxy,
float *voxz);
224 short FslGetRigidXform(
FSLIO *fslio,
mat44 *rigidmat);
225 void FslSetRigidXform(
FSLIO *fslio,
short qform_code,
mat44 rigidmat);
226 int FslGetLeftRightOrder(
FSLIO *fslio);
230 void FslSetAnalyzeSform(
FSLIO *fslio,
const short *orig,
231 float dx,
float dy,
float dz);
232 void FslGetAnalyzeOrigin(
FSLIO *fslio,
short orig[5]);
247 typedef unsigned char THIS_UINT8;
248 typedef char THIS_INT8;
249 typedef unsigned short THIS_UINT16;
250 typedef short THIS_INT16;
251 typedef unsigned int THIS_UINT32;
252 typedef int THIS_INT32;
253 typedef unsigned long THIS_UINT64;
254 typedef long THIS_INT64;
255 typedef float THIS_FLOAT32;
256 typedef double THIS_FLOAT64;
262 double ****
d4matrix(
int th,
int zh,
int yh,
int xh);
263 double ***
d3matrix(
int zh,
int yh,
int xh);
double *** FslGetVolumeAsScaledDouble(FSLIO *fslio, int vol)
Return volume #vol (0-based) as a 3D array of scaled doubles.
Definition: fslio.c:2117
size_t FslWriteVolumes(FSLIO *fslio, const void *buffer, size_t nvols)
Write the first nvols volumes in buffer to disk.
Definition: fslio.c:899
size_t FslReadVolumes(FSLIO *fslio, void *buffer, size_t nvols)
Read the first nvols Volumes from a 4D dataset.
Definition: fslio.c:833
double **** d4matrix(int th, int zh, int yh, int xh)
allocate a 4D buffer, use 1 contiguous buffer for the data
Definition: fslio.c:2392
Data structures for using nifti1_io API.
FSLIO * FslXOpen(const char *filename, const char *opts, int filetype)
Opens a file for either reading or writing.
Definition: fslio.c:652
size_t FslReadSliceSeries(FSLIO *fslio, void *buffer, short slice, size_t nvols)
Read one slice from each of the first nvols volumes in the dataset, ie get an xyt buffer.
Definition: fslio.c:998
Definition: nifti1_io.h:62
size_t FslReadRowSeries(FSLIO *fslio, void *buffer, short row, short slice, size_t nvols)
Read one row from one slice for first nvols volumes in dataset; ie get an xt buffer.
Definition: fslio.c:1055
FSLIO * FslReadHeader(char *fname)
Reads nifti/anz header, no data is read.
Definition: fslio.c:2075
High level data structure for open nifti datasets in the nifti1_io API. Note that this structure is n...
Definition: nifti1_io.h:88
Definition: nifti1_io.h:58
const char * FslFileTypeString(int filetype)
Return a string describing the format of the dataset.
Definition: fslio.c:47
size_t FslReadTimeSeries(FSLIO *fslio, void *buffer, short xVox, short yVox, short zVox, size_t nvols)
Read one voxel (xyz location) from first nvols volumes in dataset; ie get a t dim buffer.
Definition: fslio.c:1114
double *** d3matrix(int zh, int yh, int xh)
allocate a 3D buffer, use 1 contiguous buffer for the data
Definition: fslio.c:2343
High level data structure for open datasets in the fslio API.
Definition: fslio.h:124
FSLIO * FslOpen(const char *filename, const char *opts)
Opens a file for either reading or writing.
Definition: fslio.c:624
double **** FslGetBufferAsScaledDouble(FSLIO *fslio)
Return the fslio data buffer of a 1-4D dataset as a 4D array of scaled doubles.
Definition: fslio.c:2204
int convertBufferToScaledDouble(double *outbuf, void *inbuf, long len, float slope, float inter, int nifti_datatype)
allocate a 4D buffer, use 1 contiguous buffer for the data
Definition: fslio.c:2275
FSLIO * FslInit(void)
allocate space for the FSLIO struct and set some sensible defaults
Definition: fslio.c:372
void FslWriteAllVolumes(FSLIO *fslio, const void *buffer)
Writes all data from buffer (using size info from fslio) to file.
Definition: fslio.c:868
int FslClose(FSLIO *fslio)
Write header and image data if this dataset was open for writing. Close the dataset header and data f...
Definition: fslio.c:1906
void * FslReadAllVolumes(FSLIO *fslio, char *filename)
Read the header and all data into the FSLIO structure.
Definition: fslio.c:789
void FslWriteHeader(FSLIO *fslio)
Writes nifti/anz header and opens img file ready for writing.
Definition: fslio.c:954