Functions
ecat63p.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include "swap.h"
#include "include/ecat63.h"
Include dependency graph for ecat63p.c:

Go to the source code of this file.

Functions

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)
char * ecat63Datatype (short int dtype)
char * ecat63Unit (short int dunit)
void float2parts (float *buf)
int ecat6PrintSubheader (ECAT63_mainheader mh, FILE *fp, int plane, int frame, FILE *ofp)

Function Documentation

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().

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 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 
)
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().

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.