Data Structures | Macros | Typedefs | Functions | Variables
ecat63.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MatDir
 
struct  MATRIXLIST
 
struct  Matval
 
struct  ecat63_mainheader
 
struct  ecat63_imageheader
 
struct  ecat63_scanheader
 
struct  ecat63_normheader
 
struct  ecat63_attnheader
 
struct  matdirnode
 
struct  matdirlist
 
struct  matrixdata
 
struct  matrix_file
 

Macros

#define MatBLKSIZE   512
 
#define MatFirstDirBlk   2
 
#define BYTE_TYPE   1
 
#define VAX_I2   2
 
#define VAX_I4   3
 
#define VAX_R4   4
 
#define IEEE_R4   5
 
#define SUN_I2   6
 
#define SUN_I4   7
 
#define RAW_DATA   1
 
#define IMAGE_DATA   2
 
#define ATTN_DATA   3
 
#define NORM_DATA   4
 
#define ECAT63_SYSTEM_TYPE_DEFAULT   931
 
#define BACKUP_EXTENSION   ".bak"
 

Typedefs

typedef struct ecat63_mainheader ECAT63_mainheader
 
typedef struct ecat63_imageheader ECAT63_imageheader
 
typedef struct ecat63_scanheader ECAT63_scanheader
 
typedef struct ecat63_normheader ECAT63_normheader
 
typedef struct ecat63_attnheader ECAT63_attnheader
 
typedef struct matdirnode MatDirNode
 
typedef struct matdirlist MatDirList
 
typedef struct matrixdata MatrixData
 
typedef struct matrix_file Matrix_file
 

Functions

int ecat63ReadMainheader (FILE *fp, ECAT63_mainheader *h)
 
int ecat63ReadImageheader (FILE *fp, int blk, ECAT63_imageheader *h)
 
int ecat63ReadScanheader (FILE *fp, int blk, ECAT63_scanheader *h)
 
int ecat63ReadAttnheader (FILE *fp, int blk, ECAT63_attnheader *h)
 
int ecat63ReadNormheader (FILE *fp, int blk, ECAT63_normheader *h)
 
int ecat63ReadMatdata (FILE *fp, int strtblk, int blkNr, char *data, int dtype)
 
int ecat63ReadImageMatrix (FILE *fp, int strtblk, int lastblk, ECAT63_imageheader *h, float **f)
 
int ecat63ReadScanMatrix (FILE *fp, int strtblk, int lastblk, ECAT63_scanheader *h, float **f)
 
float ecat63rFloat (void *bufi, int isvax, int islittle)
 
int ecat63rInt (void *bufi, int isvax, int islittle)
 
int ecat63pxlbytes (short int data_type)
 
void ecat63InitMatlist (MATRIXLIST *mlist)
 
void ecat63EmptyMatlist (MATRIXLIST *mlist)
 
int ecat63ReadMatlist (FILE *fp, MATRIXLIST *ml)
 
void ecat63PrintMatlist (MATRIXLIST *ml)
 
int mat_numcod (int frame, int plane, int gate, int data, int bed)
 
void mat_numdoc (int matnum, Matval *matval)
 
int ecat63Matenter (FILE *fp, int matnum, int blkNr)
 
void ecat63SortMatlistByPlane (MATRIXLIST *ml)
 
void ecat63SortMatlistByFrame (MATRIXLIST *ml)
 
int ecat63CheckMatlist (MATRIXLIST *ml)
 
int ecat63DeleteLateFrames (MATRIXLIST *ml, int frame_nr)
 
int ecat63GetMatrixBlockSize (MATRIXLIST *mlist, int *blk_nr)
 
int ecat63GetPlaneAndFrameNr (MATRIXLIST *mlist, ECAT63_mainheader *h, int *plane_nr, int *frame_nr)
 
int ecat63GetNums (MATRIXLIST *ml, short int *num_planes, short int *num_frames, short int *num_gates, short int *num_bed_pos)
 
int ecat63GatherMatlist (MATRIXLIST *ml, short int do_planes, short int do_frames, short int do_gates, short int do_beds)
 
int ecat63WriteMainheader (FILE *fp, ECAT63_mainheader *h)
 
int ecat63WriteImageheader (FILE *fp, int block, ECAT63_imageheader *h)
 
int ecat63WriteScanheader (FILE *fp, int block, ECAT63_scanheader *h)
 
int ecat63WriteAttnheader (FILE *fp, int block, ECAT63_attnheader *h)
 
int ecat63WriteNormheader (FILE *fp, int block, ECAT63_normheader *h)
 
FILE * ecat63Create (const char *fname, ECAT63_mainheader *h)
 
int ecat63WriteMatdata (FILE *fp, int strtblk, char *data, int pxlNr, int pxlSize)
 
int ecat63WriteScan (FILE *fp, int matnum, ECAT63_scanheader *h, void *data)
 
int ecat63WriteImage (FILE *fp, int matnum, ECAT63_imageheader *h, void *data)
 
int ecat63WriteNorm (FILE *fp, int matnum, ECAT63_normheader *h, void *data)
 
int ecat63WriteAttn (FILE *fp, int matnum, ECAT63_attnheader *h, void *data)
 
int ecat63WriteImageMatrix (FILE *fp, int matnum, ECAT63_imageheader *h, float *fdata)
 
int ecat63WriteScanMatrix (FILE *fp, int matnum, ECAT63_scanheader *h, float *fdata)
 
void ecat63wFloat (float *bufi, void *bufo, int tovax, int islittle)
 
void ecat63wInt (int *bufi, void *bufo, int tovax, int islittle)
 
int ecat63_is_scaling_needed (float amax, float *data, int nr)
 
void ecat63PrintMainheader (ECAT63_mainheader *h, FILE *fp)
 
void ecat63PrintImageheader (ECAT63_imageheader *h, FILE *fp)
 
void ecat63PrintScanheader (ECAT63_scanheader *h, FILE *fp)
 
void ecat63PrintAttnheader (ECAT63_attnheader *h, FILE *fp)
 
void ecat63PrintNormheader (ECAT63_normheader *h, FILE *fp)
 
int ecat6PrintSubheader (ECAT63_mainheader mh, FILE *fp, int plane, int frame, FILE *ofp)
 
char * ecat63Datatype (short int dtype)
 
char * ecat63Unit (short int dunit)
 
void float2parts (float *buf)
 

Variables

char ecat63errmsg [128]
 
int ECAT63_TEST
 

Macro Definition Documentation

#define ATTN_DATA   3
#define BACKUP_EXTENSION   ".bak"

Definition at line 47 of file ecat63.h.

#define BYTE_TYPE   1
#define ECAT63_SYSTEM_TYPE_DEFAULT   931

Definition at line 43 of file ecat63.h.

Referenced by ecat63AddImg(), ecat63WriteAllImg(), and imgSetEcat63MHeader().

#define IEEE_R4   5
#define IMAGE_DATA   2
#define MatBLKSIZE   512
#define MatFirstDirBlk   2
#define NORM_DATA   4
#define RAW_DATA   1
#define SUN_I2   6
#define SUN_I4   7
#define VAX_I2   2
#define VAX_I4   3
#define VAX_R4   4

Typedef Documentation

typedef struct matdirlist MatDirList
typedef struct matdirnode MatDirNode
typedef struct matrix_file Matrix_file
typedef struct matrixdata MatrixData

Function Documentation

int ecat63_is_scaling_needed ( float  amax,
float *  data,
int  nr 
)

Check if pixel float values need to be scaled to be saved as short ints, or if they are already all very close to integers.

Parameters
amaxabsolute maximum value
datafloat array
nrnumber of float values in flaot array
Returns
1 if scaling is necessary, and 0 if not.

Definition at line 672 of file ecat63w.c.

Referenced by ecat63WriteImageMatrix(), and ecat63WriteScanMatrix().

int ecat63CheckMatlist ( MATRIXLIST ml)

Checks that all matrixlist entries have read/write status.

Parameters
mlmatrix list
Returns
0 if ok, or 1 if an entry is marked as deleted or unfinished.

Definition at line 342 of file ecat63ml.c.

References MATRIXLIST::matdir, MATRIXLIST::matrixNr, and MatDir::matstat.

FILE* ecat63Create ( const char *  fname,
ECAT63_mainheader h 
)

Create a new ECAT 6.3 file and return file pointer or NULL in case of an error. If file exists, it is renamed as fname% if possible. Directory list is written in big endian byte order.

Parameters
fnamefile name
hEcat 6.3 main header
Returns
opened file pointer, or NULL in case of failure

Definition at line 386 of file ecat63w.c.

References BACKUP_EXTENSION, ECAT63_TEST, ecat63WriteMainheader(), MatBLKSIZE, and MatFirstDirBlk.

Referenced by ecat63AddImg(), ecat63WriteAllImg(), and imgWriteEcat63Frame().

Here is the call graph for this function:

char* ecat63Datatype ( short int  dtype)

Return pointer to string describing the ECAT 6.3 data_type

Parameters
dtypedata type code
Returns
pointer to static string

Definition at line 227 of file ecat63p.c.

Referenced by ecat63PrintAttnheader(), ecat63PrintImageheader(), ecat63PrintMainheader(), ecat63PrintNormheader(), and ecat63PrintScanheader().

int ecat63DeleteLateFrames ( MATRIXLIST ml,
int  frame_nr 
)

Mark deleted the frames after the specified frame number. This can be used to delete sum images from the end of dynamic ECAT images.

Parameters
mlmatrix list
frame_nrlast index not to be marked as deleted
Returns
number of deleted matrices.

Definition at line 360 of file ecat63ml.c.

References Matval::frame, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, and MatDir::matstat.

Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), and imgReadEcat63Header().

Here is the call graph for this function:

void ecat63EmptyMatlist ( MATRIXLIST mlist)

Free memory allocated for ECAT matrix list

Parameters
mlistmatrix list

Definition at line 80 of file ecat63ml.c.

References MATRIXLIST::matdir, MATRIXLIST::matrixNr, and MATRIXLIST::matrixSpace.

Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadMatlist(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

int ecat63GatherMatlist ( MATRIXLIST ml,
short int  do_planes,
short int  do_frames,
short int  do_gates,
short int  do_beds 
)

Matrix numbers in ECAT 6.3 matrix list are edited, when necessary, so that plane, frame, gate and/or bed numbers are continuous, starting from one (planes, frames and gates) or from zero (beds). List order is not changed.

Parameters
mlECAT 6.3 matrix list, where the matrix numbers will be edited
do_planesPlane numbers are gathered together (1) or not (0)
do_framesFrame numbers are gathered together (1) or not (0)
do_gatesGate numbers are gathered together (1) or not (0)
do_bedsBed numbers are gathered together (1) or not (0)
Returns
0 if successful, 1 if invalid input, 3 failed to allocate memory

Definition at line 519 of file ecat63ml.c.

References Matval::bed, Matval::frame, Matval::gate, mat_numcod(), mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, and Matval::plane.

Referenced by imgReadEcat63Frame(), and imgReadEcat63Header().

Here is the call graph for this function:

int ecat63GetMatrixBlockSize ( MATRIXLIST mlist,
int *  blk_nr 
)

Calculate the size of one data matrix in ECAT 6.3 file matrix list, and check that the size is same in all matrices.

Parameters
mlistEcat 6.3 matrix list; note that this list is here sorted by planes
blk_nrNumber of blocks will be put here; NULL if not needed
Returns
errstatus, which is STATUS_OK (0) when call was successful, and >0 in case of an error.

Definition at line 382 of file ecat63ml.c.

References MatDir::endblk, MATRIXLIST::matdir, MATRIXLIST::matrixNr, STATUS_FAULT, STATUS_OK, STATUS_VARMATSIZE, and MatDir::strtblk.

Referenced by imgReadEcat63Frame(), and imgReadEcat63Header().

int ecat63GetNums ( MATRIXLIST ml,
short int *  num_planes,
short int *  num_frames,
short int *  num_gates,
short int *  num_bed_pos 
)

Read the maximum plane, frame, gate and bed number from matrixlist.

Parameters
mlPointer to matrixlist
num_planesnumber of planes will be put here; NULL if not needed
num_framesnumber of frames will be put here; NULL if not needed
num_gatesnumber of gates will be put here; NULL if not needed
num_bed_posnumber of gates will be put here; NULL if not needed
Returns
0 if successful, 1 no matrix list, 2 invalid matrix number, 3 failed to allocate memory

Definition at line 462 of file ecat63ml.c.

References Matval::bed, Matval::frame, Matval::gate, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, and Matval::plane.

Here is the call graph for this function:

int ecat63GetPlaneAndFrameNr ( MATRIXLIST mlist,
ECAT63_mainheader h,
int *  plane_nr,
int *  frame_nr 
)

Calculate the number of planes and frames/gates from ECAT 6.3 matrix list. Check that all planes have equal nr of frames/gates, that frames/gates are sequentally numbered. This routines sorts the matrix list by planes.

Parameters
mlistEcat 6.3 matrix list; note that this list is here sorted by planes
hEcat 6.3 mainheader
plane_nrNumber of planes will be put here; NULL if not needed
frame_nrNumber of frames/gates will be put here; NULL if not needed
Returns
errstatus, which is STATUS_OK (0) when call was successful, and >0 in case of an error.

Definition at line 414 of file ecat63ml.c.

References ecat63SortMatlistByPlane(), Matval::frame, Matval::gate, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, MatDir::matstat, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, Matval::plane, STATUS_FAULT, STATUS_MISSINGMATRIX, and STATUS_OK.

Referenced by imgReadEcat63Header().

Here is the call graph for this function:

void ecat63InitMatlist ( MATRIXLIST mlist)

Initiate ECAT matrix list. Call this once before first use.

Parameters
mlistmatrix list

Definition at line 69 of file ecat63ml.c.

References MATRIXLIST::matdir, MATRIXLIST::matrixNr, and MATRIXLIST::matrixSpace.

Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

int ecat63Matenter ( FILE *  fp,
int  matnum,
int  blkNr 
)

Prepare matrix list for additional matrix data and Directory records are written in big endian byte order. Set block_nr to the number of data blocks excluding header;

Parameters
fpfile pointer
matnummatrix number [1..number of matrixes]
blkNrmatrix block number [ >= 1]
Returns
block number for matrix header, or 0 in case of an error.

Definition at line 186 of file ecat63ml.c.

References ECAT63_TEST, MatBLKSIZE, and MatFirstDirBlk.

Referenced by ecat63WriteAttn(), ecat63WriteImage(), ecat63WriteImageMatrix(), ecat63WriteNorm(), ecat63WriteScan(), and ecat63WriteScanMatrix().

void ecat63PrintAttnheader ( ECAT63_attnheader h,
FILE *  fp 
)
void ecat63PrintImageheader ( ECAT63_imageheader h,
FILE *  fp 
)
void ecat63PrintMainheader ( ECAT63_mainheader h,
FILE *  fp 
)

Print ECAT 6.3 mainheader contents to specified file pointer.

Parameters
hEcat 6.3 main header
fpfile pointer

Definition at line 62 of file ecat63p.c.

References ecat63_mainheader::axial_fov, ecat63_mainheader::bed_elevation, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::data_type, ECAT63_TEST, ecat63Datatype(), ecat63Unit(), ecat63_mainheader::file_type, ecat63_mainheader::gantry_rotation, ecat63_mainheader::gantry_tilt, ecat63_mainheader::init_bed_position, ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, ecat63_mainheader::num_bed_pos, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::operator_name, ecat63_mainheader::original_file_name, ecat63_mainheader::patient_age, ecat63_mainheader::patient_dexterity, ecat63_mainheader::patient_height, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, ecat63_mainheader::patient_sex, ecat63_mainheader::patient_weight, ecat63_mainheader::physician_name, ecat63_mainheader::plane_separation, ecat63_mainheader::radiopharmaceutical, ecat63_mainheader::scan_start_day, ecat63_mainheader::scan_start_hour, ecat63_mainheader::scan_start_minute, ecat63_mainheader::scan_start_month, ecat63_mainheader::scan_start_second, ecat63_mainheader::scan_start_year, ecat63_mainheader::study_description, ecat63_mainheader::study_name, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, and ecat63_mainheader::user_process_code.

Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63WriteAllImg(), and imgWriteEcat63Frame().

Here is the call graph for this function:

void ecat63PrintMatlist ( MATRIXLIST ml)

Print ECAT matrix list on stdout.

Parameters
mlmatrix list

Definition at line 160 of file ecat63ml.c.

References Matval::bed, MatDir::endblk, Matval::frame, Matval::gate, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, Matval::plane, and MatDir::strtblk.

Referenced by ecat63ReadAllToImg(), and ecat6PrintSubheader().

Here is the call graph for this function:

void ecat63PrintNormheader ( ECAT63_normheader h,
FILE *  fp 
)

Print ECAT 6.3 normheader contents to specified file pointer.

Parameters
hEcat 6.3 normalization header
fptarget file pointer

Definition at line 208 of file ecat63p.c.

References ecat63_normheader::data_type, ecat63_normheader::dimension_1, ecat63_normheader::dimension_2, ECAT63_TEST, ecat63Datatype(), ecat63_normheader::norm_day, ecat63_normheader::norm_hour, ecat63_normheader::norm_minute, ecat63_normheader::norm_month, ecat63_normheader::norm_second, ecat63_normheader::norm_year, and ecat63_normheader::scale_factor.

Referenced by ecat6PrintSubheader().

Here is the call graph for this function:

void ecat63PrintScanheader ( ECAT63_scanheader h,
FILE *  fp 
)
int ecat63pxlbytes ( short int  data_type)

Returns the nr of bytes required for storage of one pixel of specified data_type

Parameters
data_typedata type code
Returns
number of bytes

Definition at line 711 of file ecat63r.c.

References BYTE_TYPE, IEEE_R4, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Referenced by ecat63WriteImageMatrix(), and ecat63WriteScanMatrix().

int ecat63ReadAttnheader ( FILE *  fp,
int  blk,
ECAT63_attnheader h 
)

Read ECAT 6.3 attenuation header

Parameters
fpfile pointer
blkblock number [2..number of blocks]
hEcat 6.3 attenuation header
Returns
0 if ok, 1 failed to find block, 3 failed to read block, 4 invalid data type, 5 invalid scale factor

Definition at line 238 of file ecat63r.c.

References ecat63_attnheader::attenuation_coeff, ecat63_attnheader::attenuation_type, BYTE_TYPE, ecat63_attnheader::data_type, ecat63_attnheader::dimension_1, ecat63_attnheader::dimension_2, ECAT63_TEST, ecat63rFloat(), MatBLKSIZE, ecat63_attnheader::sample_distance, ecat63_attnheader::scale_factor, SUN_I4, ecat63_attnheader::tilt_angle, ecat63_attnheader::x_origin, ecat63_attnheader::x_radius, ecat63_attnheader::y_origin, and ecat63_attnheader::y_radius.

Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

Here is the call graph for this function:

int ecat63ReadImageheader ( FILE *  fp,
int  blk,
ECAT63_imageheader h 
)

Read ECAT 6.3 image header

Parameters
fpfile pointer
blkblock number [2..number of blocks]
hEcat 6.3 image header
Returns
0 if ok, 1 invalid input, 2 failed to find block, 3 failed to read block, 4 invalid data type, 5 invalid calibration factor, 6 invalid frame duration

Definition at line 152 of file ecat63r.c.

References ecat63_imageheader::annotation, ecat63_imageheader::atten_cor_mat_num, BYTE_TYPE, ecat63_imageheader::data_type, ecat63_imageheader::decay_corr_fctr, ecat63_imageheader::dimension_1, ecat63_imageheader::dimension_2, ECAT63_TEST, ecat63rFloat(), ecat63rInt(), ecat63_imageheader::ecat_calibration_fctr, ecat63_imageheader::fill1, ecat63_imageheader::fill2, ecat63_imageheader::filter_code, ecat63_imageheader::filter_params, ecat63_imageheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_imageheader::image_max, ecat63_imageheader::image_min, ecat63_imageheader::image_rotation, ecat63_imageheader::intrinsic_tilt, ecat63_imageheader::loss_corr_fctr, MatBLKSIZE, ecat63_imageheader::norm_matrix_num, ecat63_imageheader::num_dimensions, ecat63_imageheader::pixel_size, ecat63_imageheader::plane_eff_corr_fctr, ecat63_imageheader::processing_code, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_imageheader::recon_duration, ecat63_imageheader::recon_scale, ecat63_imageheader::recon_start_day, ecat63_imageheader::recon_start_hour, ecat63_imageheader::recon_start_min, ecat63_imageheader::recon_start_month, ecat63_imageheader::recon_start_sec, ecat63_imageheader::recon_start_year, ecat63_imageheader::scan_matrix_num, ecat63_imageheader::slice_location, ecat63_imageheader::slice_width, SUN_I4, ecat63_imageheader::well_counter_cal_fctr, ecat63_imageheader::x_origin, and ecat63_imageheader::y_origin.

Referenced by ecat63ReadAllToImg(), ecat63ReadImageMatrix(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

Here is the call graph for this function:

int ecat63ReadImageMatrix ( FILE *  fp,
int  first_block,
int  last_block,
ECAT63_imageheader h,
float **  fdata 
)

Read ECAT63 image matrix header and data. If only header is to be read, set last_block=first_block. Note: data is not calibrated with factor in main header.

Parameters
fpECAT file pointer
first_blockSubheader record number
last_blockLast data block number
hPtr to subheader data which is filled
fdataPtr to the address of the matrix data
Returns
0 if ok, 1 invalid input, 5 failed to read sub header, 6 invalid (x,y,z) dimesions, 8 failed to allocate memory for meta-data, 9 failed to read matrix data, 11 failed to allocate memory for image data

Definition at line 494 of file ecat63r.c.

References BYTE_TYPE, ecat63_imageheader::data_type, ecat63_imageheader::dimension_1, ecat63_imageheader::dimension_2, ECAT63_TEST, ecat63errmsg, ecat63PrintImageheader(), ecat63ReadImageheader(), ecat63ReadMatdata(), ecat63_imageheader::ecat_calibration_fctr, IEEE_R4, MatBLKSIZE, MatFirstDirBlk, ecat63_imageheader::quant_scale, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Here is the call graph for this function:

int ecat63ReadMainheader ( FILE *  fp,
ECAT63_mainheader h 
)

Read ECAT 6.3 main header

Parameters
fpfile pointer
htarget Ecat 6.3 main header struture
Returns
0 if ok, 1 invalid input, 2 failed to find subheader block, 3 invalid magic number (should be "ECAT63") at start of file, 5 invalid data type, 6 invalid calibration factor, 7 invalid file type

Definition at line 50 of file ecat63r.c.

References ecat63_mainheader::acquisition_type, ATTN_DATA, ecat63_mainheader::axial_fov, ecat63_mainheader::axial_samp_mode, ecat63_mainheader::bed_elevation, ecat63_mainheader::bed_offset, ecat63_mainheader::bed_type, BYTE_TYPE, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::coin_samp_mode, ecat63_mainheader::collimator, ecat63_mainheader::compression_code, ecat63_mainheader::data_type, ECAT63_TEST, ecat63rFloat(), ecat63_mainheader::ecat_format, ecat63_mainheader::facility_name, ecat63_mainheader::file_type, ecat63_mainheader::fill1, ecat63_mainheader::fill2, ecat63_mainheader::gantry_rotation, ecat63_mainheader::gantry_tilt, IMAGE_DATA, ecat63_mainheader::init_bed_position, ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, ecat63_mainheader::lwr_sctr_thres, ecat63_mainheader::lwr_true_thres, MatBLKSIZE, ecat63_mainheader::node_id, NORM_DATA, ecat63_mainheader::num_bed_pos, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::operator_name, ecat63_mainheader::original_file_name, ecat63_mainheader::patient_age, ecat63_mainheader::patient_dexterity, ecat63_mainheader::patient_height, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, ecat63_mainheader::patient_sex, ecat63_mainheader::patient_weight, ecat63_mainheader::physician_name, ecat63_mainheader::plane_separation, ecat63_mainheader::radiopharmaceutical, RAW_DATA, ecat63_mainheader::rot_source_speed, ecat63_mainheader::scan_start_day, ecat63_mainheader::scan_start_hour, ecat63_mainheader::scan_start_minute, ecat63_mainheader::scan_start_month, ecat63_mainheader::scan_start_second, ecat63_mainheader::scan_start_year, ecat63_mainheader::septa_type, ecat63_mainheader::study_description, ecat63_mainheader::study_name, SUN_I4, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, ecat63_mainheader::transaxial_samp_mode, ecat63_mainheader::transm_source_type, ecat63_mainheader::upr_true_thres, ecat63_mainheader::user_process_code, and ecat63_mainheader::wobble_speed.

Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), imgRead(), imgReadEcat63Frame(), imgReadEcat63Header(), and imgWriteEcat63Frame().

Here is the call graph for this function:

int ecat63ReadMatdata ( FILE *  fp,
int  strtblk,
int  blkNr,
char *  data,
int  dtype 
)

Read ECAT 6.3 matrix data and convert byte order if necessary Remember to allocate memory for full blocks! There are differences here when compared to ecat7.c

Parameters
fpfile pointer from where data is read
strtblkstarting block [>= 1]
blkNrnumber of block to be read [>= 0]
datapointer to block where data is read
dtypedata type code
Returns
0 if ok, 1 invalid input, 2 failed to read data, 9 failed to find starting block from file,

Definition at line 432 of file ecat63r.c.

References BYTE_TYPE, ECAT63_TEST, ecat63rFloat(), ecat63rInt(), IEEE_R4, MatBLKSIZE, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Referenced by ecat63ReadAllToImg(), ecat63ReadImageMatrix(), ecat63ReadPlaneToImg(), ecat63ReadScanMatrix(), and imgReadEcat63Frame().

Here is the call graph for this function:

int ecat63ReadMatlist ( FILE *  fp,
MATRIXLIST ml 
)

Read ECAT matrix list. Matrix list must be initiated (once) before calling this.

Parameters
fpfile pointer
mlmatrix list
Returns
Returns 0 if ok, 1 if invalid input, 2 first matrix is not found, 3 if failed to read matrix, 4 failed to allocate memory, 5 other error

Definition at line 97 of file ecat63ml.c.

References ECAT63_TEST, ecat63EmptyMatlist(), MatDir::endblk, MatBLKSIZE, MATRIXLIST::matdir, MatFirstDirBlk, MatDir::matnum, MATRIXLIST::matrixNr, MATRIXLIST::matrixSpace, MatDir::matstat, and MatDir::strtblk.

Referenced by ecat63AddImg(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

Here is the call graph for this function:

int ecat63ReadNormheader ( FILE *  fp,
int  blk,
ECAT63_normheader h 
)

Read ECAT 6.3 normalization header

Parameters
fpfile pointer
blkblock number [2..number of blocks]
hEcat 6.3 normalization header
Returns
0 if ok, 1 invalid input, 2 failed to find block, 3 failed to read block, 4 invalid data type, 5 invalid scale factor

Definition at line 375 of file ecat63r.c.

References BYTE_TYPE, ecat63_normheader::data_type, ecat63_normheader::dimension_1, ecat63_normheader::dimension_2, ECAT63_TEST, ecat63rFloat(), ecat63_normheader::fov_source_width, MatBLKSIZE, ecat63_normheader::norm_day, ecat63_normheader::norm_hour, ecat63_normheader::norm_minute, ecat63_normheader::norm_month, ecat63_normheader::norm_second, ecat63_normheader::norm_year, ecat63_normheader::scale_factor, and SUN_I4.

Referenced by ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat6PrintSubheader(), imgReadEcat63Frame(), and imgReadEcat63Header().

Here is the call graph for this function:

int ecat63ReadScanheader ( FILE *  fp,
int  blk,
ECAT63_scanheader h 
)
int ecat63ReadScanMatrix ( FILE *  fp,
int  first_block,
int  last_block,
ECAT63_scanheader h,
float **  fdata 
)

Read ECAT63 scan matrix header and data. If only header is to be read, set last_block=first_block. Note: data is not calibrated with factor in main header.

Parameters
fpECAT file pointer
first_blockSubheader record number
last_blockLast data block number
hPtr to subheader data which is filled
fdataPtr to the address of the matrix data
Returns
0 if ok, 1 invalid input, 5 failed to read sub header, 6 invalid (x,y,z) dimesions, 8 failed to allocate memory for meta-data, 9 failed to read matrix data, 11 failed to allocate memory for image data

Definition at line 586 of file ecat63r.c.

References BYTE_TYPE, ecat63_scanheader::data_type, ecat63_scanheader::dimension_1, ecat63_scanheader::dimension_2, ECAT63_TEST, ecat63errmsg, ecat63PrintScanheader(), ecat63ReadMatdata(), ecat63ReadScanheader(), IEEE_R4, MatBLKSIZE, MatFirstDirBlk, ecat63_scanheader::scale_factor, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Here is the call graph for this function:

float ecat63rFloat ( void *  bufi,
int  isvax,
int  islittle 
)

Reading ECAT 6.3 floats

Parameters
bufipointer to 32-bit long data block
isvax1 for VAX format
islittle1 for little endian
Returns
read float value

Definition at line 671 of file ecat63r.c.

Referenced by ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatdata(), ecat63ReadNormheader(), and ecat63ReadScanheader().

int ecat63rInt ( void *  bufi,
int  isvax,
int  islittle 
)

Reading and writing ECAT 6.3 32-bit ints. 32-bit int format is same in VAX and i386

Parameters
bufipointer to 32-bit long data block
isvax1 for VAX format
islittle1 for littel endian
Returns
read data as interger number

Definition at line 694 of file ecat63r.c.

Referenced by ecat63ReadImageheader(), ecat63ReadMatdata(), and ecat63ReadScanheader().

void ecat63SortMatlistByFrame ( MATRIXLIST ml)

Sort matrixlist by frame and plane. Bubble sorting algorithm.

Parameters
mlmatrix list

Definition at line 316 of file ecat63ml.c.

References Matval::frame, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, and Matval::plane.

Referenced by imgReadEcat63Frame().

Here is the call graph for this function:

void ecat63SortMatlistByPlane ( MATRIXLIST ml)

Sort matrixlist by plane and frame. Bubble sorting algorithm.

Parameters
mlmarix list.

Definition at line 291 of file ecat63ml.c.

References Matval::frame, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, and Matval::plane.

Referenced by ecat63GetPlaneAndFrameNr(), and imgReadEcat63Header().

Here is the call graph for this function:

char* ecat63Unit ( short int  dunit)

Returns pointer to string describing the calibrated data unit (ECAT 6.3).

Parameters
dunitdata unit code
Returns
pointer to static string

Definition at line 250 of file ecat63p.c.

Referenced by ecat63PrintImageheader(), and ecat63PrintMainheader().

void ecat63wFloat ( float *  bufi,
void *  bufo,
int  tovax,
int  islittle 
)

Writing ECAT 6.3 floats

Parameters
bufipointer to 4-byte long input (float data)
bufopointer to 4-byte long output
tovax1 for VAX format
islittle1 for little endian

Definition at line 863 of file ecat63w.c.

Referenced by ecat63WriteAttnheader(), ecat63WriteImageheader(), ecat63WriteMainheader(), ecat63WriteNormheader(), and ecat63WriteScanheader().

void ecat63wInt ( int *  bufi,
void *  bufo,
int  tovax,
int  islittle 
)

Writing ECAT 6.3 32-bit ints. 32-bit int format is same in VAX and i386

Parameters
bufipointer to 4-byte long input (integer data)
bufopointer to 4-byte long output
tovax1 for VAX format
islittle1 for little endian

Definition at line 885 of file ecat63w.c.

Referenced by ecat63WriteImageheader(), and ecat63WriteScanheader().

int ecat63WriteAttn ( FILE *  fp,
int  matnum,
ECAT63_attnheader h,
void *  data 
)

Write ECAT 6.3 attenuation matrix header and data

Parameters
fptarget file pointer
matnummatrix number [1..number of matrixes]
hEcat 6.3 attenuation header
datapointer to data that is written
Returns
0 if ok, 1 invalid input or invalid image dimensions, 2 failed to resolve data type 3 too little data size, 4 failed to resolve next block size in file

Definition at line 576 of file ecat63w.c.

References BYTE_TYPE, ecat63_attnheader::data_type, ecat63_attnheader::dimension_1, ecat63_attnheader::dimension_2, ECAT63_TEST, ecat63Matenter(), ecat63WriteAttnheader(), ecat63WriteMatdata(), IEEE_R4, MatBLKSIZE, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Here is the call graph for this function:

int ecat63WriteAttnheader ( FILE *  fp,
int  block,
ECAT63_attnheader h 
)

Write ECAT 6.3 attenuation header

Parameters
fptarget file pointer
blockblock number [>=3]
hEcat 6.3 attenuation header
Returns
0 if ok, 1 invalid input, 2 failed to find block, 3 failed to write block

Definition at line 221 of file ecat63w.c.

References ecat63_attnheader::attenuation_coeff, ecat63_attnheader::attenuation_type, ecat63_attnheader::data_type, ecat63_attnheader::dimension_1, ecat63_attnheader::dimension_2, ECAT63_TEST, ecat63wFloat(), MatBLKSIZE, ecat63_attnheader::sample_distance, ecat63_attnheader::scale_factor, ecat63_attnheader::tilt_angle, VAX_I2, VAX_I4, VAX_R4, ecat63_attnheader::x_origin, ecat63_attnheader::x_radius, ecat63_attnheader::y_origin, and ecat63_attnheader::y_radius.

Referenced by ecat63WriteAttn().

Here is the call graph for this function:

int ecat63WriteImage ( FILE *  fp,
int  matnum,
ECAT63_imageheader h,
void *  data 
)

Write ECAT 6.3 image matrix header and data

Parameters
fptarget file pointer
matnummatrix number [1..number of matrixes]
hEcat 6.3 image header
datapointer to data that is written
Returns
0 if ok, 1 invalid input or invalid image dimensions, 2 failed to resolve data type 3 too little data size, 4 failed to resolve next block size in file

Definition at line 429 of file ecat63w.c.

References BYTE_TYPE, ecat63_imageheader::data_type, ecat63_imageheader::dimension_1, ecat63_imageheader::dimension_2, ECAT63_TEST, ecat63Matenter(), ecat63WriteImageheader(), ecat63WriteMatdata(), IEEE_R4, MatBLKSIZE, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Referenced by ecat63AddImg(), and ecat63WriteAllImg().

Here is the call graph for this function:

int ecat63WriteImageheader ( FILE *  fp,
int  block,
ECAT63_imageheader h 
)

Write ECAT 6.3 image header

Parameters
fptarget file pointer
blockblock number [>= 3]
hEcat 6.3 image header
Returns
0, if ok, 1 invalid input, 2 failed to find block, 3 failed to write block

Definition at line 150 of file ecat63w.c.

References ecat63_imageheader::annotation, ecat63_imageheader::atten_cor_mat_num, ecat63_imageheader::data_type, ecat63_imageheader::decay_corr_fctr, ecat63_imageheader::dimension_1, ecat63_imageheader::dimension_2, ECAT63_TEST, ecat63wFloat(), ecat63wInt(), ecat63_imageheader::ecat_calibration_fctr, ecat63_imageheader::fill1, ecat63_imageheader::fill2, ecat63_imageheader::filter_code, ecat63_imageheader::filter_params, ecat63_imageheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_imageheader::image_max, ecat63_imageheader::image_min, ecat63_imageheader::image_rotation, ecat63_imageheader::intrinsic_tilt, ecat63_imageheader::loss_corr_fctr, MatBLKSIZE, ecat63_imageheader::norm_matrix_num, ecat63_imageheader::num_dimensions, ecat63_imageheader::pixel_size, ecat63_imageheader::plane_eff_corr_fctr, ecat63_imageheader::processing_code, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_imageheader::recon_scale, ecat63_imageheader::recon_start_day, ecat63_imageheader::recon_start_hour, ecat63_imageheader::recon_start_min, ecat63_imageheader::recon_start_month, ecat63_imageheader::recon_start_sec, ecat63_imageheader::recon_start_year, ecat63_imageheader::scan_matrix_num, ecat63_imageheader::slice_location, ecat63_imageheader::slice_width, VAX_I2, VAX_I4, VAX_R4, ecat63_imageheader::well_counter_cal_fctr, ecat63_imageheader::x_origin, and ecat63_imageheader::y_origin.

Referenced by ecat63WriteImage(), and ecat63WriteImageMatrix().

Here is the call graph for this function:

int ecat63WriteImageMatrix ( FILE *  fp,
int  matnum,
ECAT63_imageheader h,
float *  fdata 
)

Write ECAT 6.3 image matrix header and data

Parameters
fptarget file pointer
matnum
hEcat 6.3 image header
fdata
Returns
0 if ok, 1 invalid input, 3 invalid matrix dimensions, 4 invalid block number, 5 failed to allocate memory, 8 failed to resolve new matrix block number, 10 failed to write image sub header, 13 failed to write matrix data

Definition at line 700 of file ecat63w.c.

References ecat63_imageheader::data_type, ecat63_imageheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_is_scaling_needed(), ECAT63_TEST, ecat63errmsg, ecat63Matenter(), ecat63pxlbytes(), ecat63WriteImageheader(), ecat63WriteMatdata(), ecat63_imageheader::image_max, ecat63_imageheader::image_min, MatBLKSIZE, and ecat63_imageheader::quant_scale.

Referenced by imgWriteEcat63Frame().

Here is the call graph for this function:

int ecat63WriteMainheader ( FILE *  fp,
ECAT63_mainheader h 
)

Write ECAT 6.3 main header.

Parameters
fptarget file pointer
hEcat 6.3 main header
Returns
0, if ok, 1 invalid input, 2 failed to find block, 3 failed to write block

Definition at line 73 of file ecat63w.c.

References ecat63_mainheader::acquisition_type, ecat63_mainheader::axial_fov, ecat63_mainheader::axial_samp_mode, ecat63_mainheader::bed_elevation, ecat63_mainheader::bed_offset, ecat63_mainheader::bed_type, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::coin_samp_mode, ecat63_mainheader::compression_code, ecat63_mainheader::data_type, ECAT63_TEST, ecat63wFloat(), ecat63_mainheader::facility_name, ecat63_mainheader::file_type, ecat63_mainheader::fill1, ecat63_mainheader::fill2, ecat63_mainheader::gantry_rotation, ecat63_mainheader::gantry_tilt, ecat63_mainheader::init_bed_position, ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, ecat63_mainheader::lwr_sctr_thres, ecat63_mainheader::lwr_true_thres, MatBLKSIZE, ecat63_mainheader::node_id, ecat63_mainheader::num_bed_pos, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::operator_name, ecat63_mainheader::original_file_name, ecat63_mainheader::patient_age, ecat63_mainheader::patient_dexterity, ecat63_mainheader::patient_height, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, ecat63_mainheader::patient_sex, ecat63_mainheader::patient_weight, ecat63_mainheader::physician_name, ecat63_mainheader::plane_separation, ecat63_mainheader::radiopharmaceutical, ecat63_mainheader::rot_source_speed, ecat63_mainheader::scan_start_day, ecat63_mainheader::scan_start_hour, ecat63_mainheader::scan_start_minute, ecat63_mainheader::scan_start_month, ecat63_mainheader::scan_start_second, ecat63_mainheader::scan_start_year, ecat63_mainheader::septa_type, ecat63_mainheader::study_description, ecat63_mainheader::study_name, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, ecat63_mainheader::transaxial_samp_mode, ecat63_mainheader::transm_source_type, ecat63_mainheader::upr_true_thres, ecat63_mainheader::user_process_code, VAX_I2, VAX_I4, VAX_R4, and ecat63_mainheader::wobble_speed.

Referenced by ecat63AddImg(), ecat63Create(), and imgWriteEcat63Frame().

Here is the call graph for this function:

int ecat63WriteMatdata ( FILE *  fp,
int  strtblk,
char *  data,
int  pxlNr,
int  pxlSize 
)

Write ECAT 6.3 matrix data to a specified file position. Data does not need to be allocated for full blocks. Data must be represented in current machines byte order, and it is always saved in big endian byte order. Give also nr of pixels and byte size of one pixel.

Parameters
fptarget file pointer
strtblkstarting image block [>=1]
datapointer to data that is written
pxlNrnumber of items to be written [>=1]
pxlSizesize of one data item in bytes [>=1]
Returns
0 if ok, 1 invalid input, 2 failed to find starting block, 3 failed to write data

Definition at line 629 of file ecat63w.c.

References ECAT63_TEST, and MatBLKSIZE.

Referenced by ecat63WriteAttn(), ecat63WriteImage(), ecat63WriteImageMatrix(), ecat63WriteNorm(), ecat63WriteScan(), and ecat63WriteScanMatrix().

int ecat63WriteNorm ( FILE *  fp,
int  matnum,
ECAT63_normheader h,
void *  data 
)

Write ECAT 6.3 normalization matrix header and data

Parameters
fptarget file pointer
matnummatrix number [1..number of matrixes]
hEcat 6.3 normalization header
datapointer to data that is written
Returns
0 if ok, 1 invalid input or invalid image dimensions, 2 failed to resolve data type 3 too little data size, 4 failed to resolve next block size in file

Definition at line 527 of file ecat63w.c.

References BYTE_TYPE, ecat63_normheader::data_type, ecat63_normheader::dimension_1, ecat63_normheader::dimension_2, ECAT63_TEST, ecat63Matenter(), ecat63WriteMatdata(), ecat63WriteNormheader(), IEEE_R4, MatBLKSIZE, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Here is the call graph for this function:

int ecat63WriteNormheader ( FILE *  fp,
int  block,
ECAT63_normheader h 
)

Write ECAT 6.3 normalization header

Parameters
fptarget file pointer
blockblock number [>=3]
hEcat 6.3 normalization header
Returns
0 if ok, 1 invalid input, 2 failed to find block, 3 failed to write block

Definition at line 336 of file ecat63w.c.

References ecat63_normheader::data_type, ecat63_normheader::dimension_1, ecat63_normheader::dimension_2, ECAT63_TEST, ecat63wFloat(), ecat63_normheader::fov_source_width, MatBLKSIZE, ecat63_normheader::norm_day, ecat63_normheader::norm_hour, ecat63_normheader::norm_minute, ecat63_normheader::norm_month, ecat63_normheader::norm_second, ecat63_normheader::norm_year, ecat63_normheader::scale_factor, VAX_I2, VAX_I4, and VAX_R4.

Referenced by ecat63WriteNorm().

Here is the call graph for this function:

int ecat63WriteScan ( FILE *  fp,
int  matnum,
ECAT63_scanheader h,
void *  data 
)

Write ECAT 6.3 sinogram matrix header and data

Parameters
fptarget file pointer
matnummatrix number [1..number of matrixes]
hEcat 6.3 scan header
datapointer to data that is written
Returns
0 if ok, 1 invalid input or invalid image dimensions, 2 failed to resolve data type 3 too little data size, 4 failed to resolve next block size in file

Definition at line 478 of file ecat63w.c.

References BYTE_TYPE, ecat63_scanheader::data_type, ecat63_scanheader::dimension_1, ecat63_scanheader::dimension_2, ECAT63_TEST, ecat63Matenter(), ecat63WriteMatdata(), ecat63WriteScanheader(), IEEE_R4, MatBLKSIZE, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.

Referenced by ecat63AddImg(), and ecat63WriteAllImg().

Here is the call graph for this function:

int ecat63WriteScanheader ( FILE *  fp,
int  block,
ECAT63_scanheader h 
)
int ecat63WriteScanMatrix ( FILE *  fp,
int  matnum,
ECAT63_scanheader h,
float *  fdata 
)

Write ECAT 6.3 sinogram matrix header and data

Parameters
fptarget file pointer
matnummatrix number [1..number of matrixes]
hEcat 6.3 scan header
fdatamatrix data
Returns
0 if ok, 1 invalid input, 3 invalid matrix dimension, 4 invalid block number, 5 failed to allocate memory for data, 8 failed to resolve next block number, 10 cannot write sub header, 13 failed to write data

Definition at line 784 of file ecat63w.c.

References ecat63_scanheader::data_type, ecat63_scanheader::dimension_1, ecat63_scanheader::dimension_2, ecat63_is_scaling_needed(), ECAT63_TEST, ecat63errmsg, ecat63Matenter(), ecat63pxlbytes(), ecat63WriteMatdata(), ecat63WriteScanheader(), MatBLKSIZE, ecat63_scanheader::scale_factor, ecat63_scanheader::scan_max, and ecat63_scanheader::scan_min.

Referenced by imgWriteEcat63Frame().

Here is the call graph for this function:

int ecat6PrintSubheader ( ECAT63_mainheader  mh,
FILE *  fp,
int  plane,
int  frame,
FILE *  ofp 
)
Print ECAT63 subheader contents into specified file pointer.
Returns
Returns 0 when successful.
Parameters
mhECAT 6.3 mainheader (not printed but needed here)
fpFile pointer to ECAT 6.3 file
planeECAT 6.3 plane
frameECAT 6.3 frame
ofpOutput is written to this file pointer; it can be stdout

Definition at line 296 of file ecat63p.c.

References ATTN_DATA, Matval::bed, ECAT63_TEST, ecat63EmptyMatlist(), ecat63InitMatlist(), ecat63PrintAttnheader(), ecat63PrintImageheader(), ecat63PrintMatlist(), ecat63PrintNormheader(), ecat63PrintScanheader(), ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMatlist(), ecat63ReadNormheader(), ecat63ReadScanheader(), ecat63_mainheader::file_type, Matval::frame, Matval::gate, IMAGE_DATA, mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, NORM_DATA, Matval::plane, RAW_DATA, and MatDir::strtblk.

Here is the call graph for this function:

void float2parts ( float *  buf)

Printfs separately the sign, mantissa, and exp part of a 32-bit float, which is pointed to by the argument. Code is not optimized; do not use this in routine operations!

Parameters
bufprinted float

Definition at line 282 of file ecat63p.c.

int mat_numcod ( int  frame,
int  plane,
int  gate,
int  data,
int  bed 
)

Returns the matrix identifier

Parameters
frameframe number [0..4096]
planeplane number [0..256]
gategate number [0..64]
datadata number [0..8]
bedbed position [0..16]
Returns
matrix indentifier coding

Definition at line 266 of file ecat63ml.c.

Referenced by ecat63AddImg(), ecat63GatherMatlist(), ecat63WriteAllImg(), and imgWriteEcat63Frame().

void mat_numdoc ( int  matnum,
Matval matval 
)

Conversion of matrix identifier to numerical values

Parameters
matnummatrix identifier coding
matvaltarget matrix value structure

Definition at line 276 of file ecat63ml.c.

References Matval::bed, Matval::data, Matval::frame, Matval::gate, and Matval::plane.

Referenced by ecat63AddImg(), ecat63DeleteLateFrames(), ecat63GatherMatlist(), ecat63GetNums(), ecat63GetPlaneAndFrameNr(), ecat63PrintMatlist(), ecat63ReadAllToImg(), ecat63ReadPlaneToImg(), ecat63SortMatlistByFrame(), ecat63SortMatlistByPlane(), ecat6PrintSubheader(), and imgReadEcat63Frame().

Variable Documentation

int ECAT63_TEST
char ecat63errmsg[128]