My Project
|
Go to the source code of this file.
Data Structures | |
struct | ecat7_mainheader |
struct | ecat7_imageheader |
struct | ecat7_scanheader |
struct | ecat7_2Dscanheader |
struct | ecat7_2Dnormheader |
struct | ecat7_attenheader |
struct | ecat7_normheader |
struct | ecat7_polmapheader |
struct | ECAT7_MatDir |
struct | ECAT7_MATRIXLIST |
struct | ECAT7_Matval |
Typedefs | |
typedef struct ecat7_mainheader | ECAT7_mainheader |
typedef struct ecat7_imageheader | ECAT7_imageheader |
typedef struct ecat7_scanheader | ECAT7_scanheader |
typedef struct ecat7_2Dscanheader | ECAT7_2Dscanheader |
typedef struct ecat7_2Dnormheader | ECAT7_2Dnormheader |
typedef struct ecat7_attenheader | ECAT7_attenheader |
typedef struct ecat7_normheader | ECAT7_normheader |
typedef struct ecat7_polmapheader | ECAT7_polmapheader |
Functions | |
int | ecat7ReadMainheader (FILE *fp, ECAT7_mainheader *h) |
int | ecat7ReadImageheader (FILE *fp, int blk, ECAT7_imageheader *h) |
int | ecat7ReadAttenheader (FILE *fp, int blk, ECAT7_attenheader *h) |
int | ecat7ReadPolmapheader (FILE *fp, int blk, ECAT7_polmapheader *h) |
int | ecat7ReadNormheader (FILE *fp, int blk, ECAT7_normheader *h) |
int | ecat7ReadScanheader (FILE *fp, int blk, ECAT7_scanheader *h) |
int | ecat7Read2DScanheader (FILE *fp, int blk, ECAT7_2Dscanheader *h) |
int | ecat7Read2DNormheader (FILE *fp, int blk, ECAT7_2Dnormheader *h) |
int | ecat7ReadMatrixdata (FILE *fp, int start_block, int block_nr, char *data, int dtype) |
float | ecat7rFloat (void *bufi, int isvax, int islittle) |
int | ecat7rInt (void *bufi, int isvax, int islittle) |
int | ecat7ReadImageMatrix (FILE *fp, int first_block, int last_block, ECAT7_imageheader *h, float **fdata) |
int | ecat7Read2DScanMatrix (FILE *fp, int first_block, int last_block, ECAT7_2Dscanheader *h, float **fdata) |
int | ecat7ReadScanMatrix (FILE *fp, int first_block, int last_block, ECAT7_scanheader *h, float **fdata) |
int | ecat7ReadPolarmapMatrix (FILE *fp, int first_block, int last_block, ECAT7_polmapheader *h, float **fdata) |
int | ecat7pxlbytes (short int data_type) |
void | ecat7InitMatlist (ECAT7_MATRIXLIST *mlist) |
void | ecat7EmptyMatlist (ECAT7_MATRIXLIST *mlist) |
int | ecat7ReadMatlist (FILE *fp, ECAT7_MATRIXLIST *ml) |
void | ecat7PrintMatlist (ECAT7_MATRIXLIST *ml) |
int | ecat7EnterMatrix (FILE *fp, int matrix_id, int block_nr) |
int | ecat7_val_to_id (int frame, int plane, int gate, int data, int bed) |
void | ecat7_id_to_val (int matrix_id, ECAT7_Matval *matval) |
void | ecat7SortMatlistByPlane (ECAT7_MATRIXLIST *ml) |
void | ecat7SortMatlistByFrame (ECAT7_MATRIXLIST *ml) |
int | ecat7CheckMatlist (ECAT7_MATRIXLIST *ml) |
int | ecat7DeleteLateFrames (ECAT7_MATRIXLIST *ml, int frame_nr) |
int | ecat7GetPlaneAndFrameNr (ECAT7_MATRIXLIST *mlist, ECAT7_mainheader *h, int *plane_nr, int *frame_nr) |
int | ecat7GetMatrixBlockSize (ECAT7_MATRIXLIST *mlist, int *blk_nr) |
int | ecat7GetNums (ECAT7_MATRIXLIST *ml, ECAT7_mainheader *mh, FILE *fp, short int *num_planes, short int *num_frames, short int *num_gates, short int *num_bed_pos) |
int | ecat7GatherMatlist (ECAT7_MATRIXLIST *ml, short int do_planes, short int do_frames, short int do_gates, short int do_beds) |
int | ecat7WriteMainheader (FILE *fp, ECAT7_mainheader *h) |
int | ecat7WriteImageheader (FILE *fp, int blk, ECAT7_imageheader *h) |
int | ecat7WriteAttenheader (FILE *fp, int blk, ECAT7_attenheader *h) |
int | ecat7WritePolmapheader (FILE *fp, int blk, ECAT7_polmapheader *h) |
int | ecat7WriteNormheader (FILE *fp, int blk, ECAT7_normheader *h) |
int | ecat7WriteScanheader (FILE *fp, int blk, ECAT7_scanheader *h) |
int | ecat7Write2DScanheader (FILE *fp, int blk, ECAT7_2Dscanheader *h) |
int | ecat7Write2DNormheader (FILE *fp, int blk, ECAT7_2Dnormheader *h) |
int | ecat7WritePolarmapMatrix (FILE *fp, int matrix_id, ECAT7_polmapheader *h, float *fdata) |
int | ecat7WriteMatrixdata (FILE *fp, int start_block, char *data, int pxl_nr, int pxl_size) |
FILE * | ecat7Create (const char *fname, ECAT7_mainheader *h) |
int | ecat7WriteImageMatrix (FILE *fp, int matrix_id, ECAT7_imageheader *h, float *fdata) |
int | ecat7Write2DScanMatrix (FILE *fp, int matrix_id, ECAT7_2Dscanheader *h, float *fdata) |
int | ecat7WriteScanMatrix (FILE *fp, int matrix_id, ECAT7_scanheader *h, float *fdata) |
int | ecat7_is_scaling_needed (float amax, float *data, int nr) |
void | ecat7PrintMainheader (ECAT7_mainheader *h, FILE *fp) |
void | ecat7PrintImageheader (ECAT7_imageheader *h, FILE *fp) |
void | ecat7PrintScanheader (ECAT7_scanheader *h, FILE *fp) |
void | ecat7PrintAttenheader (ECAT7_attenheader *h, FILE *fp) |
void | ecat7PrintPolmapheader (ECAT7_polmapheader *h, FILE *fp) |
void | ecat7PrintNormheader (ECAT7_normheader *h, FILE *fp) |
void | ecat7Print2DScanheader (ECAT7_2Dscanheader *h, FILE *fp) |
void | ecat7Print2DNormheader (ECAT7_2Dnormheader *h, FILE *fp) |
int | ecat7PrintSubheader (ECAT7_mainheader mh, FILE *fp, int plane, int frame, FILE *ofp) |
char * | ecat7filetype (short int file_type) |
char * | ecat7acquisitiontype (short int acquisition_type) |
char * | ecat7datatype (short int data_type) |
int | ecat7EditMHeader (ECAT7_mainheader *h, char *field, char *value) |
int | ecat7EditSHeader (ECAT7_scanheader *h, char *field, char *value) |
int | ecat7EditVHeader (ECAT7_imageheader *h, char *field, char *value) |
Variables | |
char | ecat7errmsg [128] |
int | ECAT7_TEST |
typedef struct ecat7_2Dnormheader ECAT7_2Dnormheader |
typedef struct ecat7_2Dscanheader ECAT7_2Dscanheader |
typedef struct ecat7_attenheader ECAT7_attenheader |
typedef struct ecat7_imageheader ECAT7_imageheader |
typedef struct ecat7_mainheader ECAT7_mainheader |
typedef struct ecat7_normheader ECAT7_normheader |
typedef struct ecat7_polmapheader ECAT7_polmapheader |
typedef struct ecat7_scanheader ECAT7_scanheader |
void ecat7_id_to_val | ( | int | matrix_id, |
ECAT7_Matval * | matval | ||
) |
Conversion of matrix identifier to numerical values
matrix_id | matrix identifire coding |
matval | matrix values structure |
Definition at line 299 of file ecat7ml.c.
References ECAT7_Matval::bed, ECAT7_Matval::data, ECAT7_Matval::frame, ECAT7_Matval::gate, and ECAT7_Matval::plane.
Referenced by ecat7DeleteLateFrames(), ecat7GatherMatlist(), ecat7GetNums(), ecat7GetPlaneAndFrameNr(), ecat7PrintMatlist(), ecat7PrintSubheader(), ecat7SortMatlistByFrame(), ecat7SortMatlistByPlane(), imgReadEcat7(), and imgReadEcat7Frame().
int ecat7_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.
amax | absolute maximum value |
data | float array |
nr | float array size |
Definition at line 657 of file ecat7w.c.
Referenced by ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), and ecat7WriteScanMatrix().
int ecat7_val_to_id | ( | int | frame, |
int | plane, | ||
int | gate, | ||
int | data, | ||
int | bed | ||
) |
Returns the matrix identifier.
frame | frame number [0..65536] |
plane | plane number [0..65536] |
gate | gate number [0..64] |
data | data [0..1] |
bed | bed position [0..16] |
Definition at line 282 of file ecat7ml.c.
Referenced by ecat7GatherMatlist(), imgWrite2DEcat7(), imgWriteEcat7(), imgWriteEcat7Frame(), and imgWritePolarmap().
char* ecat7acquisitiontype | ( | short int | acquisition_type | ) |
Returns pointer to a string describing the ECAT7 acquisition_type
acquisition_type | acquisition type code |
Definition at line 498 of file ecat7p.c.
Referenced by ecat7PrintMainheader().
int ecat7CheckMatlist | ( | ECAT7_MATRIXLIST * | ml | ) |
Checks that all matrixlist entries have read/write status.
ml | checked matrix list |
Definition at line 366 of file ecat7ml.c.
References ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_MatDir::status.
Referenced by imgReadEcat7(), imgReadEcat7Frame(), and imgReadEcat7Header().
FILE* ecat7Create | ( | const char * | fname, |
ECAT7_mainheader * | h | ||
) |
Create a new ECAT 7.x file. If file exists, it is renamed as fname% if possible. Directory list is written in big endian byte order.
fname | filename |
h | Ecat7 main header |
Definition at line 616 of file ecat7w.c.
References BACKUP_EXTENSION, ECAT7_TEST, ecat7WriteMainheader(), MatBLKSIZE, and MatFirstDirBlk.
Referenced by imgWrite2DEcat7(), imgWriteEcat7(), imgWriteEcat7Frame(), and imgWritePolarmap().
char* ecat7datatype | ( | short int | data_type | ) |
Returns pointer to a string describing the ECAT7 data_type
data_type | data type code |
Definition at line 517 of file ecat7p.c.
Referenced by ecat7Print2DNormheader(), ecat7Print2DScanheader(), ecat7PrintAttenheader(), ecat7PrintImageheader(), ecat7PrintNormheader(), ecat7PrintPolmapheader(), and ecat7PrintScanheader().
int ecat7DeleteLateFrames | ( | ECAT7_MATRIXLIST * | ml, |
int | frame_nr | ||
) |
Mark deleted the frames after the specified frame number.
ml | target matrix list |
frame_nr | first index to be marked as deleted [1..number of frames] |
Definition at line 383 of file ecat7ml.c.
References ecat7_id_to_val(), ECAT7_Matval::frame, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_MatDir::status.
int ecat7EditMHeader | ( | ECAT7_mainheader * | h, |
char * | field, | ||
char * | value | ||
) |
Edit ECAT 7 main header.
h | Pointer to ECAT 7 mainheader structure |
field | Field name to be changed |
value | New value for the field |
Definition at line 30 of file ecat7h.c.
References ecat7_mainheader::acquisition_mode, ecat7_mainheader::acquisition_type, ecat7_mainheader::angular_compression, ecat7_mainheader::axial_samp_mode, ecat7_mainheader::bed_elevation, ecat7_mainheader::bed_position, ecat7_mainheader::bin_size, ecat7_mainheader::branching_fraction, ecat7_mainheader::calibration_units, ecat7_mainheader::calibration_units_label, ecat7_mainheader::coin_samp_mode, ecat7_mainheader::compression_code, ecat7_mainheader::data_units, ecat7_mainheader::distance_scanned, ecat7_mainheader::dosage, ecat7_mainheader::dose_start_time, ecat7_mainheader::ecat_calibration_factor, ecat7_mainheader::facility_name, ecat7_mainheader::file_type, ecat7_mainheader::gantry_rotation, ecat7_mainheader::gantry_tilt, ecat7_mainheader::init_bed_position, ecat7_mainheader::intrinsic_tilt, ecat7_mainheader::isotope_halflife, ecat7_mainheader::isotope_name, ecat7_mainheader::lwr_sctr_thres, ecat7_mainheader::lwr_true_thres, ecat7_mainheader::magic_number, ecat7_mainheader::num_bed_pos, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_mainheader::num_planes, ecat7_mainheader::operator_name, ecat7_mainheader::original_file_name, ecat7_mainheader::patient_age, ecat7_mainheader::patient_birth_date, ecat7_mainheader::patient_dexterity, ecat7_mainheader::patient_height, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, ecat7_mainheader::patient_sex, ecat7_mainheader::patient_weight, ecat7_mainheader::physician_name, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, ecat7_mainheader::scan_start_time, ecat7_mainheader::septa_state, ecat7_mainheader::serial_number, ecat7_mainheader::study_description, ecat7_mainheader::study_type, ecat7_mainheader::sw_version, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, ecat7_mainheader::transm_source_type, ecat7_mainheader::upr_true_thres, ecat7_mainheader::user_process_code, ecat7_mainheader::well_counter_corr_factor, and ecat7_mainheader::wobble_speed.
int ecat7EditSHeader | ( | ECAT7_scanheader * | h, |
char * | field, | ||
char * | value | ||
) |
Edit ECAT 7 3Dscan header.
h | Pointer to ECAT 7 3D scan header structure |
field | Field name to be changed |
value | New value for the field |
Definition at line 195 of file ecat7h.c.
References ecat7_scanheader::axial_compression, ecat7_scanheader::corrections_applied, ecat7_scanheader::data_type, ecat7_scanheader::deadtime_correction_factor, ecat7_scanheader::delayed, ecat7_scanheader::fill_cti, ecat7_scanheader::fill_gate, ecat7_scanheader::fill_user, ecat7_scanheader::frame_duration, ecat7_scanheader::frame_start_time, ecat7_scanheader::gate_duration, ecat7_scanheader::multiples, ecat7_scanheader::net_trues, ecat7_scanheader::num_accepted_beats, ecat7_scanheader::num_angles, ecat7_scanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::prompts, ecat7_scanheader::r_wave_offset, ecat7_scanheader::ring_difference, ecat7_scanheader::scale_factor, ecat7_scanheader::scan_max, ecat7_scanheader::scan_min, ecat7_scanheader::storage_order, ecat7_scanheader::tot_avg_cor, ecat7_scanheader::tot_avg_uncor, ecat7_scanheader::total_coin_rate, ecat7_scanheader::v_resolution, ecat7_scanheader::w_resolution, ecat7_scanheader::x_resolution, and ecat7_scanheader::z_resolution.
int ecat7EditVHeader | ( | ECAT7_imageheader * | h, |
char * | field, | ||
char * | value | ||
) |
Edit ECAT 7 image volume header.
h | Pointer to ECAT 7 image volume header structure |
field | Field name to be changed |
value | New value for the field |
Definition at line 312 of file ecat7h.c.
References ecat7_imageheader::annotation, ecat7_imageheader::data_type, ecat7_imageheader::decay_corr_fctr, ecat7_imageheader::filter_code, ecat7_imageheader::filter_cutoff_frequency, ecat7_imageheader::filter_order, ecat7_imageheader::filter_ramp_slope, ecat7_imageheader::filter_resolution, ecat7_imageheader::filter_scatter_fraction, ecat7_imageheader::filter_scatter_slope, ecat7_imageheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_imageheader::gate_duration, ecat7_imageheader::image_max, ecat7_imageheader::image_min, ecat7_imageheader::mt_1_1, ecat7_imageheader::mt_1_2, ecat7_imageheader::mt_1_3, ecat7_imageheader::mt_1_4, ecat7_imageheader::mt_2_1, ecat7_imageheader::mt_2_2, ecat7_imageheader::mt_2_3, ecat7_imageheader::mt_2_4, ecat7_imageheader::mt_3_1, ecat7_imageheader::mt_3_2, ecat7_imageheader::mt_3_3, ecat7_imageheader::mt_3_4, ecat7_imageheader::num_accepted_beats, ecat7_imageheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_imageheader::num_r_elements, ecat7_imageheader::processing_code, ecat7_imageheader::r_wave_offset, ecat7_imageheader::recon_type, ecat7_imageheader::recon_views, ecat7_imageheader::recon_zoom, ecat7_imageheader::rfilter_code, ecat7_imageheader::rfilter_cutoff, ecat7_imageheader::rfilter_order, ecat7_imageheader::rfilter_resolution, ecat7_imageheader::scale_factor, ecat7_imageheader::scatter_type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_offset, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_offset, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_offset, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, ecat7_imageheader::z_rotation_angle, ecat7_imageheader::zfilter_code, ecat7_imageheader::zfilter_cutoff, ecat7_imageheader::zfilter_order, and ecat7_imageheader::zfilter_resolution.
void ecat7EmptyMatlist | ( | ECAT7_MATRIXLIST * | mlist | ) |
Free memory allocated for ECAT matrix list.
mlist | target matrix list that has allocated memory |
Definition at line 70 of file ecat7ml.c.
References ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_MATRIXLIST::matrixSpace.
Referenced by ecat7PrintSubheader(), ecat7ReadMatlist(), imgReadEcat7(), imgReadEcat7Frame(), and imgReadEcat7Header().
int ecat7EnterMatrix | ( | FILE * | fp, |
int | matrix_id, | ||
int | block_nr | ||
) |
Prepare matrix list for additional matrix data and return block number for matrix header. Directory records are written in big endian byte order. Set block_nr to the number of data blocks + (nr of header blocks - 1)
fp | file pointer |
matrix_id | matrix identifier coding |
block_nr | matrix number [1..number of matrixes] |
Definition at line 184 of file ecat7ml.c.
References ECAT7_TEST, MatBLKSIZE, and MatFirstDirBlk.
Referenced by ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), and ecat7WriteScanMatrix().
char* ecat7filetype | ( | short int | file_type | ) |
Returns pointer to a string describing the ECAT7 file_type
file_type | file type code |
Definition at line 479 of file ecat7p.c.
Referenced by ecat7PrintMainheader(), and imgRead().
int ecat7GatherMatlist | ( | ECAT7_MATRIXLIST * | ml, |
short int | do_planes, | ||
short int | do_frames, | ||
short int | do_gates, | ||
short int | do_beds | ||
) |
Matrix numbers in ECAT 7 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.
ml | ECAT 7 matrix list, where the matrix numbers will be edited |
do_planes | Plane numbers are gathered together (1) or not (0) |
do_frames | Frame numbers are gathered together (1) or not (0) |
do_gates | Gate numbers are gathered together (1) or not (0) |
do_beds | Bed numbers are gathered together (1) or not (0) |
Definition at line 572 of file ecat7ml.c.
References ECAT7_Matval::bed, ecat7_id_to_val(), ecat7_val_to_id(), ECAT7_Matval::frame, ECAT7_Matval::gate, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_Matval::plane.
Referenced by imgReadEcat7Frame(), and imgReadEcat7Header().
int ecat7GetMatrixBlockSize | ( | ECAT7_MATRIXLIST * | mlist, |
int * | blk_nr | ||
) |
Calculate the size of one data matrix in ECAT7 file matrix list, and check that the size is same in all matrices.
mlist | Ecat7 matrix list; note that this list is here sorted by planes |
blk_nr | number of blocks will be put here; NULL if not needed |
Definition at line 455 of file ecat7ml.c.
References ECAT7_MatDir::endblk, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, STATUS_FAULT, STATUS_OK, STATUS_VARMATSIZE, and ECAT7_MatDir::strtblk.
Referenced by imgReadEcat7Header().
int ecat7GetNums | ( | ECAT7_MATRIXLIST * | ml, |
ECAT7_mainheader * | mh, | ||
FILE * | fp, | ||
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. In case of 3D formats, num_planes is checked from the first subheader.
ml | Pointer to matrixlist |
mh | Pointer to mainheader |
fp | File pointer to ECAT7 file opened in binary mode |
num_planes | num_planes will be put here; NULL if not needed to be read |
num_frames | num_planes will be put here; NULL if not needed to be read |
num_gates | num_planes will be put here; NULL if not needed to be read |
num_bed_pos | num_planes will be put here; NULL if not needed to be read |
Definition at line 489 of file ecat7ml.c.
References ECAT7_Matval::bed, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ecat7_id_to_val(), ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7ReadImageheader(), ecat7ReadScanheader(), ecat7_mainheader::file_type, ECAT7_Matval::frame, ECAT7_Matval::gate, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, ecat7_imageheader::num_dimensions, ecat7_scanheader::num_z_elements, ECAT7_Matval::plane, ECAT7_MatDir::strtblk, and ecat7_imageheader::z_dimension.
int ecat7GetPlaneAndFrameNr | ( | ECAT7_MATRIXLIST * | mlist, |
ECAT7_mainheader * | h, | ||
int * | plane_nr, | ||
int * | frame_nr | ||
) |
Calculate the number of planes and frames/gates from ECAT7 matrix list. Check that all planes have equal nr of frames/gates, that frames/gates are sequentally numbered.
mlist | Ecat7 matrix list; note that this list is here sorted by planes |
h | Ecat7 main header structure |
plane_nr | Number of planes will be put here; NULL if not needed [1..number of planes, or NULL] |
frame_nr | Number of frames/gates will be put here; NULL if not needed [1..number of frames, or NULL] |
Definition at line 409 of file ecat7ml.c.
References ecat7_id_to_val(), ecat7SortMatlistByPlane(), ECAT7_Matval::frame, ECAT7_Matval::gate, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ECAT7_Matval::plane, STATUS_FAULT, STATUS_MISSINGMATRIX, and STATUS_OK.
Referenced by imgReadEcat7Header().
void ecat7InitMatlist | ( | ECAT7_MATRIXLIST * | mlist | ) |
Initiate ECAT matrix list. Call this once before first use.
mlist | target matrix list |
Definition at line 59 of file ecat7ml.c.
References ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_MATRIXLIST::matrixSpace.
Referenced by ecat7PrintSubheader(), imgReadEcat7(), imgReadEcat7Frame(), and imgReadEcat7Header().
void ecat7Print2DNormheader | ( | ECAT7_2Dnormheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x 2D normalization header contents to specified file pointer
h | Ecat7 2D normalization header |
fp | target file pointer |
Definition at line 447 of file ecat7p.c.
References ecat7_2Dnormheader::data_type, ECAT7_TEST, ecat7datatype(), ecat7_2Dnormheader::fov_source_width, ecat7_2Dnormheader::norm_max, ecat7_2Dnormheader::norm_min, ecat7_2Dnormheader::norm_quality_factor, ecat7_2Dnormheader::norm_quality_factor_code, ecat7_2Dnormheader::num_angles, ecat7_2Dnormheader::num_dimensions, ecat7_2Dnormheader::num_r_elements, ecat7_2Dnormheader::num_z_elements, ecat7_2Dnormheader::ring_difference, ecat7_2Dnormheader::scale_factor, ecat7_2Dnormheader::span, ecat7_2Dnormheader::storage_order, and ecat7_2Dnormheader::z_elements.
Referenced by ecat7PrintSubheader().
void ecat7Print2DScanheader | ( | ECAT7_2Dscanheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x 2D sinogram header contents to specified file pointer
h | Ecat7 2D scan header |
fp | target file pointer |
Definition at line 396 of file ecat7p.c.
References ecat7_2Dscanheader::cor_singles, ecat7_2Dscanheader::corrections_applied, ecat7_2Dscanheader::data_type, ecat7_2Dscanheader::deadtime_correction_factor, ecat7_2Dscanheader::delayed, ECAT7_TEST, ecat7datatype(), ecat7_2Dscanheader::frame_duration, ecat7_2Dscanheader::frame_start_time, ecat7_2Dscanheader::gate_duration, ecat7_2Dscanheader::multiples, ecat7_2Dscanheader::net_trues, ecat7_2Dscanheader::num_accepted_beats, ecat7_2Dscanheader::num_angles, ecat7_2Dscanheader::num_dimensions, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, ecat7_2Dscanheader::physical_planes, ecat7_2Dscanheader::prompts, ecat7_2Dscanheader::r_wave_offset, ecat7_2Dscanheader::ring_difference, ecat7_2Dscanheader::scale_factor, ecat7_2Dscanheader::scan_max, ecat7_2Dscanheader::scan_min, ecat7_2Dscanheader::tot_avg_cor, ecat7_2Dscanheader::tot_avg_uncor, ecat7_2Dscanheader::total_coin_rate, ecat7_2Dscanheader::uncor_singles, ecat7_2Dscanheader::w_resolution, ecat7_2Dscanheader::x_resolution, ecat7_2Dscanheader::y_resolution, and ecat7_2Dscanheader::z_resolution.
Referenced by ecat7PrintSubheader(), and ecat7Read2DScanMatrix().
void ecat7PrintAttenheader | ( | ECAT7_attenheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x attenuation header contents to specified file pointer
h | Ecat7 attenuation header |
fp | target file pointer |
Definition at line 264 of file ecat7p.c.
References ecat7_attenheader::additional_atten_coeff, ecat7_attenheader::attenuation_coeff, ecat7_attenheader::attenuation_max, ecat7_attenheader::attenuation_min, ecat7_attenheader::attenuation_type, ecat7_attenheader::data_type, ECAT7_TEST, ecat7datatype(), ecat7_attenheader::edge_finding_threshold, ecat7_attenheader::num_additional_atten_coeff, ecat7_attenheader::num_angles, ecat7_attenheader::num_dimensions, ecat7_attenheader::num_r_elements, ecat7_attenheader::num_z_elements, ecat7_attenheader::ring_difference, ecat7_attenheader::scale_factor, ecat7_attenheader::skull_thickness, ecat7_attenheader::span, ecat7_attenheader::storage_order, ecat7_attenheader::tilt_angle, ecat7_attenheader::w_resolution, ecat7_attenheader::x_offset, ecat7_attenheader::x_radius, ecat7_attenheader::x_resolution, ecat7_attenheader::y_offset, ecat7_attenheader::y_radius, ecat7_attenheader::y_resolution, ecat7_attenheader::z_elements, and ecat7_attenheader::z_resolution.
Referenced by ecat7PrintSubheader().
void ecat7PrintImageheader | ( | ECAT7_imageheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x image header contents to specified file pointer.
h | Ecat7 image header |
fp | target file pointer |
Definition at line 137 of file ecat7p.c.
References ecat7_imageheader::annotation, ecat7_imageheader::data_type, ecat7_imageheader::decay_corr_fctr, ECAT7_TEST, ecat7datatype(), ecat7_imageheader::fill_cti, ecat7_imageheader::fill_user, ecat7_imageheader::filter_code, ecat7_imageheader::filter_cutoff_frequency, ecat7_imageheader::filter_order, ecat7_imageheader::filter_ramp_slope, ecat7_imageheader::filter_resolution, ecat7_imageheader::filter_scatter_fraction, ecat7_imageheader::filter_scatter_slope, ecat7_imageheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_imageheader::gate_duration, ecat7_imageheader::image_max, ecat7_imageheader::image_min, ecat7_imageheader::mt_1_1, ecat7_imageheader::mt_1_2, ecat7_imageheader::mt_1_3, ecat7_imageheader::mt_1_4, ecat7_imageheader::mt_2_1, ecat7_imageheader::mt_2_2, ecat7_imageheader::mt_2_3, ecat7_imageheader::mt_2_4, ecat7_imageheader::mt_3_1, ecat7_imageheader::mt_3_2, ecat7_imageheader::mt_3_3, ecat7_imageheader::mt_3_4, ecat7_imageheader::num_accepted_beats, ecat7_imageheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_imageheader::num_r_elements, ecat7_imageheader::processing_code, ecat7_imageheader::r_wave_offset, ecat7_imageheader::recon_type, ecat7_imageheader::recon_views, ecat7_imageheader::recon_zoom, ecat7_imageheader::rfilter_code, ecat7_imageheader::rfilter_cutoff, ecat7_imageheader::rfilter_order, ecat7_imageheader::rfilter_resolution, ecat7_imageheader::scale_factor, ecat7_imageheader::scatter_type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_offset, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_offset, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_offset, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, ecat7_imageheader::z_rotation_angle, ecat7_imageheader::zfilter_code, ecat7_imageheader::zfilter_cutoff, ecat7_imageheader::zfilter_order, and ecat7_imageheader::zfilter_resolution.
Referenced by ecat7PrintSubheader(), and ecat7ReadImageMatrix().
void ecat7PrintMainheader | ( | ECAT7_mainheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x main header contents to specified file pointer
h | Ecat7 main header |
fp | target file pointer |
Definition at line 49 of file ecat7p.c.
References ecat7_mainheader::acquisition_mode, ecat7_mainheader::acquisition_type, ecat7_mainheader::angular_compression, ecat7_mainheader::axial_samp_mode, ecat7_mainheader::bed_elevation, ecat7_mainheader::bed_position, ecat7_mainheader::bin_size, ecat7_mainheader::branching_fraction, ecat7_mainheader::calibration_units, ecat7_mainheader::calibration_units_label, ecat7_mainheader::coin_samp_mode, ecat7_mainheader::compression_code, ecat7_mainheader::data_units, ecat7_mainheader::distance_scanned, ecat7_mainheader::dosage, ecat7_mainheader::dose_start_time, ECAT7_TEST, ecat7acquisitiontype(), ecat7filetype(), ecat7_mainheader::ecat_calibration_factor, ecat7_mainheader::facility_name, ecat7_mainheader::file_type, ecat7_mainheader::fill_cti, ecat7_mainheader::gantry_rotation, ecat7_mainheader::gantry_tilt, ecat7_mainheader::init_bed_position, ecat7_mainheader::intrinsic_tilt, ecat7_mainheader::isotope_halflife, ecat7_mainheader::isotope_name, ecat7_mainheader::lwr_sctr_thres, ecat7_mainheader::lwr_true_thres, ecat7_mainheader::magic_number, ecat7_mainheader::num_bed_pos, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_mainheader::num_planes, ecat7_mainheader::operator_name, ecat7_mainheader::original_file_name, ecat7_mainheader::patient_age, ecat7_mainheader::patient_birth_date, ecat7_mainheader::patient_dexterity, ecat7_mainheader::patient_height, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, ecat7_mainheader::patient_sex, ecat7_mainheader::patient_weight, ecat7_mainheader::physician_name, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, ecat7_mainheader::scan_start_time, ecat7_mainheader::septa_state, ecat7_mainheader::serial_number, ecat7_mainheader::study_description, ecat7_mainheader::study_type, ecat7_mainheader::sw_version, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, ecat7_mainheader::transm_source_type, ecat7_mainheader::upr_true_thres, ecat7_mainheader::user_process_code, ecat7_mainheader::well_counter_corr_factor, and ecat7_mainheader::wobble_speed.
void ecat7PrintMatlist | ( | ECAT7_MATRIXLIST * | ml | ) |
Print ECAT matrix list on stdout.
ml | matrix list for Ecat7 file |
Definition at line 149 of file ecat7ml.c.
References ECAT7_Matval::bed, ecat7_id_to_val(), ECAT7_MatDir::endblk, ECAT7_Matval::frame, ECAT7_Matval::gate, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, ECAT7_Matval::plane, ECAT7_MatDir::status, and ECAT7_MatDir::strtblk.
Referenced by ecat7PrintSubheader(), and imgReadEcat7().
void ecat7PrintNormheader | ( | ECAT7_normheader * | h, |
FILE * | fp | ||
) |
Prints ECAT 7.x normalization header contents to specified file pointer
h | Ecat7 normalization header |
fp | tager file pointer |
Definition at line 359 of file ecat7p.c.
References ecat7_normheader::crystal_dtcor, ecat7_normheader::crystals_per_ring, ecat7_normheader::data_type, ECAT7_TEST, ecat7datatype(), ecat7_normheader::lld, ecat7_normheader::max_ring_diff, ecat7_normheader::norm_quality_factor, ecat7_normheader::norm_quality_factor_code, ecat7_normheader::num_crystal_rings, ecat7_normheader::num_geo_corr_planes, ecat7_normheader::num_r_elements, ecat7_normheader::num_transaxial_crystals, ecat7_normheader::ring_dtcor1, ecat7_normheader::ring_dtcor2, ecat7_normheader::scatter_energy, ecat7_normheader::span, and ecat7_normheader::uld.
Referenced by ecat7PrintSubheader().
void ecat7PrintPolmapheader | ( | ECAT7_polmapheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x polar map header contents to specified file pointer
h | Ecat7 polar map header |
fp | target file pointer |
Definition at line 310 of file ecat7p.c.
References ecat7_polmapheader::annotation, ecat7_polmapheader::data_type, ecat7_polmapheader::database_name, ECAT7_TEST, ecat7datatype(), ecat7_polmapheader::frame_duration, ecat7_polmapheader::frame_start_time, ecat7_polmapheader::gate_duration, ecat7_polmapheader::image_max, ecat7_polmapheader::image_min, ecat7_polmapheader::long_axis_left, ecat7_polmapheader::long_axis_right, ecat7_polmapheader::num_accepted_beats, ecat7_polmapheader::num_rings, ecat7_polmapheader::pixel_size, ecat7_polmapheader::polar_map_protocol, ecat7_polmapheader::polar_map_type, ecat7_polmapheader::position_data, ecat7_polmapheader::processing_code, ecat7_polmapheader::quant_units, ecat7_polmapheader::r_wave_offset, ecat7_polmapheader::ring_angle, ecat7_polmapheader::ring_position, ecat7_polmapheader::scale_factor, ecat7_polmapheader::sectors_per_ring, and ecat7_polmapheader::start_angle.
Referenced by ecat7PrintSubheader(), and ecat7ReadPolarmapMatrix().
void ecat7PrintScanheader | ( | ECAT7_scanheader * | h, |
FILE * | fp | ||
) |
Print ECAT 7.x 3D sinogram header contents to specified file pointer
h | Ecat7 scan header |
fp | target file pointer |
Definition at line 215 of file ecat7p.c.
References ecat7_scanheader::axial_compression, ecat7_scanheader::corrections_applied, ecat7_scanheader::data_type, ecat7_scanheader::deadtime_correction_factor, ecat7_scanheader::delayed, ECAT7_TEST, ecat7datatype(), ecat7_scanheader::frame_duration, ecat7_scanheader::frame_start_time, ecat7_scanheader::gate_duration, ecat7_scanheader::multiples, ecat7_scanheader::net_trues, ecat7_scanheader::num_accepted_beats, ecat7_scanheader::num_angles, ecat7_scanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::prompts, ecat7_scanheader::r_wave_offset, ecat7_scanheader::ring_difference, ecat7_scanheader::scale_factor, ecat7_scanheader::scan_max, ecat7_scanheader::scan_min, ecat7_scanheader::storage_order, ecat7_scanheader::tot_avg_cor, ecat7_scanheader::tot_avg_uncor, ecat7_scanheader::total_coin_rate, ecat7_scanheader::uncor_singles, ecat7_scanheader::v_resolution, ecat7_scanheader::w_resolution, ecat7_scanheader::x_resolution, and ecat7_scanheader::z_resolution.
Referenced by ecat7PrintSubheader(), and ecat7ReadScanMatrix().
int ecat7PrintSubheader | ( | ECAT7_mainheader | mh, |
FILE * | fp, | ||
int | plane, | ||
int | frame, | ||
FILE * | ofp | ||
) |
Print ECAT7 subheader contents into specified file pointer.
mh | ECAT7 mainheader (not printed but needed here) |
fp | File pointer to ECAT7 file |
plane | ECAT7 plane |
frame | ECAT7 frame |
ofp | Output is written to this file pointer; it can be stdout |
Definition at line 532 of file ecat7p.c.
References ECAT7_Matval::bed, ECAT7_2DNORM, ECAT7_2DSCAN, ECAT7_3DNORM, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ECAT7_ATTEN, ecat7_id_to_val(), ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_TEST, ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7EmptyMatlist(), ecat7InitMatlist(), ecat7Print2DNormheader(), ecat7Print2DScanheader(), ecat7PrintAttenheader(), ecat7PrintImageheader(), ecat7PrintMatlist(), ecat7PrintNormheader(), ecat7PrintPolmapheader(), ecat7PrintScanheader(), ecat7Read2DNormheader(), ecat7Read2DScanheader(), ecat7ReadAttenheader(), ecat7ReadImageheader(), ecat7ReadMatlist(), ecat7ReadNormheader(), ecat7ReadPolmapheader(), ecat7ReadScanheader(), ecat7_mainheader::file_type, ECAT7_Matval::frame, ECAT7_Matval::gate, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, ECAT7_Matval::plane, and ECAT7_MatDir::strtblk.
int ecat7pxlbytes | ( | short int | data_type | ) |
Returns the nr of bytes required for storage of one pixel of specified data_type
data_type | defined value for data type |
Definition at line 1055 of file ecat7r.c.
References ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_VAXI2, ECAT7_VAXI4, and ECAT7_VAXR4.
Referenced by ecat7ReadScanMatrix(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), and ecat7WriteScanMatrix().
int ecat7Read2DNormheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_2Dnormheader * | h | ||
) |
Read ECAT 7.x 2D normalization header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 normalization header |
Definition at line 546 of file ecat7r.c.
References ecat7_2Dnormheader::data_type, ECAT7_TEST, ecat7_2Dnormheader::fill_cti, ecat7_2Dnormheader::fill_user, ecat7_2Dnormheader::fov_source_width, MatBLKSIZE, ecat7_2Dnormheader::norm_max, ecat7_2Dnormheader::norm_min, ecat7_2Dnormheader::norm_quality_factor, ecat7_2Dnormheader::norm_quality_factor_code, ecat7_2Dnormheader::num_angles, ecat7_2Dnormheader::num_dimensions, ecat7_2Dnormheader::num_r_elements, ecat7_2Dnormheader::num_z_elements, ecat7_2Dnormheader::ring_difference, ecat7_2Dnormheader::scale_factor, ecat7_2Dnormheader::span, and ecat7_2Dnormheader::storage_order.
Referenced by ecat7PrintSubheader().
int ecat7Read2DScanheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_2Dscanheader * | h | ||
) |
Read ECAT 7.x 2D scan header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 2D scan header |
Definition at line 485 of file ecat7r.c.
References ecat7_2Dscanheader::cor_singles, ecat7_2Dscanheader::corrections_applied, ecat7_2Dscanheader::data_type, ecat7_2Dscanheader::deadtime_correction_factor, ecat7_2Dscanheader::delayed, ECAT7_TEST, ecat7_2Dscanheader::fill_cti, ecat7_2Dscanheader::fill_gate, ecat7_2Dscanheader::fill_user, ecat7_2Dscanheader::frame_duration, ecat7_2Dscanheader::frame_start_time, ecat7_2Dscanheader::gate_duration, MatBLKSIZE, ecat7_2Dscanheader::multiples, ecat7_2Dscanheader::net_trues, ecat7_2Dscanheader::num_accepted_beats, ecat7_2Dscanheader::num_angles, ecat7_2Dscanheader::num_dimensions, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, ecat7_2Dscanheader::physical_planes, ecat7_2Dscanheader::prompts, ecat7_2Dscanheader::r_wave_offset, ecat7_2Dscanheader::ring_difference, ecat7_2Dscanheader::scale_factor, ecat7_2Dscanheader::scan_max, ecat7_2Dscanheader::scan_min, ecat7_2Dscanheader::tot_avg_cor, ecat7_2Dscanheader::tot_avg_uncor, ecat7_2Dscanheader::total_coin_rate, ecat7_2Dscanheader::uncor_singles, ecat7_2Dscanheader::w_resolution, ecat7_2Dscanheader::x_resolution, ecat7_2Dscanheader::y_resolution, and ecat7_2Dscanheader::z_resolution.
Referenced by ecat7PrintSubheader(), ecat7Read2DScanMatrix(), imgReadEcat7(), and imgReadEcat7Header().
int ecat7Read2DScanMatrix | ( | FILE * | fp, |
int | first_block, | ||
int | last_block, | ||
ECAT7_2Dscanheader * | h, | ||
float ** | fdata | ||
) |
Read ECAT7 2D sinogram matrix header and data Memory for fdata[] is allocated here, remember to free memory after usage. Note: data is not calibrated with factor in main header. Note: data is not multiplied with deadtime_correction_factor.
fp | ECAT file pointer |
first_block | Subheader record number |
last_block | Last data block number |
h | Ptr to subheader data which is filled |
fdata | Ptr to the address of the matrix data |
Definition at line 749 of file ecat7r.c.
References ecat7_2Dscanheader::data_type, ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7errmsg, ecat7Print2DScanheader(), ecat7Read2DScanheader(), ecat7ReadMatrixdata(), MatBLKSIZE, MatFirstDirBlk, ecat7_2Dscanheader::num_angles, ecat7_2Dscanheader::num_dimensions, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, and ecat7_2Dscanheader::scale_factor.
Referenced by imgReadEcat7(), and imgReadEcat7Frame().
int ecat7ReadAttenheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_attenheader * | h | ||
) |
Read ECAT 7.x attenuation header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 attenuation header |
Definition at line 268 of file ecat7r.c.
References ecat7_attenheader::additional_atten_coeff, ecat7_attenheader::attenuation_coeff, ecat7_attenheader::attenuation_max, ecat7_attenheader::attenuation_min, ecat7_attenheader::attenuation_type, ecat7_attenheader::data_type, ECAT7_TEST, ecat7_attenheader::edge_finding_threshold, ecat7_attenheader::fill_cti, ecat7_attenheader::fill_user, MatBLKSIZE, ecat7_attenheader::num_additional_atten_coeff, ecat7_attenheader::num_angles, ecat7_attenheader::num_dimensions, ecat7_attenheader::num_r_elements, ecat7_attenheader::num_z_elements, ecat7_attenheader::ring_difference, ecat7_attenheader::scale_factor, ecat7_attenheader::skull_thickness, ecat7_attenheader::span, ecat7_attenheader::storage_order, ecat7_attenheader::tilt_angle, ecat7_attenheader::w_resolution, ecat7_attenheader::x_offset, ecat7_attenheader::x_radius, ecat7_attenheader::x_resolution, ecat7_attenheader::y_offset, ecat7_attenheader::y_radius, ecat7_attenheader::y_resolution, ecat7_attenheader::z_elements, and ecat7_attenheader::z_resolution.
Referenced by ecat7PrintSubheader().
int ecat7ReadImageheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_imageheader * | h | ||
) |
Read ECAT 7.x image header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 image header |
Definition at line 177 of file ecat7r.c.
References ecat7_imageheader::annotation, ecat7_imageheader::data_type, ecat7_imageheader::decay_corr_fctr, ECAT7_TEST, ecat7_imageheader::fill_cti, ecat7_imageheader::fill_user, ecat7_imageheader::filter_code, ecat7_imageheader::filter_cutoff_frequency, ecat7_imageheader::filter_order, ecat7_imageheader::filter_ramp_slope, ecat7_imageheader::filter_resolution, ecat7_imageheader::filter_scatter_fraction, ecat7_imageheader::filter_scatter_slope, ecat7_imageheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_imageheader::gate_duration, ecat7_imageheader::image_max, ecat7_imageheader::image_min, MatBLKSIZE, ecat7_imageheader::mt_1_1, ecat7_imageheader::mt_1_2, ecat7_imageheader::mt_1_3, ecat7_imageheader::mt_1_4, ecat7_imageheader::mt_2_1, ecat7_imageheader::mt_2_2, ecat7_imageheader::mt_2_3, ecat7_imageheader::mt_2_4, ecat7_imageheader::mt_3_1, ecat7_imageheader::mt_3_2, ecat7_imageheader::mt_3_3, ecat7_imageheader::mt_3_4, ecat7_imageheader::num_accepted_beats, ecat7_imageheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_imageheader::num_r_elements, ecat7_imageheader::processing_code, ecat7_imageheader::r_wave_offset, ecat7_imageheader::recon_type, ecat7_imageheader::recon_views, ecat7_imageheader::recon_zoom, ecat7_imageheader::rfilter_code, ecat7_imageheader::rfilter_cutoff, ecat7_imageheader::rfilter_order, ecat7_imageheader::rfilter_resolution, ecat7_imageheader::scale_factor, ecat7_imageheader::scatter_type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_offset, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_offset, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_offset, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, ecat7_imageheader::z_rotation_angle, ecat7_imageheader::zfilter_code, ecat7_imageheader::zfilter_cutoff, ecat7_imageheader::zfilter_order, and ecat7_imageheader::zfilter_resolution.
Referenced by ecat7GetNums(), ecat7PrintSubheader(), ecat7ReadImageMatrix(), imgReadEcat7(), and imgReadEcat7Header().
int ecat7ReadImageMatrix | ( | FILE * | fp, |
int | first_block, | ||
int | last_block, | ||
ECAT7_imageheader * | h, | ||
float ** | fdata | ||
) |
Read ECAT7 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.
fp | ECAT file pointer |
first_block | Subheader record number |
last_block | Last data block number |
h | Ptr to subheader data which is filled |
fdata | Ptr to the address of the matrix data |
Definition at line 656 of file ecat7r.c.
References ecat7_imageheader::data_type, ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7errmsg, ecat7PrintImageheader(), ecat7ReadImageheader(), ecat7ReadMatrixdata(), MatBLKSIZE, MatFirstDirBlk, ecat7_imageheader::num_dimensions, ecat7_imageheader::scale_factor, ecat7_imageheader::x_dimension, ecat7_imageheader::y_dimension, and ecat7_imageheader::z_dimension.
Referenced by imgReadEcat7(), and imgReadEcat7Frame().
int ecat7ReadMainheader | ( | FILE * | fp, |
ECAT7_mainheader * | h | ||
) |
Read ECAT 7.x main header
fp | input file pointer |
h | Ecat7 main header |
Definition at line 78 of file ecat7r.c.
References ecat7_mainheader::acquisition_mode, ecat7_mainheader::acquisition_type, ecat7_mainheader::angular_compression, ecat7_mainheader::axial_samp_mode, ecat7_mainheader::bed_elevation, ecat7_mainheader::bed_position, ecat7_mainheader::bin_size, ecat7_mainheader::branching_fraction, ecat7_mainheader::calibration_units, ecat7_mainheader::calibration_units_label, ecat7_mainheader::coin_samp_mode, ecat7_mainheader::compression_code, ecat7_mainheader::data_units, ecat7_mainheader::distance_scanned, ecat7_mainheader::dosage, ecat7_mainheader::dose_start_time, ECAT7_TEST, ecat7_mainheader::ecat_calibration_factor, ecat7_mainheader::facility_name, ecat7_mainheader::file_type, ecat7_mainheader::fill_cti, ecat7_mainheader::gantry_rotation, ecat7_mainheader::gantry_tilt, ecat7_mainheader::init_bed_position, ecat7_mainheader::intrinsic_tilt, ecat7_mainheader::isotope_halflife, ecat7_mainheader::isotope_name, ecat7_mainheader::lwr_sctr_thres, ecat7_mainheader::lwr_true_thres, ecat7_mainheader::magic_number, MatBLKSIZE, ecat7_mainheader::num_bed_pos, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_mainheader::num_planes, ecat7_mainheader::operator_name, ecat7_mainheader::original_file_name, ecat7_mainheader::patient_age, ecat7_mainheader::patient_birth_date, ecat7_mainheader::patient_dexterity, ecat7_mainheader::patient_height, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, ecat7_mainheader::patient_sex, ecat7_mainheader::patient_weight, ecat7_mainheader::physician_name, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, ecat7_mainheader::scan_start_time, ecat7_mainheader::septa_state, ecat7_mainheader::serial_number, ecat7_mainheader::study_description, ecat7_mainheader::study_type, ecat7_mainheader::sw_version, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, ecat7_mainheader::transm_source_type, ecat7_mainheader::upr_true_thres, ecat7_mainheader::user_process_code, ecat7_mainheader::well_counter_corr_factor, and ecat7_mainheader::wobble_speed.
Referenced by imgRead(), imgReadEcat7(), imgReadEcat7Frame(), imgReadEcat7Header(), and imgWriteEcat7Frame().
int ecat7ReadMatlist | ( | FILE * | fp, |
ECAT7_MATRIXLIST * | ml | ||
) |
Read ECAT matrix list. Matrix list must be initiated (once) before calling this.
fp | file pointer |
ml | matrix list structure for Ecat7 |
Definition at line 86 of file ecat7ml.c.
References ECAT7_TEST, ecat7EmptyMatlist(), ECAT7_MatDir::endblk, ECAT7_MatDir::id, MatBLKSIZE, ECAT7_MATRIXLIST::matdir, MatFirstDirBlk, ECAT7_MATRIXLIST::matrixNr, ECAT7_MATRIXLIST::matrixSpace, ECAT7_MatDir::status, and ECAT7_MatDir::strtblk.
Referenced by ecat7PrintSubheader(), imgReadEcat7(), imgReadEcat7Frame(), and imgReadEcat7Header().
int ecat7ReadMatrixdata | ( | FILE * | fp, |
int | start_block, | ||
int | block_nr, | ||
char * | data, | ||
int | dtype | ||
) |
Read ECAT7 matrix data and convert byte order if necessary Remember to allocate memory for full blocks! There are differences here when compared to ecat63.c
fp | input file pointer |
start_block | starting block index |
block_nr | number of blocks to be read |
data | target buffer |
dtype | data type of target buffer |
Definition at line 595 of file ecat7r.c.
References ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7rFloat(), ecat7rInt(), and MatBLKSIZE.
Referenced by ecat7Read2DScanMatrix(), ecat7ReadImageMatrix(), ecat7ReadPolarmapMatrix(), and ecat7ReadScanMatrix().
int ecat7ReadNormheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_normheader * | h | ||
) |
Read ECAT 7.x 3D normalization header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 normalization header |
Definition at line 378 of file ecat7r.c.
References ecat7_normheader::crystal_dtcor, ecat7_normheader::crystals_per_ring, ecat7_normheader::data_type, ECAT7_TEST, ecat7_normheader::fill_cti, ecat7_normheader::fill_user, ecat7_normheader::lld, MatBLKSIZE, ecat7_normheader::max_ring_diff, ecat7_normheader::norm_quality_factor, ecat7_normheader::norm_quality_factor_code, ecat7_normheader::num_crystal_rings, ecat7_normheader::num_geo_corr_planes, ecat7_normheader::num_r_elements, ecat7_normheader::num_transaxial_crystals, ecat7_normheader::ring_dtcor1, ecat7_normheader::ring_dtcor2, ecat7_normheader::scatter_energy, ecat7_normheader::span, and ecat7_normheader::uld.
Referenced by ecat7PrintSubheader().
int ecat7ReadPolarmapMatrix | ( | FILE * | fp, |
int | first_block, | ||
int | last_block, | ||
ECAT7_polmapheader * | h, | ||
float ** | fdata | ||
) |
Read ECAT7 polar map 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.
fp | ECAT file pointer |
first_block | Subheader record number |
last_block | Last data block number |
h | Ptr to subheader data which is filled |
fdata | Ptr to the address of the matrix data |
Definition at line 939 of file ecat7r.c.
References ecat7_polmapheader::data_type, ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7errmsg, ecat7PrintPolmapheader(), ecat7ReadMatrixdata(), ecat7ReadPolmapheader(), MatBLKSIZE, MatFirstDirBlk, ecat7_polmapheader::num_rings, ecat7_polmapheader::scale_factor, and ecat7_polmapheader::sectors_per_ring.
Referenced by imgReadEcat7(), and imgReadEcat7Frame().
int ecat7ReadPolmapheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_polmapheader * | h | ||
) |
Read ECAT 7.x polar map header
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 polar map header |
Definition at line 325 of file ecat7r.c.
References ecat7_polmapheader::annotation, ecat7_polmapheader::data_type, ecat7_polmapheader::database_name, ECAT7_TEST, ecat7_polmapheader::fill_cti, ecat7_polmapheader::frame_duration, ecat7_polmapheader::frame_start_time, ecat7_polmapheader::gate_duration, ecat7_polmapheader::image_max, ecat7_polmapheader::image_min, ecat7_polmapheader::long_axis_left, ecat7_polmapheader::long_axis_right, MatBLKSIZE, ecat7_polmapheader::num_accepted_beats, ecat7_polmapheader::num_rings, ecat7_polmapheader::pixel_size, ecat7_polmapheader::polar_map_protocol, ecat7_polmapheader::polar_map_type, ecat7_polmapheader::position_data, ecat7_polmapheader::processing_code, ecat7_polmapheader::quant_units, ecat7_polmapheader::r_wave_offset, ecat7_polmapheader::ring_angle, ecat7_polmapheader::ring_position, ecat7_polmapheader::scale_factor, ecat7_polmapheader::sectors_per_ring, and ecat7_polmapheader::start_angle.
Referenced by ecat7PrintSubheader(), ecat7ReadPolarmapMatrix(), imgReadEcat7(), and imgReadEcat7Header().
int ecat7ReadScanheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_scanheader * | h | ||
) |
Read ECAT 7.x 3D scan header (512 bytes)
fp | input file pointer |
blk | block number [1..number of blocks] |
h | Ecat7 scan header |
Definition at line 424 of file ecat7r.c.
References ecat7_scanheader::axial_compression, ecat7_scanheader::corrections_applied, ecat7_scanheader::data_type, ecat7_scanheader::deadtime_correction_factor, ecat7_scanheader::delayed, ECAT7_TEST, ecat7_scanheader::fill_cti, ecat7_scanheader::fill_gate, ecat7_scanheader::fill_user, ecat7_scanheader::frame_duration, ecat7_scanheader::frame_start_time, ecat7_scanheader::gate_duration, MatBLKSIZE, ecat7_scanheader::multiples, ecat7_scanheader::net_trues, ecat7_scanheader::num_accepted_beats, ecat7_scanheader::num_angles, ecat7_scanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::prompts, ecat7_scanheader::r_wave_offset, ecat7_scanheader::ring_difference, ecat7_scanheader::scale_factor, ecat7_scanheader::scan_max, ecat7_scanheader::scan_min, ecat7_scanheader::storage_order, ecat7_scanheader::tot_avg_cor, ecat7_scanheader::tot_avg_uncor, ecat7_scanheader::total_coin_rate, ecat7_scanheader::uncor_singles, ecat7_scanheader::v_resolution, ecat7_scanheader::w_resolution, ecat7_scanheader::x_resolution, and ecat7_scanheader::z_resolution.
Referenced by ecat7GetNums(), ecat7PrintSubheader(), ecat7ReadScanMatrix(), imgReadEcat7(), and imgReadEcat7Header().
int ecat7ReadScanMatrix | ( | FILE * | fp, |
int | first_block, | ||
int | last_block, | ||
ECAT7_scanheader * | h, | ||
float ** | fdata | ||
) |
Read ECAT7 3D sinogram matrix header and data. Memory for fdata[] is allocated here, remember to free memory after usage. Note: data is converted to floats with scale_factor in the scan matrix header. Note: data is not calibrated with ecat_calibration_factor in main header. Note: data is not multiplied with deadtime_correction_factor.
fp | ECAT file pointer |
first_block | Subheader record number |
last_block | Last data block number |
h | Ptr to subheader data which is filled |
fdata | Ptr to the address of the matrix data |
Definition at line 844 of file ecat7r.c.
References ecat7_scanheader::data_type, ECAT7_BYTE, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7errmsg, ecat7PrintScanheader(), ecat7pxlbytes(), ecat7ReadMatrixdata(), ecat7ReadScanheader(), MatBLKSIZE, MatFirstDirBlk, ecat7_scanheader::num_angles, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, and ecat7_scanheader::scale_factor.
Referenced by imgReadEcat7(), and imgReadEcat7Frame().
float ecat7rFloat | ( | void * | bufi, |
int | isvax, | ||
int | islittle | ||
) |
Read ECAT7 floats
bufi | pointer to 32-bit data block |
isvax | != 0 for VAX format |
islittle | != 0 for little endian conversion |
Definition at line 1015 of file ecat7r.c.
Referenced by ecat7ReadMatrixdata().
int ecat7rInt | ( | void * | bufi, |
int | isvax, | ||
int | islittle | ||
) |
Reading and writing ECAT7 32-bit ints 32-bit int format is same in VAX and i386
bufi | pointer to one 32-bit data block |
isvax | ignored |
islittle | != 0 for little endian conversion |
Definition at line 1038 of file ecat7r.c.
Referenced by ecat7ReadMatrixdata().
void ecat7SortMatlistByFrame | ( | ECAT7_MATRIXLIST * | ml | ) |
Sort matrixlist by frame and plane. Bubble sorting algorithm.
ml | target matrix list |
Definition at line 340 of file ecat7ml.c.
References ecat7_id_to_val(), ECAT7_Matval::frame, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_Matval::plane.
Referenced by imgReadEcat7Frame().
void ecat7SortMatlistByPlane | ( | ECAT7_MATRIXLIST * | ml | ) |
Sort matrixlist by plane and frame. Bubble sorting algorithm.
ml | target matrix list |
Definition at line 314 of file ecat7ml.c.
References ecat7_id_to_val(), ECAT7_Matval::frame, ECAT7_MatDir::id, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, and ECAT7_Matval::plane.
Referenced by ecat7GetPlaneAndFrameNr(), and imgReadEcat7().
int ecat7Write2DNormheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_2Dnormheader * | h | ||
) |
Write ECAT 7.x 2D normalization header.
fp | file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 2D normalization header |
Definition at line 566 of file ecat7w.c.
References ecat7_2Dnormheader::data_type, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_2Dnormheader::fill_cti, ecat7_2Dnormheader::fill_user, ecat7_2Dnormheader::fov_source_width, MatBLKSIZE, ecat7_2Dnormheader::norm_max, ecat7_2Dnormheader::norm_min, ecat7_2Dnormheader::norm_quality_factor, ecat7_2Dnormheader::norm_quality_factor_code, ecat7_2Dnormheader::num_angles, ecat7_2Dnormheader::num_dimensions, ecat7_2Dnormheader::num_r_elements, ecat7_2Dnormheader::num_z_elements, ecat7_2Dnormheader::ring_difference, ecat7_2Dnormheader::scale_factor, ecat7_2Dnormheader::span, and ecat7_2Dnormheader::storage_order.
int ecat7Write2DScanheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_2Dscanheader * | h | ||
) |
Write ECAT 7.x 2D scan header
fp | output file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 2D scan header |
Definition at line 499 of file ecat7w.c.
References ecat7_2Dscanheader::cor_singles, ecat7_2Dscanheader::corrections_applied, ecat7_2Dscanheader::data_type, ecat7_2Dscanheader::deadtime_correction_factor, ecat7_2Dscanheader::delayed, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_2Dscanheader::fill_cti, ecat7_2Dscanheader::fill_gate, ecat7_2Dscanheader::fill_user, ecat7_2Dscanheader::frame_duration, ecat7_2Dscanheader::frame_start_time, ecat7_2Dscanheader::gate_duration, MatBLKSIZE, ecat7_2Dscanheader::multiples, ecat7_2Dscanheader::net_trues, ecat7_2Dscanheader::num_accepted_beats, ecat7_2Dscanheader::num_angles, ecat7_2Dscanheader::num_dimensions, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, ecat7_2Dscanheader::physical_planes, ecat7_2Dscanheader::prompts, ecat7_2Dscanheader::r_wave_offset, ecat7_2Dscanheader::ring_difference, ecat7_2Dscanheader::scale_factor, ecat7_2Dscanheader::scan_max, ecat7_2Dscanheader::scan_min, ecat7_2Dscanheader::tot_avg_cor, ecat7_2Dscanheader::tot_avg_uncor, ecat7_2Dscanheader::total_coin_rate, ecat7_2Dscanheader::uncor_singles, ecat7_2Dscanheader::w_resolution, ecat7_2Dscanheader::x_resolution, ecat7_2Dscanheader::y_resolution, and ecat7_2Dscanheader::z_resolution.
Referenced by ecat7Write2DScanMatrix().
int ecat7Write2DScanMatrix | ( | FILE * | fp, |
int | matrix_id, | ||
ECAT7_2Dscanheader * | h, | ||
float * | fdata | ||
) |
Write ECAT 7.x 2D sinogram matrix header and data
fp | output file pointer |
matrix_id | coded matrix id |
h | Ecat7 2D image scan header |
fdata | float data to be written |
Definition at line 767 of file ecat7w.c.
References ecat7_2Dscanheader::data_type, ecat7_is_scaling_needed(), ECAT7_SUNI2, ECAT7_TEST, ecat7EnterMatrix(), ecat7errmsg, ecat7pxlbytes(), ecat7Write2DScanheader(), ecat7WriteMatrixdata(), MatBLKSIZE, ecat7_2Dscanheader::num_angles, ecat7_2Dscanheader::num_dimensions, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, ecat7_2Dscanheader::scale_factor, ecat7_2Dscanheader::scan_max, and ecat7_2Dscanheader::scan_min.
Referenced by imgWrite2DEcat7(), and imgWriteEcat7Frame().
int ecat7WriteAttenheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_attenheader * | h | ||
) |
Write ECAT 7.x attenuation header
fp | output file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 attenuation header |
Definition at line 258 of file ecat7w.c.
References ecat7_attenheader::additional_atten_coeff, ecat7_attenheader::attenuation_coeff, ecat7_attenheader::attenuation_max, ecat7_attenheader::attenuation_min, ecat7_attenheader::attenuation_type, ecat7_attenheader::data_type, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_attenheader::edge_finding_threshold, ecat7_attenheader::fill_cti, ecat7_attenheader::fill_user, MatBLKSIZE, ecat7_attenheader::num_additional_atten_coeff, ecat7_attenheader::num_angles, ecat7_attenheader::num_dimensions, ecat7_attenheader::num_r_elements, ecat7_attenheader::num_z_elements, ecat7_attenheader::ring_difference, ecat7_attenheader::scale_factor, ecat7_attenheader::skull_thickness, ecat7_attenheader::span, ecat7_attenheader::storage_order, ecat7_attenheader::tilt_angle, ecat7_attenheader::w_resolution, ecat7_attenheader::x_offset, ecat7_attenheader::x_radius, ecat7_attenheader::x_resolution, ecat7_attenheader::y_offset, ecat7_attenheader::y_radius, ecat7_attenheader::y_resolution, ecat7_attenheader::z_elements, and ecat7_attenheader::z_resolution.
int ecat7WriteImageheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_imageheader * | h | ||
) |
Write ECAT 7.x image header. Changes data type to big endian.
fp | output file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 image header |
Definition at line 164 of file ecat7w.c.
References ecat7_imageheader::annotation, ecat7_imageheader::data_type, ecat7_imageheader::decay_corr_fctr, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_imageheader::fill_cti, ecat7_imageheader::fill_user, ecat7_imageheader::filter_code, ecat7_imageheader::filter_cutoff_frequency, ecat7_imageheader::filter_order, ecat7_imageheader::filter_ramp_slope, ecat7_imageheader::filter_resolution, ecat7_imageheader::filter_scatter_fraction, ecat7_imageheader::filter_scatter_slope, ecat7_imageheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_imageheader::gate_duration, ecat7_imageheader::image_max, ecat7_imageheader::image_min, MatBLKSIZE, ecat7_imageheader::mt_1_1, ecat7_imageheader::mt_1_2, ecat7_imageheader::mt_1_3, ecat7_imageheader::mt_1_4, ecat7_imageheader::mt_2_1, ecat7_imageheader::mt_2_2, ecat7_imageheader::mt_2_3, ecat7_imageheader::mt_2_4, ecat7_imageheader::mt_3_1, ecat7_imageheader::mt_3_2, ecat7_imageheader::mt_3_3, ecat7_imageheader::mt_3_4, ecat7_imageheader::num_accepted_beats, ecat7_imageheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_imageheader::num_r_elements, ecat7_imageheader::processing_code, ecat7_imageheader::r_wave_offset, ecat7_imageheader::recon_type, ecat7_imageheader::recon_views, ecat7_imageheader::recon_zoom, ecat7_imageheader::rfilter_code, ecat7_imageheader::rfilter_cutoff, ecat7_imageheader::rfilter_order, ecat7_imageheader::rfilter_resolution, ecat7_imageheader::scale_factor, ecat7_imageheader::scatter_type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_offset, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_offset, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_offset, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, ecat7_imageheader::z_rotation_angle, ecat7_imageheader::zfilter_code, ecat7_imageheader::zfilter_cutoff, ecat7_imageheader::zfilter_order, and ecat7_imageheader::zfilter_resolution.
Referenced by ecat7WriteImageMatrix().
int ecat7WriteImageMatrix | ( | FILE * | fp, |
int | matrix_id, | ||
ECAT7_imageheader * | h, | ||
float * | fdata | ||
) |
Write ECAT 7.x image or volume matrix header and data
fp | output file pointer |
matrix_id | coded matrix id |
h | Ecat7 image header |
fdata | float data to be written |
Definition at line 682 of file ecat7w.c.
References ecat7_imageheader::data_type, ecat7_is_scaling_needed(), ECAT7_SUNI2, ECAT7_TEST, ecat7EnterMatrix(), ecat7errmsg, ecat7pxlbytes(), ecat7WriteImageheader(), ecat7WriteMatrixdata(), ecat7_imageheader::image_max, ecat7_imageheader::image_min, MatBLKSIZE, ecat7_imageheader::num_dimensions, ecat7_imageheader::scale_factor, ecat7_imageheader::x_dimension, ecat7_imageheader::y_dimension, and ecat7_imageheader::z_dimension.
Referenced by imgWrite2DEcat7(), imgWriteEcat7(), and imgWriteEcat7Frame().
int ecat7WriteMainheader | ( | FILE * | fp, |
ECAT7_mainheader * | h | ||
) |
Write ECAT 7.x main header.
fp | output file pointer |
h | Ecat7 main header Writes header always in big endian byte order. |
Definition at line 73 of file ecat7w.c.
References ecat7_mainheader::acquisition_mode, ecat7_mainheader::acquisition_type, ecat7_mainheader::angular_compression, ecat7_mainheader::axial_samp_mode, ecat7_mainheader::bed_elevation, ecat7_mainheader::bed_position, ecat7_mainheader::bin_size, ecat7_mainheader::branching_fraction, ecat7_mainheader::calibration_units, ecat7_mainheader::calibration_units_label, ecat7_mainheader::coin_samp_mode, ecat7_mainheader::compression_code, ecat7_mainheader::data_units, ecat7_mainheader::distance_scanned, ecat7_mainheader::dosage, ecat7_mainheader::dose_start_time, ECAT7_TEST, ecat7_mainheader::ecat_calibration_factor, ecat7_mainheader::facility_name, ecat7_mainheader::file_type, ecat7_mainheader::fill_cti, ecat7_mainheader::gantry_rotation, ecat7_mainheader::gantry_tilt, ecat7_mainheader::init_bed_position, ecat7_mainheader::intrinsic_tilt, ecat7_mainheader::isotope_halflife, ecat7_mainheader::isotope_name, ecat7_mainheader::lwr_sctr_thres, ecat7_mainheader::lwr_true_thres, ecat7_mainheader::magic_number, MatBLKSIZE, ecat7_mainheader::num_bed_pos, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_mainheader::num_planes, ecat7_mainheader::operator_name, ecat7_mainheader::original_file_name, ecat7_mainheader::patient_age, ecat7_mainheader::patient_birth_date, ecat7_mainheader::patient_dexterity, ecat7_mainheader::patient_height, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, ecat7_mainheader::patient_sex, ecat7_mainheader::patient_weight, ecat7_mainheader::physician_name, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, ecat7_mainheader::scan_start_time, ecat7_mainheader::septa_state, ecat7_mainheader::serial_number, ecat7_mainheader::study_description, ecat7_mainheader::study_type, ecat7_mainheader::sw_version, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, ecat7_mainheader::transm_source_type, ecat7_mainheader::upr_true_thres, ecat7_mainheader::user_process_code, ecat7_mainheader::well_counter_corr_factor, and ecat7_mainheader::wobble_speed.
Referenced by ecat7Create(), and imgWriteEcat7Frame().
int ecat7WriteMatrixdata | ( | FILE * | fp, |
int | start_block, | ||
char * | data, | ||
int | pxl_nr, | ||
int | pxl_size | ||
) |
Write ECAT 7.x 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.
fp | Pointer to an opened ECAT file |
start_block | Block number where matrix data is written |
data | Pointer to matrix data |
pxl_nr | Number of pixels |
pxl_size | Size of data for one pixel in bytes |
Definition at line 1027 of file ecat7w.c.
References ECAT7_TEST, and MatBLKSIZE.
Referenced by ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), and ecat7WriteScanMatrix().
int ecat7WriteNormheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_normheader * | h | ||
) |
Write ECAT 7.x 3D normalization header
fp | output file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 normalization header |
Definition at line 380 of file ecat7w.c.
References ecat7_normheader::crystal_dtcor, ecat7_normheader::crystals_per_ring, ecat7_normheader::data_type, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_normheader::fill_cti, ecat7_normheader::fill_user, ecat7_normheader::lld, MatBLKSIZE, ecat7_normheader::max_ring_diff, ecat7_normheader::norm_quality_factor, ecat7_normheader::norm_quality_factor_code, ecat7_normheader::num_crystal_rings, ecat7_normheader::num_geo_corr_planes, ecat7_normheader::num_r_elements, ecat7_normheader::num_transaxial_crystals, ecat7_normheader::ring_dtcor1, ecat7_normheader::ring_dtcor2, ecat7_normheader::scatter_energy, ecat7_normheader::span, and ecat7_normheader::uld.
int ecat7WritePolarmapMatrix | ( | FILE * | fp, |
int | matrix_id, | ||
ECAT7_polmapheader * | h, | ||
float * | fdata | ||
) |
Write ECAT 7.x polarmap matrix header and data
fp | output file pointer |
matrix_id | coded matrix information |
h | Ecat7 polar map header |
fdata | float data |
Definition at line 939 of file ecat7w.c.
References ecat7_polmapheader::data_type, ecat7_is_scaling_needed(), ECAT7_SUNI2, ECAT7_TEST, ecat7EnterMatrix(), ecat7errmsg, ecat7pxlbytes(), ecat7WriteMatrixdata(), ecat7WritePolmapheader(), ecat7_polmapheader::image_max, ecat7_polmapheader::image_min, MatBLKSIZE, ecat7_polmapheader::num_rings, ecat7_polmapheader::scale_factor, and ecat7_polmapheader::sectors_per_ring.
Referenced by imgWriteEcat7Frame(), and imgWritePolarmap().
int ecat7WritePolmapheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_polmapheader * | h | ||
) |
Write ECAT 7.x polar map header
fp | output file pointer |
blk | header block number, blk >= 2 |
h | Ecat7 polar map header |
Definition at line 321 of file ecat7w.c.
References ecat7_polmapheader::annotation, ecat7_polmapheader::data_type, ecat7_polmapheader::database_name, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_polmapheader::fill_cti, ecat7_polmapheader::frame_duration, ecat7_polmapheader::frame_start_time, ecat7_polmapheader::gate_duration, ecat7_polmapheader::image_max, ecat7_polmapheader::image_min, ecat7_polmapheader::long_axis_left, ecat7_polmapheader::long_axis_right, MatBLKSIZE, ecat7_polmapheader::num_accepted_beats, ecat7_polmapheader::num_rings, ecat7_polmapheader::pixel_size, ecat7_polmapheader::polar_map_protocol, ecat7_polmapheader::polar_map_type, ecat7_polmapheader::position_data, ecat7_polmapheader::processing_code, ecat7_polmapheader::quant_units, ecat7_polmapheader::r_wave_offset, ecat7_polmapheader::ring_angle, ecat7_polmapheader::ring_position, ecat7_polmapheader::scale_factor, ecat7_polmapheader::sectors_per_ring, and ecat7_polmapheader::start_angle.
Referenced by ecat7WritePolarmapMatrix().
int ecat7WriteScanheader | ( | FILE * | fp, |
int | blk, | ||
ECAT7_scanheader * | h | ||
) |
Write ECAT 7.x 3D scan header (512 bytes) Changes data type to big endian.
fp | pointer to output file |
blk | block number, blk >= 2 |
h | Ecat7 scan header |
Definition at line 433 of file ecat7w.c.
References ecat7_scanheader::axial_compression, ecat7_scanheader::corrections_applied, ecat7_scanheader::data_type, ecat7_scanheader::deadtime_correction_factor, ecat7_scanheader::delayed, ECAT7_IEEER4, ECAT7_SUNI2, ECAT7_SUNI4, ECAT7_TEST, ECAT7_VAXI2, ECAT7_VAXI4, ECAT7_VAXR4, ecat7_scanheader::fill_cti, ecat7_scanheader::fill_gate, ecat7_scanheader::fill_user, ecat7_scanheader::frame_duration, ecat7_scanheader::frame_start_time, ecat7_scanheader::gate_duration, MatBLKSIZE, ecat7_scanheader::multiples, ecat7_scanheader::net_trues, ecat7_scanheader::num_accepted_beats, ecat7_scanheader::num_angles, ecat7_scanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::prompts, ecat7_scanheader::r_wave_offset, ecat7_scanheader::ring_difference, ecat7_scanheader::scale_factor, ecat7_scanheader::scan_max, ecat7_scanheader::scan_min, ecat7_scanheader::storage_order, ecat7_scanheader::tot_avg_cor, ecat7_scanheader::tot_avg_uncor, ecat7_scanheader::total_coin_rate, ecat7_scanheader::uncor_singles, ecat7_scanheader::v_resolution, ecat7_scanheader::w_resolution, ecat7_scanheader::x_resolution, and ecat7_scanheader::z_resolution.
Referenced by ecat7WriteScanMatrix().
int ecat7WriteScanMatrix | ( | FILE * | fp, |
int | matrix_id, | ||
ECAT7_scanheader * | h, | ||
float * | fdata | ||
) |
Write ECAT 7.x 3D sinogram matrix header and data
fp | output file pointer |
matrix_id | coded matrix id |
h | Ecat7 scan header |
fdata | float data |
Definition at line 852 of file ecat7w.c.
References ecat7_scanheader::data_type, ecat7_is_scaling_needed(), ECAT7_SUNI2, ECAT7_TEST, ecat7EnterMatrix(), ecat7errmsg, ecat7pxlbytes(), ecat7WriteMatrixdata(), ecat7WriteScanheader(), MatBLKSIZE, ecat7_scanheader::num_angles, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::scale_factor, ecat7_scanheader::scan_max, and ecat7_scanheader::scan_min.
Referenced by imgWriteEcat7(), and imgWriteEcat7Frame().
int ECAT7_TEST |
Definition at line 101 of file ecat7.h.
Referenced by ecat7Create(), ecat7EnterMatrix(), ecat7Print2DNormheader(), ecat7Print2DScanheader(), ecat7PrintAttenheader(), ecat7PrintImageheader(), ecat7PrintMainheader(), ecat7PrintNormheader(), ecat7PrintPolmapheader(), ecat7PrintScanheader(), ecat7PrintSubheader(), ecat7Read2DNormheader(), ecat7Read2DScanheader(), ecat7Read2DScanMatrix(), ecat7ReadAttenheader(), ecat7ReadImageheader(), ecat7ReadImageMatrix(), ecat7ReadMainheader(), ecat7ReadMatlist(), ecat7ReadMatrixdata(), ecat7ReadNormheader(), ecat7ReadPolarmapMatrix(), ecat7ReadPolmapheader(), ecat7ReadScanheader(), ecat7ReadScanMatrix(), ecat7Write2DNormheader(), ecat7Write2DScanheader(), ecat7Write2DScanMatrix(), ecat7WriteAttenheader(), ecat7WriteImageheader(), ecat7WriteImageMatrix(), ecat7WriteMainheader(), ecat7WriteMatrixdata(), ecat7WriteNormheader(), ecat7WritePolarmapMatrix(), ecat7WritePolmapheader(), ecat7WriteScanheader(), ecat7WriteScanMatrix(), imgWrite2DEcat7(), imgWriteEcat7(), and imgWritePolarmap().
char ecat7errmsg[128] |
Definition at line 99 of file ecat7.h.
Referenced by ecat7Read2DScanMatrix(), ecat7ReadImageMatrix(), ecat7ReadPolarmapMatrix(), ecat7ReadScanMatrix(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WritePolarmapMatrix(), ecat7WriteScanMatrix(), and imgReadEcat7().