|
TPCCLIB
|
Header file for libtpcnifti. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "tpcextensions.h"#include "tpcift.h"#include "tpcfileutil.h"Go to the source code of this file.
Data Structures | |
| struct | NIFTI_1_HEADER |
| struct | NIFTI_2_HEADER |
| struct | NIFTI_EXTENDER |
| struct | NIFTI_DSR |
| struct | ANALYZE_HEADER |
| struct | ANALYZE_DSR |
Functions | |
| void | niftiBasename (char *filename) |
| int | niftiExists (const char *filename, char *hdrfile, char *imgfile, char *siffile, NIFTI_DSR *header, TPCSTATUS *status) |
| int | niftiReadHeader (const char *filename, NIFTI_DSR *dsr, int verbose) |
| int | niftiWriteHeader (const char *filename, NIFTI_DSR *dsr, int verbose) |
| int | anaExists (const char *filename, char *hdrfile, char *imgfile, char *siffile, ANALYZE_DSR *header, TPCSTATUS *status) |
| int | anaReadHeader (const char *filename, ANALYZE_DSR *dsr, int verbose) |
Header file for libtpcnifti.
Function are not intended to support all NIfTI and Analyze files or file properties, but only those that have been found necessary in Turku PET Centre. For full NIfTI support, use other libraries, e.g. niftilib http://niftilib.sourceforge.net/
NIfTI-1 and NIfTI-2 documentation and source codes in http://nifti.nimh.nih.gov/
Procedures in this file are not dependent on IMG struct.
Definition in file tpcnifti.h.
| #define ANALYZE_DT_ALL 255 |
Analyze 7.5 data type
Definition at line 85 of file tpcnifti.h.
| #define ANALYZE_DT_BINARY 1 |
Analyze 7.5 data type, 1 bit
Definition at line 69 of file tpcnifti.h.
| #define ANALYZE_DT_COMPLEX 32 |
Analyze 7.5 data type, 64 bits (two floats)
Definition at line 79 of file tpcnifti.h.
| #define ANALYZE_DT_DOUBLE 64 |
Analyze 7.5 data type, 64 bits
Definition at line 81 of file tpcnifti.h.
| #define ANALYZE_DT_FLOAT 16 |
Analyze 7.5 data type, 32 bits
Definition at line 77 of file tpcnifti.h.
| #define ANALYZE_DT_NONE 0 |
Analyze 7.5 data type
Definition at line 65 of file tpcnifti.h.
| #define ANALYZE_DT_RGB 128 |
Analyze 7.5 data type
Definition at line 83 of file tpcnifti.h.
| #define ANALYZE_DT_SIGNED_INT 8 |
Analyze 7.5 data type, 32 bits
Definition at line 75 of file tpcnifti.h.
| #define ANALYZE_DT_SIGNED_SHORT 4 |
Analyze 7.5 data type, 16 bits
Definition at line 73 of file tpcnifti.h.
| #define ANALYZE_DT_UNKNOWN 0 |
Analyze 7.5 data type
Definition at line 67 of file tpcnifti.h.
| #define ANALYZE_DT_UNSIGNED_CHAR 2 |
Analyze 7.5 data type, 8 bits
Definition at line 71 of file tpcnifti.h.
| #define ANALYZE_HEADER_SIZE 348 |
| #define NIFTI1_HEADER_EXTENDER_SIZE 4 |
NIFTI1 header extender size
Definition at line 35 of file tpcnifti.h.
Referenced by imgSetNiftiHeader(), and niftiWriteHeader().
| #define NIFTI1_HEADER_SIZE 348 |
NIFTI1 header size
Definition at line 33 of file tpcnifti.h.
Referenced by imgReadNifti(), imgSetNiftiHeader(), niftiReadHeader(), and niftiWriteHeader().
| #define NIFTI2_HEADER_EXTENDER_SIZE 4 |
NIFTI2 header extender size
Definition at line 39 of file tpcnifti.h.
Referenced by imgSetNiftiHeader().
| #define NIFTI2_HEADER_SIZE 540 |
NIFTI2 header size
Definition at line 37 of file tpcnifti.h.
Referenced by anaReadHeader(), imgReadNifti(), imgSetNiftiHeader(), niftiReadHeader(), and niftiWriteHeader().
| #define NIFTI_DT_ALL ANALYZE_DT_ALL |
NIFTI1 data type (compatible with Analyze)
Definition at line 108 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_BINARY ANALYZE_DT_BINARY |
NIFTI1 data type 1 bit (compatible with Analyze)
Definition at line 92 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_COMPLEX ANALYZE_DT_COMPLEX |
NIFTI1 data type 64 bits (compatible with Analyze)
Definition at line 102 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_DOUBLE ANALYZE_DT_DOUBLE |
NIFTI1 data type 64 bits (compatible with Analyze)
Definition at line 104 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_DOUBLE_PAIR 1792 |
NIFTI1 data type 128 bits, complex double
Definition at line 122 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_FLOAT ANALYZE_DT_FLOAT |
NIFTI1 data type 32 bits (compatible with Analyze)
Definition at line 100 of file tpcnifti.h.
Referenced by imgReadNifti(), and imgSetNiftiHeader().
| #define NIFTI_DT_LONG_DOUBLE 1536 |
| #define NIFTI_DT_LONG_DOUBLE_PAIR 2048 |
NIFTI1 data type 256 bits, complex long double
Definition at line 124 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_LONG_LONG 1024 |
| #define NIFTI_DT_NONE ANALYZE_DT_NONE |
NIFTI1 data type (compatible with Analyze)
Definition at line 88 of file tpcnifti.h.
| #define NIFTI_DT_RGB ANALYZE_DT_RGB |
NIFTI1 data type 24 bits (compatible with Analyze)
Definition at line 106 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_RGBA 2304 |
NIFTI1 data type 32 bits, 4-byte RGBA
Definition at line 126 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_SIGNED_CHAR 256 |
| #define NIFTI_DT_SIGNED_INT ANALYZE_DT_SIGNED_INT |
NIFTI1 data type 32 bits (compatible with Analyze)
Definition at line 98 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_SIGNED_SHORT ANALYZE_DT_SIGNED_SHORT |
NIFTI1 data type 16 bits (compatible with Analyze)
Definition at line 96 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_UNKNOWN ANALYZE_DT_UNKNOWN |
NIFTI1 data type (compatible with Analyze)
Definition at line 90 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_UNSIGNED_CHAR ANALYZE_DT_UNSIGNED_CHAR |
NIFTI1 data type 8 bits (compatible with Analyze)
Definition at line 94 of file tpcnifti.h.
Referenced by imgReadNifti().
| #define NIFTI_DT_UNSIGNED_INT 768 |
| #define NIFTI_DT_UNSIGNED_LONG_LONG 1280 |
| #define NIFTI_DT_UNSIGNED_SHORT 512 |
| #define NIFTI_INTENT_BETA 7 |
NIFTI1 intent statistics
Definition at line 141 of file tpcnifti.h.
| #define NIFTI_INTENT_BINOM 8 |
NIFTI1 intent statistics
Definition at line 143 of file tpcnifti.h.
| #define NIFTI_INTENT_CHI 19 |
NIFTI1 intent statistics
Definition at line 165 of file tpcnifti.h.
| #define NIFTI_INTENT_CHISQ 6 |
NIFTI1 intent statistics
Definition at line 139 of file tpcnifti.h.
| #define NIFTI_INTENT_CHISQ_NONC 13 |
NIFTI1 intent statistics
Definition at line 153 of file tpcnifti.h.
| #define NIFTI_INTENT_CORREL 2 |
NIFTI1 intent statistics
Definition at line 131 of file tpcnifti.h.
| #define NIFTI_INTENT_DIMLESS 1011 |
NIFTI1 intent other
Definition at line 197 of file tpcnifti.h.
| #define NIFTI_INTENT_DISPVECT 1006 |
NIFTI1 intent other
Definition at line 187 of file tpcnifti.h.
| #define NIFTI_INTENT_ESTIMATE 1001 |
NIFTI1 intent other
Definition at line 177 of file tpcnifti.h.
| #define NIFTI_INTENT_EXTVAL 21 |
NIFTI1 intent statistics
Definition at line 169 of file tpcnifti.h.
| #define NIFTI_INTENT_FTEST 4 |
NIFTI1 intent statistics
Definition at line 135 of file tpcnifti.h.
| #define NIFTI_INTENT_FTEST_NONC 12 |
NIFTI1 intent statistics
Definition at line 151 of file tpcnifti.h.
| #define NIFTI_INTENT_GAMMA 9 |
NIFTI1 intent statistics
Definition at line 145 of file tpcnifti.h.
| #define NIFTI_INTENT_GENMATRIX 1004 |
NIFTI1 intent other
Definition at line 183 of file tpcnifti.h.
| #define NIFTI_INTENT_INVGAUSS 20 |
NIFTI1 intent statistics
Definition at line 167 of file tpcnifti.h.
| #define NIFTI_INTENT_LABEL 1002 |
NIFTI1 intent other
Definition at line 179 of file tpcnifti.h.
| #define NIFTI_INTENT_LAPLACE 15 |
NIFTI1 intent statistics
Definition at line 157 of file tpcnifti.h.
| #define NIFTI_INTENT_LOG10PVAL 24 |
NIFTI1 intent statistics
Definition at line 175 of file tpcnifti.h.
| #define NIFTI_INTENT_LOGISTIC 14 |
NIFTI1 intent statistics
Definition at line 155 of file tpcnifti.h.
| #define NIFTI_INTENT_LOGPVAL 23 |
NIFTI1 intent statistics
Definition at line 173 of file tpcnifti.h.
| #define NIFTI_INTENT_NEURONAME 1003 |
NIFTI1 intent other
Definition at line 181 of file tpcnifti.h.
| #define NIFTI_INTENT_NONE 0 |
| #define NIFTI_INTENT_NORMAL 11 |
NIFTI1 intent statistics
Definition at line 149 of file tpcnifti.h.
| #define NIFTI_INTENT_POINTSET 1008 |
NIFTI1 intent other
Definition at line 191 of file tpcnifti.h.
| #define NIFTI_INTENT_POISSON 10 |
NIFTI1 intent statistics
Definition at line 147 of file tpcnifti.h.
| #define NIFTI_INTENT_PVAL 22 |
NIFTI1 intent statistics
Definition at line 171 of file tpcnifti.h.
| #define NIFTI_INTENT_QUATERNION 1010 |
NIFTI1 intent other
Definition at line 195 of file tpcnifti.h.
| #define NIFTI_INTENT_SYMMATRIX 1005 |
NIFTI1 intent other
Definition at line 185 of file tpcnifti.h.
| #define NIFTI_INTENT_TRIANGLE 1009 |
NIFTI1 intent other
Definition at line 193 of file tpcnifti.h.
| #define NIFTI_INTENT_TTEST 3 |
NIFTI1 intent statistics
Definition at line 133 of file tpcnifti.h.
| #define NIFTI_INTENT_TTEST_NONC 17 |
NIFTI1 intent statistics
Definition at line 161 of file tpcnifti.h.
| #define NIFTI_INTENT_UNIFORM 16 |
NIFTI1 intent statistics
Definition at line 159 of file tpcnifti.h.
| #define NIFTI_INTENT_VECTOR 1007 |
NIFTI1 intent other
Definition at line 189 of file tpcnifti.h.
| #define NIFTI_INTENT_WEIBULL 18 |
NIFTI1 intent statistics
Definition at line 163 of file tpcnifti.h.
| #define NIFTI_INTENT_ZSCORE 5 |
NIFTI1 intent statistics
Definition at line 137 of file tpcnifti.h.
| #define NIFTI_UNITS_HERTZ 32 |
NIFTI1 units: Hertz
Definition at line 58 of file tpcnifti.h.
| #define NIFTI_UNITS_METER 1 |
| #define NIFTI_UNITS_MICRON 4 |
NIFTI1 units: micrometer
Definition at line 50 of file tpcnifti.h.
Referenced by imgGetNiftiHeader().
| #define NIFTI_UNITS_MM 2 |
NIFTI1 units: millimetre
Definition at line 48 of file tpcnifti.h.
Referenced by imgGetNiftiHeader(), and imgSetNiftiHeader().
| #define NIFTI_UNITS_MSEC 16 |
NIFTI1 units: milliseconds
Definition at line 54 of file tpcnifti.h.
| #define NIFTI_UNITS_PPM 40 |
NIFTI1 units: parts per million
Definition at line 60 of file tpcnifti.h.
| #define NIFTI_UNITS_RADS 48 |
NIFTI1 units: radians per second
Definition at line 62 of file tpcnifti.h.
| #define NIFTI_UNITS_SEC 8 |
| #define NIFTI_UNITS_UNKNOWN 0 |
NIFTI1 units: unknown
Definition at line 44 of file tpcnifti.h.
| #define NIFTI_UNITS_USEC 24 |
NIFTI1 units: microseconds
Definition at line 56 of file tpcnifti.h.
| #define NIFTI_XFORM_ALIGNED_ANAT 2 |
NIFTI1 Coordinate System: Coordinates aligned to another file or "truth".
Definition at line 204 of file tpcnifti.h.
| #define NIFTI_XFORM_MNI_152 4 |
NIFTI1 Coordinate System: Coordinates aligned to the MNI 152 space.
Definition at line 208 of file tpcnifti.h.
| #define NIFTI_XFORM_SCANNER_ANAT 1 |
NIFTI1 Coordinate System: Scanner-based anatomical coordinates.
Definition at line 202 of file tpcnifti.h.
| #define NIFTI_XFORM_TALAIRACH 3 |
NIFTI1 Coordinate System: Coordinates aligned to the Talairach-Tournoux atlas.
Definition at line 206 of file tpcnifti.h.
| #define NIFTI_XFORM_UNKNOWN 0 |
NIFTI1 Coordinate System: Arbitrary coordinates.
Definition at line 200 of file tpcnifti.h.
|
extern |
Verify if specified file name is an Analyze 7.5 file.
| filename | File name, either header file, image file, or base name without extensions. |
| hdrfile | If file name refers to an Analyze file, then header file name will be written in this char pointer (space needs to allocated by caller); If header and image are combined, then this will be the name of combined file; enter NULL if not needed. |
| imgfile | If file name refers to an Analyze file, then image file name will be written in this char pointer (space needs to allocated by caller); If header and image are combined, then this will be the name of combined file; enter NULL if not needed. |
| siffile | If file name refers to an Analyze file, and if SIF exists, then SIF file name will be written in this char pointer (space needs to allocated by caller); enter NULL if not needed. |
| header | Pointer to Analyze header, which is filled in this function; enter NULL, if not needed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 16 of file analyzeio.c.
Referenced by imgRead().
|
extern |
Read Analyze header contents.
| filename | Name of file to read (including path and extension). |
| dsr | Pointer to previously allocated header structure. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout |
Definition at line 144 of file analyzeio.c.
Referenced by anaExists().
|
extern |
Remove any extensions from NIfTI file name, leaving only base file name. Possible path is kept.
| filename | Full name of file. |
Definition at line 14 of file niftiname.c.
Referenced by anaExists(), imgWriteNifti(), niftiCreateFNames(), and niftiExists().
|
extern |
Verify if specified file name is a NIfTI file.
| filename | File name, either header file, image file, or base name without extensions. |
| hdrfile | If file name refers to a NIfTI file, then header file name will be written in this char pointer (space needs to allocated by caller); If header and image are combined, then this will be the name of combined file; enter NULL if not needed. |
| imgfile | If file name refers to a NIfTI file, then image file name will be written in this char pointer (space needs to allocated by caller); If header and image are combined, then this will be the name of combined file; enter NULL if not needed. |
| siffile | If file name refers to a NIfTI file, and if SIF exists, then SIF file name will be written in this char pointer (space needs to allocated by caller); enter NULL if not needed. |
| header | Pointer to NIfTI header, which is filled in this function; enter NULL, if not needed. |
| status | Pointer to status data; enter NULL if not needed. |
Definition at line 17 of file niftiio.c.
Referenced by imgRead(), and imgReadNifti().
|
extern |
Read NIfTI-1 header contents, including 4-byte extender.
| filename | Name of file to read (including path and extension). |
| dsr | Pointer to previously allocated header structure. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 146 of file niftiio.c.
Referenced by niftiExists().
|
extern |
Write NIfTI-1 header contents, including 4-byte extender.
| filename | Name of file to read (including path and extension). |
| dsr | Pointer to header structure to write. |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 445 of file niftiio.c.
Referenced by imgWriteNifti().