Functions | Variables
imgunit.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <strings.h>
#include <ctype.h>
#include <float.h>
#include "img.h"
#include "substitutions.h"
#include "include/imgunit.h"
Include dependency graph for imgunit.c:

Go to the source code of this file.

Functions

int imgUnitId (char *unit)
void imgUnitFromEcat (IMG *img, int ecat_unit)
void imgUnitFromEcat7 (IMG *img, ECAT7_mainheader *h)
int imgUnitToEcat6 (IMG *img)
void imgUnitToEcat7 (IMG *img, ECAT7_mainheader *h)
char * imgUnit (int dunit)
int imgSetUnit (IMG *img, char *unit)

Variables

static char * img_unit_string []

Function Documentation

int imgSetUnit ( IMG img,
char *  unit 
)

Sets the unit in IMG based on specified unit string.

Returns:
Returns 0 if successful.

Definition at line 377 of file imgunit.c.

References imgUnitId(), and IMG::unit.

Here is the call graph for this function:

char* imgUnit ( int  dunit)

Return pointer to string describing the calibrated image data unit

Parameters:
dunitindex of img_unit_string[]
Returns:
pointer to string

Definition at line 365 of file imgunit.c.

References img_unit_string, and IMGUNIT_UNKNOWN.

Referenced by imgInfo().

void imgUnitFromEcat ( IMG img,
int  ecat_unit 
)
void imgUnitFromEcat7 ( IMG img,
ECAT7_mainheader h 
)

Set IMG calibration unit based on ECAT7 main header

Parameters:
imgpointer to IMG data where unit will be set
hpointer to source ECAT7 main header

Definition at line 210 of file imgunit.c.

References ecat7_mainheader::calibration_units, ecat7_mainheader::calibration_units_label, ecat7_mainheader::data_units, IMGUNIT_BQ_PER_ML, IMGUNIT_UNKNOWN, imgUnitId(), and IMG::unit.

Referenced by imgGetEcat7MHeader().

Here is the call graph for this function:

int imgUnitId ( char *  unit)
int imgUnitToEcat6 ( IMG img)
void imgUnitToEcat7 ( IMG img,
ECAT7_mainheader h 
)

Variable Documentation

char* img_unit_string[] [static]
Initial value:
 {
    "unknown",
    "cnts/sec",
    "counts",
    "kBq/mL",
    "sec*kBq/mL",
    "1/sec",
    "1/min",
    "mL/mL",
    "mL/dL",
    "mL/(mL*min)",
    "mL/(dL*min)",
    "unitless",
    "nCi/mL",
    "MBq/mL",
    "Bq/cc",
    "uCi/cc",
    "umol/(100g*min)",
    "mg/(100g*min)",
            0
}

Valid IMG units.

Definition at line 61 of file imgunit.c.

Referenced by imgUnit().