34#include <netinet/in.h>
38#define MatFirstDirBlk 2
39#define MatMagic 0x67452301
44#define NumDataMasks 12
47#define MAX_SLICES 1024
160#define MAT_SUB_HEADER 255
566#if defined(sun) && !defined(__SVR4)
570#if !defined(OLD_C) || defined(__cplusplus)
571#if defined(__cplusplus)
577void SWAB(
const void *from,
void *to,
int len);
578void SWAW(
const short *from,
short *to,
int len);
587int matspec(
const char* specs,
char* fname ,
int* matnum);
597int mat_numcod(
int frame,
int plane,
int gate,
int data,
int bed);
645int mat_rblk(FILE *fptr,
int blkno,
char *bufr,
int nblks);
646int mat_wblk(FILE *fptr,
int blkno,
char *bufr,
int nblks);
647void swaw(
short *from,
short *to,
int length);
651#if defined(__cplusplus)
660extern FILE* mat_open();
int save_volume7(MatrixFile *mfile, Image_subheader *shptr, float *data_ptr, int frame, int gate, int data, int bed)
struct XMAIN_HEAD Main_header
int mat_write_main_header(FILE *fptr, Main_header *h)
int mat_lookup(FILE *fptr, Main_header *mhptr, int matnum, struct MatDir *entry)
int unmap_main_header(char *buf, Main_header *h)
float find_fmin(const float *, int size)
char * calstatus[NumCalibrationStatus]
int unmap64_main_header(char *buf, Main_header *h)
struct XIMAGE_SUB Image_subheader
struct matdirnode MatDirNode
int mat_read_image_subheader(FILE *, Main_header *, int blknum, Image_subheader *)
int unmap_norm_header(char *buf, Norm_subheader *)
MatrixErrorCode matrix_errno
int unmap_Scan3D_header(char *buf, Scan3D_subheader *)
struct XNORM_SUB Norm_subheader
int mat_write_Scan3D_subheader(FILE *, Main_header *, int blknum, Scan3D_subheader *)
int unmap_image_header(char *buf, Image_subheader *)
int mat_read_matrix_data(FILE *, Main_header *, int blk, int nblks, short *bufr)
int find_smax(const short *, int size)
MatrixData * matrix_read_view(MatrixFile *, MatrixData *volume, int view, int segment)
struct matrixdata MatrixData
struct matdirblk MatDirBlk
char * scantypecode[NumScanTypes]
struct XSCAN_SUB Scan_subheader
int map64_attn_header(char *buf, Attn_subheader *, Main_header *)
int unmap64_attn_header(char *buf, Attn_subheader *, Main_header *)
void SWAB(const void *from, void *to, int len)
struct X3DNORM_SUB Norm3D_subheader
int map64_image_header(char *buf, Image_subheader *, Main_header *)
int mat_read_main_header(FILE *fptr, Main_header *h)
void matrix_perror(const char *)
int unmap64_image_header(char *buf, Image_subheader *, Main_header *)
@ MAT_BAD_FILE_ACCESS_MODE
@ MAT_FILE_TYPE_NOT_MATCH
@ MAT_INVALID_MBED_POSITION
int find_imin(const int *, int size)
int mat_numcod(int frame, int plane, int gate, int data, int bed)
int map64_norm_header(char *buf, Norm_subheader *, Main_header *)
int mat_read_norm3d_subheader(FILE *, Main_header *, int blknum, Norm3D_subheader *)
struct matdir * mat_read_dir(FILE *, Main_header *, char *selector)
int mat_enter(FILE *, Main_header *mhptr, int matnum, int nblks)
int unmap_attn_header(char *buf, Attn_subheader *)
int unmap_scan_header(char *buf, Scan_subheader *)
void SWAW(const short *from, short *to, int len)
int mat_numdoc(int, struct Matval *)
struct matdirlist MatDirList
int find_bmax(const u_char *, int size)
int map64_main_header(char *buf, Main_header *h)
struct matrix_file MatrixFile
MatrixFile * matrix_create(const char *, int, Main_header *)
char * is_analyze(const char *)
MatrixData * matrix_read_slice(MatrixFile *, MatrixData *volume, int slice_num, int segment)
int mat_read_Scan3D_subheader(FILE *, Main_header *, int blknum, Scan3D_subheader *)
char * typeFilterLabel[NumDataMasks]
int map64_scan_header(char *buf, Scan_subheader *, Main_header *)
float ecfconverter[NumOldUnits]
void swaw(short *from, short *to, int length)
int mat_read_attn_subheader(FILE *, Main_header *, int blknum, Attn_subheader *)
MatrixData * load_volume7(MatrixFile *matrix_file, int frame, int gate, int data, int bedstart, int bedend)
int find_imax(const int *, int size)
float find_fmax(const float *, int size)
int matspec(const char *specs, char *fname, int *matnum)
int matrix_write(MatrixFile *, int matnum, MatrixData *)
int mat_read_norm_subheader(FILE *, Main_header *, int blknum, Norm_subheader *)
int unmap64_scan_header(char *buf, Scan_subheader *, Main_header *)
int unmap64_norm_header(char *buf, Norm_subheader *, Main_header *)
MatrixData * matrix_read(MatrixFile *, int matnum, int type)
char * datasettype[NumDataSetTypes]
int mat_wblk(FILE *fptr, int blkno, char *bufr, int nblks)
int mat_write_image_subheader(FILE *, Main_header *, int blknum, Image_subheader *)
int mat_rblk(FILE *fptr, int blkno, char *bufr, int nblks)
int unmap_norm3d_header(char *buf, Norm3D_subheader *)
void free_matrix_data(MatrixData *)
struct X3DSCAN_SUB Scan3D_subheader
int matrix_find(MatrixFile *, int matnum, struct MatDir *)
MatrixFile * matrix_open(const char *, int, int)
int insert_mdir(struct MatDir matdir, MatDirList *dirlist)
int mat_write_attn_subheader(FILE *, Main_header *, int blknum, Attn_subheader *)
char * customDisplayUnits[]
int mat_write_scan_subheader(FILE *, Main_header *, int blknum, Scan_subheader *)
struct XATTEN_SUB Attn_subheader
int matrix_close(MatrixFile *)
int mat_write_norm_subheader(FILE *, Main_header *, int blknum, Norm_subheader *)
int find_smin(const short *, int size)
FILE * mat_create(char *fname, Main_header *mhead)
char * scantype[NumScanTypes]
int mat_read_scan_subheader(FILE *, Main_header *, int blknum, Scan_subheader *)
char * dstypecode[NumDataSetTypes]
int find_bmin(const u_char *, int size)
short norm_quality_factor_code
float norm_quality_factor
short num_geo_corr_planes
short num_transaxial_crystals
short corrections_applied
unsigned int frame_start_time
float loss_correction_fctr
unsigned int gate_duration
unsigned int frame_duration
short num_additional_atten_coeff
float edge_finding_threshold
float additional_atten_coeff[8]
float filter_cutoff_frequency
unsigned int gate_duration
unsigned int frame_start_time
float filter_scatter_slope
unsigned int frame_duration
float filter_scatter_fraction
char user_process_code[10]
float well_counter_factor
char patient_dexterity[1]
char radiopharmaceutical[32]
unsigned int scan_start_time
short patient_orientation
short angular_compression
char original_file_name[32]
char study_description[32]
unsigned int dose_start_time
short calibration_units_label
float norm_quality_factor
short norm_quality_factor_code
unsigned int frame_duration
short corrections_applied
unsigned int gate_duration
unsigned int frame_start_time
float loss_correction_fctr