TPCCLIB
Loading...
Searching...
No Matches
imageio.c File Reference

IO functions for image data. More...

#include "tpcclibConfig.h"
#include "tpcimage.h"

Go to the source code of this file.

Functions

char * imgFormatDescr (imgformat c)
 
char * imgDefaultExtension (imgformat c)
 
int imgRead (IMG *img, const char *fname, TPCSTATUS *status)
 
int imgWrite (IMG *img, const char *fname, TPCSTATUS *status)
 
imgformat imgFormatFromFName (const char *fname, TPCSTATUS *status)
 
imgformat imgFormatIdentify (const char *s)
 

Detailed Description

IO functions for image data.

Author
Vesa Oikonen

Definition in file imageio.c.

Function Documentation

◆ imgDefaultExtension()

char * imgDefaultExtension ( imgformat c)

Return pointer to default image file name extension based on the format code.

Remarks
No extension for most formats.
Returns
pointer to the file name extension starting with '.', or empty string.
See also
imgformat
Parameters
cIMG format code

Definition at line 67 of file imageio.c.

70 {
71 if(c<IMG_FORMAT_UNKNOWN || c>=IMG_FORMAT_LAST) return NULL;
72 return (char*)img_fn_ext[c];
73}
@ IMG_FORMAT_LAST
End of list.
Definition tpcimage.h:48

◆ imgFormatDescr()

char * imgFormatDescr ( imgformat c)

Return pointer to image file format description with the format code.

Returns
pointer to the image file format string.
See also
imgformat
Parameters
cIMG format code

Definition at line 36 of file imageio.c.

39 {
40 if(c<IMG_FORMAT_UNKNOWN || c>=IMG_FORMAT_LAST) return NULL;
41 return (char*)img_format[c];
42}

Referenced by imgContents(), imgFillOHeader(), imgReadNifti(), and imgWrite().

◆ imgFormatFromFName()

imgformat imgFormatFromFName ( const char * fname,
TPCSTATUS * status )

Determine IMG file format from file name.

If file name is actually name of an existing path, then DICOM is assumed. Non-existing path can be identified as path only if it ends with '/'.

Note that NIfTI dual file format, Analyze, and microPET files can not be separated by file naming.

Returns
enum imgformat (IMG_FORMAT_DICOM, ...), and IMG_FORMAT_UNKNOWN, when not certain.
See also
imgFormatIdentify, imgRead, imgWrite, micropetExists, niftiExists, anaExists
Parameters
fnameName of file that is used to determine format.
statusPointer to status data; enter NULL if not needed.

Definition at line 394 of file imageio.c.

399 {
400 int verbose=0; if(status!=NULL) verbose=status->verbose;
401 if(verbose>0) {printf("%s(%s)\n", __func__, fname); fflush(stdout);}
402
403 /* Empty name? */
404 if(fname==NULL || strnlen(fname, 2)<1) return(IMG_FORMAT_UNKNOWN);
405
406 /* Path as file name? */
407 if(pathExist(fname)) {
408 if(verbose>1) printf("%s is an existing path\n", fname);
409 return(IMG_FORMAT_DICOM);
410 }
411 if(fname[strlen(fname)-1]=='/' || fname[strlen(fname)-1]=='\\') {
412 if(verbose>1) printf("%s is a non-existing path\n", fname);
413 return(IMG_FORMAT_DICOM);
414 }
415
416 /* Get the extension(s) */
417 char *exts=filenameGetExtensions(fname);
418 if(exts==NULL) {
419 if(verbose>1) printf("file name has no extension\n");
420 /* Probably NIfTI, Analyze, or MicroPET, but we cannot be sure */
421 return(IMG_FORMAT_UNKNOWN);
422 }
423 if(verbose>1) printf("file name extension: '%s'\n", exts);
424
425 /* Check certain common extensions */
426 if(strcasecmp(exts, ".dcm")==0) return(IMG_FORMAT_DICOM);
427 if(strcasecmp(exts, ".dicom")==0) return(IMG_FORMAT_DICOM);
428
429 if(strcasecmp(exts, ".nii")==0) return(IMG_FORMAT_NIFTI_1S);
430
431 if(strcasecmp(exts, ".v")==0) return(IMG_FORMAT_E7);
432 if(strcasecmp(exts, ".s")==0) return(IMG_FORMAT_E7);
433 if(strcasecmp(exts, ".n")==0) return(IMG_FORMAT_E7);
434 if(strcasecmp(exts, ".a")==0) return(IMG_FORMAT_E7);
435 if(strcasecmp(exts, ".scn")==0) return(IMG_FORMAT_E63);
436 if(strcasecmp(exts, ".nrm")==0) return(IMG_FORMAT_E63);
437 if(strcasecmp(exts, ".atn")==0) return(IMG_FORMAT_E63);
438 if(strcasestr(exts, "polarmap")!=NULL) return(IMG_FORMAT_POLARMAP);
439
440 if(strcasecmp(exts, ".if")==0) return(IMG_FORMAT_INTERFILE);
441 if(strcasestr(exts, ".i.hdr")!=NULL) return(IMG_FORMAT_INTERFILE);
442 if(strcasestr(exts, ".i.img")!=NULL) return(IMG_FORMAT_INTERFILE);
443 if(strcasecmp(exts, ".i")==0) return(IMG_FORMAT_INTERFILE);
444
445 if(strcasecmp(exts, ".img")==0) return(IMG_FORMAT_E63);
446
447 if(strcasecmp(exts, ".pet.img")==0) return(IMG_FORMAT_MICROPET);
448 if(strcasecmp(exts, ".pet.img.hdr")==0) return(IMG_FORMAT_MICROPET);
449 if(strcasecmp(exts, ".ct.img")==0) return(IMG_FORMAT_MICROPET);
450 if(strcasecmp(exts, ".ct.img.hdr")==0) return(IMG_FORMAT_MICROPET);
451
452 /* Check certain in-house extensions */
453 if(strcasecmp(exts, ".bin")==0) return(IMG_FORMAT_FLAT);
454 if(strcasecmp(exts, ".mif")==0) return(IMG_FORMAT_FLAT);
455
456 return(IMG_FORMAT_UNKNOWN);
457}
char * filenameGetExtensions(const char *s)
Get all extensions of a file name.
Definition filename.c:203
int pathExist(const char *pathname)
Definition pathexist.c:17
size_t strnlen(const char *s, size_t n)
Definition stringext.c:566
char * strcasestr(const char *haystack, const char *needle)
Definition stringext.c:155
int verbose
Verbose level, used by statusPrint() etc.
@ IMG_FORMAT_POLARMAP
ECAT polar map.
Definition tpcimage.h:38
@ IMG_FORMAT_E7
ECAT 7.* 3D.
Definition tpcimage.h:36
@ IMG_FORMAT_DICOM
DICOM.
Definition tpcimage.h:34
@ IMG_FORMAT_E63
ECAT 6.3.
Definition tpcimage.h:35
@ IMG_FORMAT_INTERFILE
Interfile.
Definition tpcimage.h:41
@ IMG_FORMAT_UNKNOWN
Unknown format.
Definition tpcimage.h:33
@ IMG_FORMAT_NIFTI_1S
NIfTI-1 single-file format.
Definition tpcimage.h:43
@ IMG_FORMAT_MICROPET
MicroPET.
Definition tpcimage.h:46
@ IMG_FORMAT_FLAT
Flat format.
Definition tpcimage.h:47

Referenced by imgWrite().

◆ imgFormatIdentify()

imgformat imgFormatIdentify ( const char * s)

Identify the string representation of the IMG file format.

Returns
enum imgformat, or 0 (enum IMG_FORMAT_UNKNOWN) if not identified.
See also
imgFormatFromFName
Author
Vesa Oikonen
Parameters
sIMG format as a string

Definition at line 466 of file imageio.c.

469 {
470 if(s==NULL || strlen(s)<1) return IMG_FORMAT_UNKNOWN;
471 /* Try if string can be found directly in the table */
472 for(int i=0; i<IMG_FORMAT_LAST; i++) {
473 if(strcasecmp(img_format[i], s)==0) return i;
474 }
475 /* Format string is not following TPC standard, lets try something else */
476 if( strcasecmp(s, "bin")==0) return IMG_FORMAT_FLAT;
477 else if(strcasecmp(s, "v")==0) return IMG_FORMAT_E7;
478 else if(strcasecmp(s, "dcm")==0) return IMG_FORMAT_DICOM;
479 else if(strcasecmp(s, "ana")==0) return IMG_FORMAT_ANA_L;
480 else if(strcasecmp(s, "nii")==0) return IMG_FORMAT_NIFTI_1S;
481 else if(strcasecmp(s, "nifti")==0) return IMG_FORMAT_NIFTI_1S;
482
483 return IMG_FORMAT_UNKNOWN;
484}
@ IMG_FORMAT_ANA_L
Analyze little-endian.
Definition tpcimage.h:40

◆ imgRead()

int imgRead ( IMG * img,
const char * fname,
TPCSTATUS * status )

Read image file into IMG structure.

Remarks
Stub function, mostly.
See also
imgInit, imgWrite, imgFree
Returns
enum tpcerror (TPCERROR_OK when successful).
Parameters
imgPointer to initialized image structure; old contents are deleted.
Precondition
Initialize structure using imgInit() before this.
Parameters
fnamePointer to the file name, possibly path in case of DICOM.
statusPointer to status data; enter NULL if not needed.

Definition at line 82 of file imageio.c.

90 {
91 int verbose=0; if(status!=NULL) verbose=status->verbose;
92 if(verbose>0) {printf("%s(img, %s)\n", __func__, fname); fflush(stdout);}
93
94 if(img==NULL || strnlen(fname, 2)<1) {
95 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_FAIL);
96 return(TPCERROR_FAIL);
97 }
98
99 /* Delete any old contents in data structure */
100 imgFree(img);
101
102 /* What kind of data are we supposed to read? */
103 if(pathExist(fname)) {
104
105 if(verbose>2) printf("%s is a path\n", fname);
106 unsigned short int fileNr=pathFileNr(fname);
107 if(verbose>2) printf("%s contains %u file(s)\n", fname, fileNr);
108 if(fileNr==0) {
109 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_NO_FILE);
110 return(TPCERROR_NO_FILE);
111 }
112 /* Check if this is a DICOM folder */
113 IFT fl; iftInit(&fl);
114 int ret=dcmFileList(fname, &fl, status);
115 if(ret==TPCERROR_OK) {
116 if(verbose>2) printf("%s is DICOM folder.\n", fname);
118 } else {
119 if(verbose>2) printf("%s is not a DICOM folder.\n", fname);
120 fileNr=pathFileList(fname, &fl); // just read the file list
121 }
122 if(fileNr==0) {
123 iftFree(&fl);
124 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_NO_FILE);
125 return(TPCERROR_NO_FILE);
126 }
127 /* It would be too risky to just open random file from the folder */
128 iftFree(&fl);
129 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
130 return(TPCERROR_UNSUPPORTED);
131
132 } else if(fileExist(fname)) {
133
134 if(verbose>2) printf("%s is a file\n", fname);
135 /* Check if this is DICOM file */
136 if(dcmVerifyMagic(fname, NULL)) {
137 /*if(verbose>2)*/ printf("%s is in DICOM format.\n", fname);
139 /* This may be a single-file DICOM, or user just gave the name of one file in DICOM folder */
140 IFT fl; iftInit(&fl);
141 int ret=dcmFileList(fname, &fl, status);
142 if(ret!=TPCERROR_OK) {iftFree(&fl); return(ret);}
143 if(fl.keyNr==1) {
144 if(verbose>2) printf(" %s is a single DICOM file\n", fname);
145 iftFree(&fl);
146 ret=imgReadDICOM(img, fname, status);
147 if(verbose>2) printf(" imgReadDICOM() := %s\n", errorMsg(status->error));
148 return(ret);
149 } else {
150 if(verbose>2) printf(" %s is one of %d DICOM files\n", fname, fl.keyNr);
151
152 iftFree(&fl);
153 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
154 return(TPCERROR_UNSUPPORTED);
155 }
156 }
157 /* Check if we have NIfTI file, which may be in single file format,
158 or dual file format which has similar names as microPET and Analyze */
159 if(niftiExists(fname, NULL, NULL, NULL, NULL, status)==1) {
160 if(verbose>2) printf("%s is in NIfTI format.\n", fname);
161 /* Read NIfTI image */
162 return(imgReadNifti(img, fname, status));
163 /*statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
164 return(TPCERROR_UNSUPPORTED);*/
165 }
166 /* Check if we have Analyze file, which may be in dual file format which
167 has similar names as microPET and dual-file NIfTI */
168 if(anaExists(fname, NULL, NULL, NULL, NULL, status)==1) {
169 /* Read Analyze image */
170 /*if(verbose>2)*/ printf("%s is in Analyze format.\n", fname);
171 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
172 return(TPCERROR_UNSUPPORTED);
173 }
174
175 } else { // Not a folder, neither an existing file
176
177 /* Check if this is base name of an image, without extension(s) */
178 /* Check if we have NIfTI file, which may be in single file format,
179 or dual file format which has similar names as microPET and Analyze */
180 if(niftiExists(fname, NULL, NULL, NULL, NULL, status)==1) {
181 /* Read NIfTI image */
182 /*if(verbose>2)*/ printf("%s is in NIfTI format.\n", fname);
183 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
184 return(TPCERROR_UNSUPPORTED);
185 }
186 /* Check if we have Analyze file, which may be in dual file format which
187 has similar names as microPET and dual-file NIfTI */
188 if(anaExists(fname, NULL, NULL, NULL, NULL, status)==1) {
189 /* Read Analyze image */
190 /*if(verbose>2)*/ printf("%s is in Analyze format.\n", fname);
191 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
192 return(TPCERROR_UNSUPPORTED);
193 }
194 /* Check for microPET */
195
196
197 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_NO_FILE);
198 return(TPCERROR_NO_FILE);
199 }
200
201
202
203 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_OK);
204 return(TPCERROR_OK);
205}
int anaExists(const char *filename, char *hdrfile, char *imgfile, char *siffile, ANALYZE_DSR *header, TPCSTATUS *status)
Definition analyzeio.c:16
int dcmFileList(const char *filename, IFT *ift, TPCSTATUS *status)
List DICOM files belonging to one image.
Definition dcmfile.c:123
int dcmVerifyMagic(const char *filename, FILE *fp)
Definition dcmio.c:25
unsigned short int pathFileNr(const char *pathname)
Definition filexist.c:33
unsigned short int pathFileList(const char *pathname, IFT *ift)
Definition filexist.c:83
int fileExist(const char *filename)
Definition filexist.c:17
void iftFree(IFT *ift)
Definition ift.c:37
void iftInit(IFT *ift)
Definition ift.c:21
void imgFree(IMG *img)
Definition image.c:107
int imgReadDICOM(IMG *img, const char *fname, TPCSTATUS *status)
Definition imagedcm.c:23
int imgReadNifti(IMG *img, const char *fname, TPCSTATUS *status)
Definition imagenii.c:72
int niftiExists(const char *filename, char *hdrfile, char *imgfile, char *siffile, NIFTI_DSR *header, TPCSTATUS *status)
Definition niftiio.c:17
char * errorMsg(tpcerror e)
Definition statusmsg.c:68
void statusSet(TPCSTATUS *s, const char *func, const char *srcfile, int srcline, tpcerror error)
Definition statusmsg.c:142
Definition tpcift.h:43
int keyNr
Definition tpcift.h:47
imgformat format
Definition tpcimage.h:103
tpcerror error
Error code.
@ TPCERROR_NO_FILE
File does not exist.
@ TPCERROR_FAIL
General error.
@ TPCERROR_UNSUPPORTED
Unsupported file type.
@ TPCERROR_OK
No error.

◆ imgWrite()

int imgWrite ( IMG * img,
const char * fname,
TPCSTATUS * status )

Write image file from IMG structure.

Remarks
Stub function.
See also
imgInit, imgRead, imgFree
Returns
enum tpcerror (TPCERROR_OK when successful).
Parameters
imgPointer to image structure.
fnamePointer to the file name, possibly path in case of DICOM.
statusPointer to status data; enter NULL if not needed.

Definition at line 214 of file imageio.c.

221 {
222 int verbose=0; if(status!=NULL) verbose=status->verbose;
223 if(verbose>0) {printf("%s(img, %s)\n", __func__, fname); fflush(stdout);}
224
225 if(img==NULL || strnlen(fname, 2)<1) {
226 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_FAIL);
227 return(TPCERROR_FAIL);
228 }
229 if(!imgHasData(img)) {
230 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_NO_DATA);
231 return(TPCERROR_NO_DATA);
232 }
233
234 /* Based on file name, guess file format, and use it, or check that specified format is ok */
235 imgformat format=imgFormatFromFName(fname, NULL);
236 if(format!=IMG_FORMAT_UNKNOWN) {
237 if(img->oformat==IMG_FORMAT_UNKNOWN) {
238 img->oformat=format;
239 if(verbose>1)
240 printf("based on file name, output format set to %s\n", imgFormatDescr(img->oformat));
241 } else if(format!=img->oformat) {
242 if(verbose>1)
243 printf("file name is not suitable for format %s\n", imgFormatDescr(img->oformat));
244 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_INVALID_FILENAME);
246 }
247 }
248 /* If output format is not yet set, then use input format */
250 img->oformat=img->format;
251 if(verbose>1) printf("output set to same as input format (%s)\n", imgFormatDescr(img->oformat));
252 }
253 /* If output format still unknown, set it to singe-file NIfTI */
254 if(img->oformat==IMG_FORMAT_UNKNOWN) {
256 if(verbose>1) printf("output format set to default (%s)\n", imgFormatDescr(img->oformat));
257 }
258
259 /* Fill output header */
260 if(imgFillOHeader(img, status)!=TPCERROR_OK) return(TPCERROR_INVALID_HEADER);
261
262 /* Write image */
263 if(img->oformat==IMG_FORMAT_DICOM) {
264
265 if(verbose>1) printf("writing %s\n", imgFormatDescr(img->oformat));
266
267 } else if(img->oformat==IMG_FORMAT_NIFTI_1D || img->oformat==IMG_FORMAT_NIFTI_1S) {
268
269 if(verbose>1) printf("writing %s\n", imgFormatDescr(img->oformat));
270 return(imgWriteNifti(img, fname, status));
271
272 } else if(img->oformat==IMG_FORMAT_E7) {
273
274 if(verbose>1) printf("writing %s\n", imgFormatDescr(img->oformat));
275
276 /* Create main header data block */
277 unsigned char mh[ECATBLKSIZE];
278 int ret=ecatWriteMainheader(&img->oh, mh, status);
279 if(ret!=TPCERROR_OK) return(ret);
280
281 /* Open file, write main header block, and initiate matrix list */
282
283 /* Process each frame */
284 for(unsigned int ti=0; ti<img->dimt; ti++) {
285 /* Create subheader data block */
286
287 /* Create blocks for pixel data */
288
289 /* Write header and data blocks */
290
291 }
292
293 /* Close file */
294
295 } else if(img->oformat==IMG_FORMAT_E63) {
296
297 if(verbose>1) printf("writing %s\n", imgFormatDescr(img->oformat));
298
299 /* Create main header data block */
300
301 /* Open file, write main header block, and initiate matrix list */
302
303 /* Process each plane and frame */
304 for(unsigned int ti=0; ti<img->dimt; ti++) {
305 for(unsigned int zi=0; zi<img->dimz; zi++) {
306 /* Create subheader data block */
307
308 /* Create blocks for pixel data */
309
310 /* Write header and data blocks */
311
312 }
313 }
314
315 /* Close file */
316
317 } else if(img->oformat==IMG_FORMAT_FLAT) {
318
319 if(verbose>1) printf("writing %s\n", imgFormatDescr(img->oformat));
320 FILE *fp=NULL;
321 float *fdata=NULL, *fptr;
322 if(verbose>2) printf("opening %s\n", fname);
323 if((fp=fopen(fname, "wb")) == NULL) {
324 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_CANNOT_WRITE);
325 return(TPCERROR_CANNOT_WRITE);
326 }
327 /* Allocate memory for float data for one frame */
328 unsigned long long pxlNr=img->dimz*img->dimy*img->dimx;
329 if(verbose>2) printf("allocating memory for %llu pixels\n", pxlNr);
330 fdata=(float*)malloc(pxlNr*sizeof(float));
331 if(fdata==NULL) {
332 fclose(fp);
333 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_OUT_OF_MEMORY);
335 }
336 /* Write one frame at a time */
337 if(verbose>2) printf("writing frame at a time\n");
338 for(int ti=0; ti<img->dimt; ti++) {
339 fptr=fdata;
340 for(int zi=0; zi<img->dimz; zi++)
341 for(int yi=0; yi<img->dimy; yi++)
342 for(int xi=0; xi<img->dimx; xi++)
343 *fptr++=img->m[zi][yi][xi][ti];
344 if(fwrite((float*)fdata, 4, pxlNr, fp) != pxlNr) {
345 fclose(fp); remove(fname); free(fdata);
346 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_CANNOT_WRITE);
347 return(TPCERROR_CANNOT_WRITE);
348 }
349 } /* next frame */
350 /* Close file, free memory */
351 fclose(fp); free(fdata);
352 if(verbose>2) printf("binary file written\n");
353 /* Write matrix information file; no error if not successful. */
354 char miffile[strlen(fname)+5]; sprintf(miffile, "%s.mif", fname);
355 if(verbose>2) printf("opening matrix information file %s\n", miffile);
356 if((fp=fopen(miffile, "w")) == NULL) {
357 if(verbose>0) fprintf(stderr, "Error: cannot open MIF for write.\n");
358 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_OK);
359 return(TPCERROR_OK);
360 }
361 if(verbose>2) printf("writing matrix information file %s\n", miffile);
362 int n=fprintf(fp, "%d %d %d %d\n", img->dimz, img->dimt, img->dimx, img->dimy);
363 fclose(fp);
364 if(n<7) {
365 if(verbose>0) fprintf(stderr, "Error: cannot write in file %s\n", miffile);
366 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_OK);
367 return(TPCERROR_OK);
368 }
369 if(verbose>2) printf("matrix information saved in %s\n", miffile);
370
371 } else {
372 if(verbose>0) printf("output format (%s) not supported\n", imgFormatDescr(img->oformat));
373 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_UNSUPPORTED);
374 return(TPCERROR_UNSUPPORTED);
375 }
376
377 statusSet(status, __func__, __FILE__, __LINE__, TPCERROR_OK);
378 return(TPCERROR_OK);
379}
int ecatWriteMainheader(IFT *ift, unsigned char *buf, TPCSTATUS *status)
Definition ecatheader.c:25
int imgHasData(IMG *img)
Definition image.c:218
int imgFillOHeader(IMG *img, TPCSTATUS *status)
Definition imageheader.c:61
imgformat imgFormatFromFName(const char *fname, TPCSTATUS *status)
Definition imageio.c:394
char * imgFormatDescr(imgformat c)
Definition imageio.c:36
int imgWriteNifti(IMG *img, const char *fname, TPCSTATUS *status)
Definition imagenii.c:390
unsigned short int dimx
Definition tpcimage.h:112
float **** m
Definition tpcimage.h:161
unsigned short int dimt
Definition tpcimage.h:110
unsigned short int dimz
Definition tpcimage.h:116
unsigned short int dimy
Definition tpcimage.h:114
IFT oh
Definition tpcimage.h:210
imgformat oformat
Definition tpcimage.h:105
#define ECATBLKSIZE
Definition tpcecat.h:37
@ TPCERROR_INVALID_HEADER
Invalid header contents.
@ TPCERROR_OUT_OF_MEMORY
Cannot allocate memory.
@ TPCERROR_INVALID_FILENAME
Invalid file name.
@ TPCERROR_NO_DATA
File contains no data.
@ TPCERROR_CANNOT_WRITE
Cannot write file.
imgformat
Definition tpcimage.h:32
@ IMG_FORMAT_NIFTI_1D
NIfTI-1 dual-file format.
Definition tpcimage.h:42