#include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>#include <time.h>#include <unistd.h>#include "libtpcmisc.h"#include "include/imgio.h"Go to the source code of this file.
Functions | |
| int | upetHeaderReadParameter (FILE *fp, char *parameter, char *value) |
| int | upetIsHeader (char *hdrfile) |
| int | upetExists (const char *upetname, char *hdrfile, char *imgfile) |
| int | upetGetImageDimensions (FILE *fp, int *z, int *x, int *y, int *f) |
| int | upetScanStart (FILE *fp, time_t *scant) |
| int | upetReadImagedata (FILE *fp, IFT *ift, int frame, float *data) |
| int upetExists | ( | const char * | upetname, |
| char * | hdrfile, | ||
| char * | imgfile | ||
| ) |
Check if specified image filename is a Concorde/microPET file
| upetname | Filename, either header file, image file, or base name without extensions. If file is found, then |
| hdrfile | If upetname is a Concorde/microPET file, then header filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
| imgfile | If upetname is a Concorde/microPET file, then image filename will be written in this char pointer (space needs to allocated by caller); NULL if not needed. |
Definition at line 138 of file micropet.c.
References MICROPET_TEST, and upetIsHeader().
Referenced by imgFormatDetermine(), imgMicropetToEcat7(), imgRead(), imgReadHeader(), imgReadMicropetFrame(), and imgReadMicropetHeader().
| int upetGetImageDimensions | ( | FILE * | fp, |
| int * | z, | ||
| int * | x, | ||
| int * | y, | ||
| int * | f | ||
| ) |
Read image dimensions from header
| fp | File pointer to MicroPET image header |
| z | Pointers to dimensions: planes |
| x | Pointers to dimensions: columns |
| y | Pointers to dimensions: rows |
| f | Pointers to dimensions: frames; if not existent (CT), enter NULL |
Definition at line 204 of file micropet.c.
References MAX_MICROPET_LINE_LEN, and upetHeaderReadParameter().
Referenced by imgMicropetCTToEcat7(), and imgMicropetPETToEcat7().
| int upetHeaderReadParameter | ( | FILE * | fp, |
| char * | parameter, | ||
| char * | value | ||
| ) |
Read specified parameter value from Concorde/MicroPET header.
| fp | File pointer to Concorde/MicroPET header; parameter is read starting from file pointer forward, therefore rewind file pointer before calling this routine if you want to search parameter from beginning |
| parameter | Pointer to string which contains the header parameter name |
| value | Pointer to allocated string where parameter value will be written; memory for at least MAX_MICROPET_LINE_LEN chars must be allocated; NULL if not needed. |
Definition at line 69 of file micropet.c.
References MAX_MICROPET_LINE_LEN, and MICROPET_TEST.
Referenced by imgGetMicropetFrameHeader(), imgGetMicropetMainHeader(), imgGetMicropetSIF(), imgMicropetCTToEcat7(), imgMicropetToEcat7(), upetGetImageDimensions(), upetIsHeader(), and upetScanStart().
| int upetIsHeader | ( | char * | hdrfile | ) |
Verify that given file is a valid Concorde/microPET file header file.
| hdrfile | Concorde/microPET file header filename, with correct extension |
Definition at line 108 of file micropet.c.
References MAX_MICROPET_LINE_LEN, MICROPET_TEST, and upetHeaderReadParameter().
Referenced by upetExists().
| int upetReadImagedata | ( | FILE * | fp, |
| IFT * | ift, | ||
| int | frame, | ||
| float * | data | ||
| ) |
Reads microPET image data, scaling values to floats if necessary. Reads only one frame at a time!
| fp | file opened previously in binary mode |
| ift | microPET header in IFT struct |
| frame | frame number to read [1..number of frames] |
| data | pointer to image float data allocated previously |
Definition at line 285 of file micropet.c.
References MAX_MICROPET_LINE_LEN, and MICROPET_TEST.
Referenced by imgReadMicropetFrame().
| int upetScanStart | ( | FILE * | fp, |
| time_t * | scant | ||
| ) |
Read scan start time from Concorde/MicroPET header.
| fp | File pointer to Concorde/MicroPET header |
| scant | Pointer to time_t where time and date will be saved |
Definition at line 242 of file micropet.c.
References MAX_MICROPET_LINE_LEN, and upetHeaderReadParameter().
Referenced by imgGetMicropetSIF(), imgMicropetCTToEcat7(), and imgMicropetPETToEcat7().
1.8.0