My Project
Macros | Functions | Variables
micropet.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_MICROPET_LINE_LEN   1024
 

Functions

int upetHeaderReadParameter (FILE *fp, char *parameter, char *value)
 
int upetIsHeader (char *hdrfile)
 
int upetExists (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 imgMicropetToEcat7 (char *upetname, char *ecatfile, int verbose)
 
int imgMicropetPETToEcat7 (FILE *fph, FILE *fpi, char *ecatfile, int verbose)
 
int imgMicropetCTToEcat7 (FILE *fph, FILE *fpi, char *ecatfile, int verbose)
 
int imgGetMicropetMainHeader (FILE *fp, IMG *img, float *calibration_factor)
 
int imgGetMicropetFrameHeader (FILE *fp, IMG *img, int frame_index)
 
int imgGetMicropetSIF (FILE *fp, SIF *sif)
 

Variables

int MICROPET_TEST
 

Macro Definition Documentation

◆ MAX_MICROPET_LINE_LEN

#define MAX_MICROPET_LINE_LEN   1024

Definition at line 17 of file micropet.h.

Function Documentation

◆ imgGetMicropetFrameHeader()

int imgGetMicropetFrameHeader ( FILE *  fp,
IMG img,
int  frame_index 
)

Read frame information from MicroPET header into one-frame-IMG

Returns
Returns 0 when successful, otherwise >0.

Definition at line 652 of file micropet.c.

References IMG::decayCorrFactor, IMG::end, MAX_MICROPET_LINE_LEN, IMG::mid, IMG::start, upetHeaderReadParameter(), and IMG::weight.

Referenced by imgMicropetPETToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imgGetMicropetMainHeader()

int imgGetMicropetMainHeader ( FILE *  fp,
IMG img,
float *  calibration_factor 
)

Read main header information from MicroPET header into one-frame-IMG

Parameters
fpMicroPET header file pointer
imgPointer to allocated IMG struct
calibration_factorCalibration factor / Branching fraction

Definition at line 544 of file micropet.c.

References IMG::decayCorrected, IMGUNIT_BQ_PER_ML, IMGUNIT_NCI_PER_ML, IMGUNIT_UNKNOWN, IMG::isotopeHalflife, MAX_MICROPET_LINE_LEN, IMG::scanner, IMG::sizex, IMG::sizey, IMG::sizez, IMG::transaxialFOV, IMG::unit, upetHeaderReadParameter(), and IMG::zoom.

Referenced by imgMicropetCTToEcat7(), and imgMicropetPETToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imgGetMicropetSIF()

int imgGetMicropetSIF ( FILE *  fp,
SIF sif 
)

Read Scan Information from Concorde/MicroPET header file.

Returns
Returns 0 if successful.
Parameters
fpFile pointer to Concorde/MicroPET header file
sifPointer to initiated but non-allocated SIF struct; Studynr should be filled afterwards.

Definition at line 706 of file micropet.c.

References SIF::colNr, SIF::frameNr, SIF::isotope_name, MAX_MICROPET_LINE_LEN, SIF::prompts, SIF::randoms, SIF::scantime, sifSetmem(), SIF::trues, upetHeaderReadParameter(), upetScanStart(), SIF::version, SIF::x1, and SIF::x2.

Here is the call graph for this function:

◆ imgMicropetCTToEcat7()

int imgMicropetCTToEcat7 ( FILE *  fph,
FILE *  fpi,
char *  ecatfile,
int  verbose 
)

Read MicroPET CT image and write ECAT 7 image volume.

Returns
Returns errstatus, which is STATUS_OK (0) when call was successful, and >0 in case of an error.
Parameters
fphMicroPET header file pointer
fpiMicroPET image datafile pointer
ecatfileECAT image filename
verboseVerbose level

Definition at line 441 of file micropet.c.

References IMG::_fileFormat, IMG_E7, IMG_TYPE_IMAGE, imgAllocate(), imgEmpty(), imgGetMicropetMainHeader(), imgInit(), imgWrite(), IMG::m, MAX_MICROPET_LINE_LEN, MICROPET_TEST, IMG::scanStart, STATUS_CANNOTERASE, STATUS_CANNOTWRITE, STATUS_FAULT, STATUS_INVALIDHEADER, STATUS_NOMATRIX, STATUS_NOMEMORY, STATUS_OK, IMG::studyNr, IMG::type, upetGetImageDimensions(), upetHeaderReadParameter(), and upetScanStart().

Referenced by imgMicropetToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imgMicropetPETToEcat7()

int imgMicropetPETToEcat7 ( FILE *  fph,
FILE *  fpi,
char *  ecatfile,
int  verbose 
)

Read MicroPET static or dynamic PET image and write ECAT 7 image volume frame-by-frame.

Returns
Returns errstatus, which is STATUS_OK (0) when call was successful, and >0 in case of an error.
Parameters
fphMicroPET header file pointer
fpiMicroPET image datafile pointer
ecatfileECAT image filename
verboseVerbose level

Definition at line 332 of file micropet.c.

References IMG::_fileFormat, IMG_E7, IMG_TYPE_IMAGE, imgAllocate(), imgEmpty(), imgGetMicropetFrameHeader(), imgGetMicropetMainHeader(), imgInit(), imgWriteFrame(), IMG::m, MICROPET_TEST, IMG::scanStart, STATUS_CANNOTERASE, STATUS_FAULT, STATUS_INVALIDHEADER, STATUS_NOMATRIX, STATUS_NOMEMORY, STATUS_OK, IMG::studyNr, IMG::type, upetGetImageDimensions(), upetScanStart(), and IMG::weight.

Referenced by imgMicropetToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ imgMicropetToEcat7()

int imgMicropetToEcat7 ( char *  upetname,
char *  ecatfile,
int  verbose 
)

Read MicroPET image and write ECAT 7 image volume frame-by-frame

Returns
Returns errstatus, which is STATUS_OK (0) when call was successful, and >0 in case of an error.
Parameters
upetnameMicroPET image filename
ecatfileECAT image filename
verboseVerbose level

Definition at line 261 of file micropet.c.

References imgMicropetCTToEcat7(), imgMicropetPETToEcat7(), MAX_MICROPET_LINE_LEN, MICROPET_TEST, STATUS_FAULT, STATUS_NOFILE, STATUS_NOHEADERFILE, STATUS_NOIMGDATA, STATUS_UNSUPPORTED, upetExists(), and upetHeaderReadParameter().

Here is the call graph for this function:

◆ upetExists()

int upetExists ( char *  upetname,
char *  hdrfile,
char *  imgfile 
)

Check if specified image filename is a Concorde/microPET file

Returns
Returns 0 if it is not, 1 if it is, and both image and header is found.
Parameters
upetnameFilename, either header file, image file, or base name without extensions. If file is found, then
hdrfileIf 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.
imgfileIf 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 126 of file micropet.c.

References upetIsHeader().

Referenced by imgMicropetToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upetGetImageDimensions()

int upetGetImageDimensions ( FILE *  fp,
int *  z,
int *  x,
int *  y,
int *  f 
)

Read image dimensions from header

Parameters
fpFile pointer to MicroPET image header
zPointers to dimensions: planes
xPointers to dimensions: columns
yPointers to dimensions: rows
fPointers to dimensions: frames; if not existent (CT), enter NULL

Definition at line 180 of file micropet.c.

References MAX_MICROPET_LINE_LEN, and upetHeaderReadParameter().

Referenced by imgMicropetCTToEcat7(), and imgMicropetPETToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upetHeaderReadParameter()

int upetHeaderReadParameter ( FILE *  fp,
char *  parameter,
char *  value 
)

Read specified parameter value from Concorde/MicroPET header.

Returns
Returns 0 if parameter was found, even if value is empty, and 1, if parameter was not found, and <0 in case of other errors
Parameters
fpFile 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
parameterPointer to string which contains the header parameter name
valuePointer 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 58 of file micropet.c.

References MAX_MICROPET_LINE_LEN, and MICROPET_TEST.

Referenced by imgGetMicropetFrameHeader(), imgGetMicropetMainHeader(), imgGetMicropetSIF(), imgMicropetCTToEcat7(), imgMicropetToEcat7(), upetGetImageDimensions(), upetIsHeader(), and upetScanStart().

Here is the caller graph for this function:

◆ upetIsHeader()

int upetIsHeader ( char *  hdrfile)

Verify that given file is a valid Concorde/microPET file header file.

Returns
Returns 0 if not, and 1 if it is a valid header file.
Parameters
hdrfileConcorde/microPET file header filename, with correct extension

Definition at line 97 of file micropet.c.

References MAX_MICROPET_LINE_LEN, and upetHeaderReadParameter().

Referenced by upetExists().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upetScanStart()

int upetScanStart ( FILE *  fp,
time_t *  scant 
)

Read scan start time from Concorde/MicroPET header.

Returns
Returns 0 when successful.
Parameters
fpFile pointer to Concorde/MicroPET header
scantPointer to time_t where time and date will be saved

Definition at line 218 of file micropet.c.

References MAX_MICROPET_LINE_LEN, and upetHeaderReadParameter().

Referenced by imgGetMicropetSIF(), imgMicropetCTToEcat7(), and imgMicropetPETToEcat7().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MICROPET_TEST

int MICROPET_TEST