Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

img.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include "include/halflife.h"
#include "include/studynr.h"
#include "include/img.h"

Functions

void imgInit (IMG *image)
void imgEmpty (IMG *image)
int imgAllocate (IMG *image, int planes, int rows, int columns, int frames)
char * imgUnit (int dunit)
char * imgIsotope (IMG *img)
void imgInfo (IMG *image)
int imgDecayCorrection (IMG *image, int mode)
int imgCopyhdr (IMG *image1, IMG *image2)
int imgExtractRange (IMG *img1, IMG_RANGE r, IMG *img2)

Variables

char * _imgStatusMessage []

Function Documentation

int imgAllocate IMG image,
int  planes,
int  rows,
int  columns,
int  frames
 

Allocates memory for img data. Old contents are not saved.

Returns:
Returns 0 if ok.

int imgCopyhdr IMG image1,
IMG image2
 

Copies the header fields from one image struct to another. Does not copy memory addresses or sizes. Frame times and plane numbers are copied, if possible.

Returns:
Returns 0 if ok.
Parameters:
image1  Pointer to input IMG data
image2  Pointer to output IMG data

int imgDecayCorrection IMG image,
int  mode
 

Corrects (mode=1) or removes correction (mode=0) for physical decay. Removal is based on existing decay correction factors, if possible.

Returns:
Returns 0, if ok.
Parameters:
image  Pointer to IMG data
mode  0=Remove decay correction; 1=Correct for decay

void imgEmpty IMG image  ) 
 

Free memory that is allocated for IMG.

int imgExtractRange IMG img1,
IMG_RANGE  r,
IMG img2
 

Extract a smaller 4D image from inside an IMG. Any existing data is overwritten.

Returns:
Returns 0 if ok.

void imgInfo IMG image  ) 
 

Prints img information to stdout; mainly for testing purposes.

void imgInit IMG image  ) 
 

Call this once before any use of IMG data.

char* imgIsotope IMG img  ) 
 

Returns pointer to string describing the isotope in image data

char* imgUnit int  dunit  ) 
 

Returns pointer to string describing the calibrated image data unit

Parameters:
dunit  0="unknown", 1="cnts/sec", 2="counts", 3="kBq/mL", 4="sec*kBq/mL", 5="1/sec", 6="1/min", 7="mL/mL", 8="mL/dL", 9="mL/(mL*min)", 10="mL/(dL*min)", 11="unitless", 12="nCi/mL", 13="MBq/mL", 14="Bq/cc", 15="uCi/cc"


Variable Documentation

char* _imgStatusMessage[]
 

Initial value:

 {
   "ok",
   "fault in calling routine",
   "out of memory"
}
Status (error) messages from image processing


Generated on Fri Jan 21 16:17:41 2005 for libPET by  doxygen 1.4.1