My Project
|
Go to the source code of this file.
Functions | |
int | imgRead (const char *fname, IMG *img) |
int | imgReadMainHeader (const char *fname, IMG *img) |
int | imgWrite (const char *fname, IMG *img) |
int | imgReadHeader (const char *fname, IMG *img) |
int | imgReadNextFrame (char *fname, IMG *img) |
int | imgReadFrame (const char *fname, int frame_to_read, IMG *img, int frame_index) |
int | imgWriteFrame (const char *fname, int frame_to_write, IMG *img, int frame_index) |
void | imgFormatFromFName (IMG *img, const char *fname) |
int | ecat63ReadAllToImg (const char *fname, IMG *img) |
int | ecat63WriteAllImg (const char *fname, IMG *img) |
int | ecat63ReadPlaneToImg (const char *fname, IMG *img) |
int | ecat63AddImg (const char *fname, IMG *img) |
void | imgGetEcat63MHeader (IMG *img, ECAT63_mainheader *h) |
void | imgSetEcat63MHeader (IMG *img, ECAT63_mainheader *h) |
int | imgEcat63Supported (ECAT63_mainheader *h) |
int | imgGetEcat63Fileformat (ECAT63_mainheader *h) |
int | imgReadEcat63Header (const char *fname, IMG *img) |
int | imgReadEcat63FirstFrame (const char *fname, IMG *img) |
int | imgReadEcat63Frame (const char *fname, int frame_to_read, IMG *img, int frame_index) |
int | imgWriteEcat63Frame (const char *fname, int frame_to_write, IMG *img, int frame_index) |
void | imgSetEcat63SHeader (IMG *img, void *h) |
int | imgReadEcat7 (const char *fname, IMG *img) |
int | imgWriteEcat7 (const char *fname, IMG *img) |
int | imgWrite2DEcat7 (const char *fname, IMG *img) |
int | imgWritePolarmap (const char *fname, IMG *img) |
void | imgGetEcat7MHeader (IMG *img, ECAT7_mainheader *h) |
void | imgSetEcat7MHeader (IMG *img, ECAT7_mainheader *h) |
int | imgReadEcat7Header (const char *fname, IMG *img) |
int | imgEcat7Supported (ECAT7_mainheader *h) |
int | imgReadEcat7Frame (const char *fname, int frame_to_read, IMG *img, int frame_index) |
int | imgReadEcat7FirstFrame (const char *fname, IMG *img) |
int | imgGetEcat7Fileformat (ECAT7_mainheader *h) |
int | imgWriteEcat7Frame (const char *fname, int frame_to_write, IMG *img, int frame_index) |
void | imgSetEcat7SHeader (IMG *img, void *h) |
int | imgReadAnalyze (const char *dbname, IMG *img) |
int | imgWriteAnalyze (const char *dbname, IMG *img) |
int | imgReadAnalyzeHeader (const char *dbname, IMG *img) |
int | imgGetAnalyzeHeader (IMG *img, ANALYZE_DSR *h) |
int | imgSetAnalyzeHeader (IMG *img, const char *dbname, ANALYZE_DSR *h, float fmin, float fmax) |
int | imgReadAnalyzeFrame (const char *dbname, int frame_to_read, IMG *img, int frame_index) |
int | imgReadAnalyzeFirstFrame (const char *fname, IMG *img) |
int | imgWriteAnalyzeFrame (const char *fname, int frame_to_write, IMG *img, int frame_index, float fmin, float fmax) |
int ecat63AddImg | ( | const char * | fname, |
IMG * | img | ||
) |
Adds all matrices in memory to the ECAT file. If ECAT file does not exist, it is created. Please note that existing ECAT file is NOT saved as fname%
fname | name of the output ECAT 6.3 file |
img | data structure from which the data is written |
Definition at line 886 of file img_e63.c.
References IMG::_dataType, ecat63_mainheader::axial_fov, IMG::axialFOV, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::data_type, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat63_scanheader::delayed, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT63_SYSTEM_TYPE_DEFAULT, ecat63Create(), ecat63EmptyMatlist(), ecat63errmsg, ecat63InitMatlist(), ecat63PrintMainheader(), ecat63ReadMainheader(), ecat63ReadMatlist(), ecat63WriteImage(), ecat63WriteMainheader(), ecat63WriteScan(), ecat63_imageheader::ecat_calibration_fctr, IMG::end, ecat63_mainheader::file_type, Matval::frame, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_scanheader::frame_duration_sec, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, IMAGE_DATA, ecat63_imageheader::image_max, ecat63_imageheader::image_min, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgInfo(), imgIsotope(), imgUnitToEcat6(), ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, ecat63_imageheader::loss_corr_fctr, ecat63_scanheader::loss_correction_fctr, IMG::m, mat_numcod(), mat_numdoc(), MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, ecat63_mainheader::num_bed_pos, ecat63_imageheader::num_dimensions, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_imageheader::pixel_size, Matval::plane, ecat63_imageheader::plane_eff_corr_fctr, ecat63_mainheader::plane_separation, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, IMG::randoms, RAW_DATA, ecat63_imageheader::recon_scale, ecat63_scanheader::sample_distance, IMG::sampleDistance, ecat63_scanheader::scale_factor, ecat63_scanheader::scan_max, ecat63_scanheader::scan_min, 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, IMG::scanner, IMG::scanStart, IMG::sizex, IMG::sizez, ecat63_imageheader::slice_width, IMG::start, IMG::status, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat63_mainheader::user_process_code, IMG::userProcessCode, VAX_I2, ecat63_imageheader::well_counter_cal_fctr, and IMG::zoom.
int ecat63ReadAllToImg | ( | const char * | fname, |
IMG * | img | ||
) |
Read all matrices in ECAT file to memory. Img data must be initialized before this procedure.
fname | name of the input ECAT 6.3 file |
img | data structure in which the file is read |
Definition at line 77 of file img_e63.c.
References IMG::_dataType, IMG::_fileFormat, ATTN_DATA, ecat63_mainheader::axial_fov, IMG::axialFOV, BYTE_TYPE, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_normheader::data_type, ecat63_attnheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat63_scanheader::delayed, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_normheader::dimension_1, ecat63_attnheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, ecat63_normheader::dimension_2, ecat63_attnheader::dimension_2, ecat63DeleteLateFrames(), ecat63EmptyMatlist(), ecat63errmsg, ecat63InitMatlist(), ecat63PrintMainheader(), ecat63PrintMatlist(), ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatdata(), ecat63ReadMatlist(), ecat63ReadNormheader(), ecat63ReadScanheader(), ecat63_imageheader::ecat_calibration_fctr, IMG::end, MatDir::endblk, ecat63_mainheader::file_type, Matval::frame, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, Matval::gate, IEEE_R4, IMAGE_DATA, IMG_E63, IMG_STATUS_INITIALIZED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgAllocate(), imgSetStatus(), imgUnitFromEcat(), ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, ecat63_scanheader::loss_correction_fctr, IMG::m, mat_numdoc(), MatBLKSIZE, MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, MatDir::matstat, IMG::mid, NORM_DATA, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_imageheader::pixel_size, Matval::plane, ecat63_mainheader::plane_separation, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, IMG::randoms, RAW_DATA, ecat63_imageheader::recon_scale, ecat63_scanheader::sample_distance, IMG::sampleDistance, ecat63_scanheader::scale_factor, ecat63_normheader::scale_factor, ecat63_attnheader::scale_factor, 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, IMG::scanner, IMG::scanStart, IMG::sizex, IMG::sizey, IMG::sizez, ecat63_imageheader::slice_width, IMG::start, IMG::status, STATUS_FAULT, STATUS_NOFILE, STATUS_NOMAINHEADER, STATUS_NOMATLIST, MatDir::strtblk, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, SUN_I2, SUN_I4, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, IMG::unit, ecat63_mainheader::user_process_code, IMG::userProcessCode, VAX_I2, VAX_I4, VAX_R4, and IMG::zoom.
Referenced by imgRead().
int ecat63ReadPlaneToImg | ( | const char * | fname, |
IMG * | img | ||
) |
Reads one CTI ECAT 6.3 plane (all frames or gates) at a time to memory. Img data must be initialized before this procedure. Existing img->_dataType is not changed. If img data structure is empty, reads the first plane. If img data structure contains data, reads the next plane. Any existing data in img is cleared and replaced by the new plane.
fname | name of the input ECAT 6.3 file |
img | data structure in which the file is read |
Definition at line 568 of file img_e63.c.
References IMG::_dataType, IMG::_fileFormat, ATTN_DATA, ecat63_mainheader::axial_fov, IMG::axialFOV, BYTE_TYPE, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_normheader::data_type, ecat63_attnheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat63_scanheader::delayed, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_normheader::dimension_1, ecat63_attnheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, ecat63_normheader::dimension_2, ecat63_attnheader::dimension_2, IMG::dimt, IMG::dimz, ecat63DeleteLateFrames(), ecat63EmptyMatlist(), ecat63errmsg, ecat63InitMatlist(), ecat63PrintMainheader(), ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatdata(), ecat63ReadMatlist(), ecat63ReadNormheader(), ecat63ReadScanheader(), ecat63_imageheader::ecat_calibration_fctr, IMG::end, MatDir::endblk, ecat63_mainheader::file_type, Matval::frame, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, Matval::gate, IEEE_R4, IMAGE_DATA, IMG_E63, IMG_STATUS_OCCUPIED, IMG_STATUS_UNINITIALIZED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgAllocate(), imgEmpty(), imgUnitFromEcat(), ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, ecat63_scanheader::loss_correction_fctr, IMG::m, mat_numdoc(), MatBLKSIZE, MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, MatDir::matstat, IMG::mid, NORM_DATA, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_imageheader::pixel_size, Matval::plane, ecat63_mainheader::plane_separation, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, IMG::randoms, RAW_DATA, ecat63_imageheader::recon_scale, ecat63_scanheader::sample_distance, IMG::sampleDistance, ecat63_scanheader::scale_factor, ecat63_normheader::scale_factor, ecat63_attnheader::scale_factor, 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, IMG::scanner, IMG::scanStart, IMG::sizex, IMG::sizey, IMG::sizez, ecat63_imageheader::slice_width, IMG::start, IMG::status, MatDir::strtblk, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, SUN_I2, SUN_I4, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, IMG::unit, ecat63_mainheader::user_process_code, IMG::userProcessCode, VAX_I2, VAX_I4, VAX_R4, and IMG::zoom.
int ecat63WriteAllImg | ( | const char * | fname, |
IMG * | img | ||
) |
Write all matrices in memory to the ECAT file.
fname | name of the output ECAT 6.3 file, If ECAT file exists, it is renamed as filename% |
img | data structure from which the data is written |
Definition at line 374 of file img_e63.c.
References IMG::_dataType, ecat63_mainheader::axial_fov, IMG::axialFOV, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::data_type, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat63_scanheader::delayed, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT63_SYSTEM_TYPE_DEFAULT, ecat63Create(), ecat63errmsg, ecat63PrintImageheader(), ecat63PrintMainheader(), ecat63PrintScanheader(), ecat63WriteImage(), ecat63WriteScan(), ecat63_imageheader::ecat_calibration_fctr, IMG::end, ecat63_mainheader::file_type, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_scanheader::frame_duration_sec, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, IMAGE_DATA, ecat63_imageheader::image_max, ecat63_imageheader::image_min, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, imgIsotope(), imgUnitToEcat6(), ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, ecat63_imageheader::loss_corr_fctr, ecat63_scanheader::loss_correction_fctr, IMG::m, mat_numcod(), ecat63_mainheader::num_bed_pos, ecat63_imageheader::num_dimensions, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_imageheader::pixel_size, ecat63_imageheader::plane_eff_corr_fctr, ecat63_mainheader::plane_separation, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, IMG::randoms, RAW_DATA, ecat63_imageheader::recon_scale, ecat63_scanheader::sample_distance, IMG::sampleDistance, ecat63_scanheader::scale_factor, ecat63_scanheader::scan_max, ecat63_scanheader::scan_min, 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, IMG::scanner, IMG::scanStart, IMG::sizex, IMG::sizez, ecat63_imageheader::slice_width, IMG::start, IMG::status, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat63_mainheader::user_process_code, IMG::userProcessCode, VAX_I2, ecat63_imageheader::well_counter_cal_fctr, and IMG::zoom.
Referenced by imgWrite().
int imgEcat63Supported | ( | ECAT63_mainheader * | h | ) |
Check whether read functions in IMG library support this ECAT 6.3 file_type.
h | Ecat 6.3 main header |
Definition at line 1140 of file img_e63.c.
References ATTN_DATA, ecat63_mainheader::file_type, IMAGE_DATA, NORM_DATA, and RAW_DATA.
Referenced by imgReadEcat63Header().
int imgEcat7Supported | ( | ECAT7_mainheader * | h | ) |
Check whether read functions in IMG library support this ECAT 7.x file_type.
h | Ecat7 main header |
Definition at line 984 of file img_e7.c.
References ECAT7_2DSCAN, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7_VOLUME8, and ecat7_mainheader::file_type.
Referenced by imgRead(), imgReadEcat7(), imgReadEcat7Frame(), and imgReadEcat7Header().
void imgFormatFromFName | ( | IMG * | img, |
const char * | fname | ||
) |
Determine IMG _fileFormat from filename extension, if not already defined. Default if ECAT 7 image volume, if nothing else can be guessed.
img | target image struture where fileformat is saved, should have IMG_UNKNOWN as file type |
fname | name of file that is detemined |
Definition at line 547 of file imgfile.c.
References IMG::_fileFormat, IMG_ANA, IMG_E63, IMG_E7, IMG_POLARMAP, and IMG_UNKNOWN.
Referenced by imgWrite(), and imgWriteFrame().
int imgGetAnalyzeHeader | ( | IMG * | img, |
ANALYZE_DSR * | h | ||
) |
Copy Analyze 7.5 header information into IMG.
img | image structure |
h | Analyze header structure |
Definition at line 481 of file img_ana.c.
References IMG::_fileFormat, IMG::decayCorrected, ANALYZE_HEADER_HISTORY::descrip, ANALYZE_HEADER_IMGDIM::dim, ANALYZE_DSR::dime, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ANALYZE_HEADER_IMGDIM::funused3, ANALYZE_DSR::hist, IMG_ANA, IMG_ANA_L, IMG_STATUS_INITIALIZED, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, imgSetStatus(), IMG::isotopeHalflife, ANALYZE_DSR::little, ANALYZE_HEADER_HISTORY::patient_id, IMG::patientName, ANALYZE_HEADER_IMGDIM::pixdim, IMG::sizex, IMG::sizey, IMG::sizez, IMG::status, STATUS_FAULT, STATUS_INVALIDHEADER, STATUS_OK, IMG::studyNr, and IMG::type.
Referenced by imgReadAnalyzeHeader().
int imgGetEcat63Fileformat | ( | ECAT63_mainheader * | h | ) |
Return the IMG fileformat based on ECAT 6.3 file_type.
h | Ecat 6.3 main header |
Definition at line 1260 of file img_e63.c.
References ATTN_DATA, ecat63_mainheader::file_type, IMAGE_DATA, IMG_E63, IMG_UNKNOWN, NORM_DATA, and RAW_DATA.
Referenced by imgReadEcat63Header().
void imgGetEcat63MHeader | ( | IMG * | img, |
ECAT63_mainheader * | h | ||
) |
Copy ECAT 6.3 main header information into IMG
img | target image structure |
h | source Ecat 6.3 main header |
Definition at line 1157 of file img_e63.c.
References IMG::_dataType, ATTN_DATA, ecat63_mainheader::axial_fov, IMG::axialFOV, ecat63_mainheader::calibration_units, ecat63_mainheader::data_type, ecat63_mainheader::file_type, IMAGE_DATA, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgUnitFromEcat(), ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, NORM_DATA, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_mainheader::plane_separation, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, RAW_DATA, 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, IMG::scanner, IMG::scanStart, IMG::sizez, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat63_mainheader::user_process_code, IMG::userProcessCode, VAX_I2, VAX_I4, and VAX_R4.
Referenced by imgReadEcat63Header().
int imgGetEcat7Fileformat | ( | ECAT7_mainheader * | h | ) |
Return the IMG fileformat based on ECAT7 file_type.
h | Ecat7 main header |
Definition at line 794 of file img_e7.c.
References ECAT7_2DSCAN, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7_mainheader::file_type, IMG_E7, IMG_E7_2D, IMG_POLARMAP, and IMG_UNKNOWN.
Referenced by imgReadEcat7Header().
void imgGetEcat7MHeader | ( | IMG * | img, |
ECAT7_mainheader * | h | ||
) |
Copy ECAT 7 main header information into IMG
img | target structure |
h | source structure |
Definition at line 681 of file img_e7.c.
References IMG::axialFOV, ecat7_mainheader::distance_scanned, ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7_mainheader::file_type, IMG_TYPE_IMAGE, IMG_TYPE_POLARMAP, IMG_TYPE_RAW, imgUnitFromEcat7(), ecat7_mainheader::isotope_halflife, IMG::isotopeHalflife, IMG::orientation, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, IMG::patientID, IMG::patientName, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, ecat7_mainheader::scan_start_time, IMG::scanner, IMG::scanStart, IMG::sizez, ecat7_mainheader::study_description, ecat7_mainheader::study_type, IMG::studyDescription, IMG::studyNr, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat7_mainheader::user_process_code, and IMG::userProcessCode.
Referenced by imgReadEcat7(), imgReadEcat7Header(), and test_modules().
int imgRead | ( | const char * | fname, |
IMG * | img | ||
) |
Read an image or sinogram file in ECAT 6.3, ECAT 7.x or Analyze 7.5 format.
fname | input filename |
img | pointer to initialized IMG structure |
Definition at line 190 of file imgfile.c.
References anaExists(), ecat63errmsg, ecat63ReadAllToImg(), ecat63ReadMainheader(), ecat7filetype(), ecat7ReadMainheader(), ECAT7V_MAGICNR, ecat63_mainheader::file_type, ecat7_mainheader::file_type, IMG_STATUS_INITIALIZED, IMG_TEST, imgEcat7Supported(), imgReadAnalyze(), imgReadEcat7(), imgStatus(), ecat7_mainheader::magic_number, IMG::statmsg, IMG::status, STATUS_FAULT, STATUS_MISSINGMATRIX, STATUS_NOFILE, STATUS_OK, STATUS_UNKNOWNFORMAT, and STATUS_UNSUPPORTED.
Referenced by test_img_io(), and test_polarmap_io().
int imgReadAnalyze | ( | const char * | dbname, |
IMG * | img | ||
) |
Read Analyze 7.5 image. Analyze database name must be given with path. Image and header files with .img and .hdr extensions must exist. Also SIF file with .sif extension is used, if it exists. anaFlipping() determines whether image is flipped in z-direction; image is always flipped in x,y-directions.
dbname | Analyze database name with path, with or without extension |
img | Pointer to initialized IMG strucure |
Definition at line 83 of file img_ana.c.
References IMG::_fileFormat, anaExists(), anaFlipping(), anaPrintHeader(), anaReadHeader(), anaReadImagedata(), IMG::decayCorrected, ANALYZE_HEADER_HISTORY::descrip, ANALYZE_HEADER_IMGDIM::dim, ANALYZE_DSR::dime, IMG::dimt, IMG::dimz, IMG::end, SIF::frameNr, ANALYZE_HEADER_IMGDIM::funused3, ANALYZE_DSR::hist, IMG_ANA, IMG_ANA_L, IMG_STATUS_INITIALIZED, IMG_TEST, IMG_TYPE_IMAGE, imgAllocate(), imgSetStatus(), SIF::isotope_name, IMG::isotopeHalflife, ANALYZE_DSR::little, IMG::m, IMG::mid, ANALYZE_HEADER_HISTORY::patient_id, IMG::patientName, ANALYZE_HEADER_IMGDIM::pixdim, IMG::planeNumber, IMG::prompts, SIF::prompts, IMG::randoms, SIF::randoms, IMG::scanStart, SIF::scantime, sifEmpty(), sifInit(), sifRead(), IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_FAULT, STATUS_INVALIDHEADER, STATUS_NOHEADERFILE, STATUS_NOIMGDATA, STATUS_NOMEMORY, STATUS_NOSIFDATA, STATUS_OK, STATUS_UNSUPPORTED, STATUS_WRONGSIFDATA, IMG::studyNr, IMG::type, SIF::x1, and SIF::x2.
Referenced by imgRead().
int imgReadAnalyzeFirstFrame | ( | const char * | fname, |
IMG * | img | ||
) |
Read the first frame from an Analyze 7.5 database into IMG data structure.
fname | Name of Analyze database from which IMG contents will be read |
img | pointer to the initiated but not preallocated IMG data |
Definition at line 629 of file img_ana.c.
References IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG_STATUS_INITIALIZED, IMG_TEST, imgAllocate(), imgInfo(), imgReadAnalyzeFrame(), imgReadAnalyzeHeader(), imgSetStatus(), IMG::status, STATUS_FAULT, STATUS_NOMEMORY, and STATUS_OK.
int imgReadAnalyzeFrame | ( | const char * | fname, |
int | frame_to_read, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Read a specified frame from an Analyze 7.5 database into preallocated IMG data structure. Analyze database consists of two or three files in the same directory: fname.hdr, fname.img, and optionally fname.sif. IMG header is assumed to be filled correctly before calling this function, except for information concerning separate planes and this frame, which is filled here. If frame does not exist, then and only then STATUS_NOMATRIX is returned.
fname | name of Analyze database from which IMG contents will be read |
frame_to_read | frame which will be read [1..frameNr] |
img | pointer to the IMG data. Place for the frame must be preallocated |
frame_index | IMG frame index [0..dimt-1] where data will be placed |
Definition at line 674 of file img_ana.c.
References anaDatabaseExists(), anaFlipping(), anaReadHeader(), anaReadImagedata(), IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG::end, SIF::frameNr, IMG_STATUS_OCCUPIED, IMG_TEST, imgSetStatus(), IMG::m, IMG::mid, IMG::prompts, SIF::prompts, IMG::randoms, SIF::randoms, sifEmpty(), sifInit(), sifRead(), IMG::start, IMG::status, STATUS_FAULT, STATUS_NOFILE, STATUS_NOHEADERFILE, STATUS_NOIMGDATA, STATUS_NOMATRIX, STATUS_NOMEMORY, STATUS_OK, STATUS_UNSUPPORTED, SIF::x1, and SIF::x2.
Referenced by imgReadAnalyzeFirstFrame(), and imgReadFrame().
int imgReadAnalyzeHeader | ( | const char * | dbname, |
IMG * | img | ||
) |
Fill IMG struct header information from Analyze 7.5 database files. SIF file is read if available. Information concerning separate frames or planes is not filled though.
dbname | name of Analyze database, may contain filename extension |
img | pointer to the initiated IMG data |
Definition at line 414 of file img_ana.c.
References anaDatabaseExists(), anaReadHeader(), IMG_STATUS_INITIALIZED, IMG_TEST, imgGetAnalyzeHeader(), imgSetStatus(), SIF::isotope_name, IMG::isotopeHalflife, IMG::scanStart, SIF::scantime, sifEmpty(), sifInit(), sifRead(), IMG::status, STATUS_FAULT, STATUS_NOFILE, STATUS_NOHEADERFILE, STATUS_OK, STATUS_UNSUPPORTED, SIF::studynr, and IMG::studyNr.
Referenced by imgReadAnalyzeFirstFrame(), imgReadHeader(), and imgWriteAnalyzeFrame().
int imgReadEcat63FirstFrame | ( | const char * | fname, |
IMG * | img | ||
) |
Read the first frame from an ECAT 6.3 file into IMG data structure.
fname | name of file from which IMG contents will be read |
img | pointer to the initiated but not preallocated IMG data |
Definition at line 1422 of file img_e63.c.
References IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG_STATUS_INITIALIZED, IMG_TEST, imgAllocate(), imgInfo(), imgReadEcat63Frame(), imgReadEcat63Header(), imgSetStatus(), IMG::status, STATUS_FAULT, STATUS_NOMEMORY, and STATUS_OK.
int imgReadEcat63Frame | ( | const char * | fname, |
int | frame_to_read, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Read a specified frame from an ECAT 6.3 file into preallocated IMG data structure. IMG header is assumed to be filled correctly before calling this function, except for information concerning separate planes and this frame, which is filled here.
fname | name of file from which IMG contents will be read |
frame_to_read | frame which will be read (1..frameNr) |
img | pointer to the IMG data. Place for the frame must be preallocated |
frame_index | IMG frame index (0..dimt-1) where data will be placed |
Definition at line 1464 of file img_e63.c.
References IMG::_dataType, ATTN_DATA, BYTE_TYPE, ecat63_mainheader::calibration_factor, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_normheader::data_type, ecat63_attnheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrFactor, ecat63_scanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ecat63EmptyMatlist(), ecat63GatherMatlist(), ecat63GetMatrixBlockSize(), ecat63InitMatlist(), ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatdata(), ecat63ReadMatlist(), ecat63ReadNormheader(), ecat63ReadScanheader(), ecat63SortMatlistByFrame(), ecat63_imageheader::ecat_calibration_fctr, IMG::end, MatDir::endblk, ecat63_mainheader::file_type, Matval::frame, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, Matval::gate, IEEE_R4, IMAGE_DATA, IMG_STATUS_OCCUPIED, IMG_TEST, imgSetStatus(), ecat63_scanheader::loss_correction_fctr, IMG::m, mat_numdoc(), MatBLKSIZE, MATRIXLIST::matdir, MatDir::matnum, MATRIXLIST::matrixNr, MatDir::matstat, IMG::mid, NORM_DATA, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, Matval::plane, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, ecat63_imageheader::quant_scale, IMG::randoms, RAW_DATA, ecat63_scanheader::sample_distance, IMG::sampleDistance, ecat63_scanheader::scale_factor, ecat63_normheader::scale_factor, ecat63_attnheader::scale_factor, IMG::start, IMG::status, STATUS_FAULT, STATUS_INVALIDMATLIST, STATUS_MISSINGMATRIX, STATUS_NOFILE, STATUS_NOMAINHEADER, STATUS_NOMATLIST, STATUS_NOMATRIX, STATUS_NOMEMORY, STATUS_NOSUBHEADER, STATUS_OK, MatDir::strtblk, SUN_I2, SUN_I4, VAX_I2, VAX_I4, and VAX_R4.
Referenced by imgReadEcat63FirstFrame(), and imgReadFrame().
int imgReadEcat63Header | ( | const char * | fname, |
IMG * | img | ||
) |
Fill IMG struct header information from an image or sinogram file in ECAT 6.3 format. Information concerning separate frames or planes is not filled. Please note: ECAT 6.3 files do not have a magic number, therefore, do not use this function to determine if your file is in this format, at least test all other possible formats before calling this.
fname | image or sinogram filename |
img | pointer to initialized IMG structure |
Definition at line 1289 of file img_e63.c.
References IMG::_dataType, IMG::_fileFormat, ATTN_DATA, ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_normheader::data_type, ecat63_attnheader::data_type, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_normheader::dimension_1, ecat63_attnheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, ecat63_normheader::dimension_2, ecat63_attnheader::dimension_2, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ecat63DeleteLateFrames(), ecat63EmptyMatlist(), ecat63GatherMatlist(), ecat63GetMatrixBlockSize(), ecat63GetPlaneAndFrameNr(), ecat63InitMatlist(), ecat63ReadAttnheader(), ecat63ReadImageheader(), ecat63ReadMainheader(), ecat63ReadMatlist(), ecat63ReadNormheader(), ecat63ReadScanheader(), ecat63SortMatlistByPlane(), ecat63_mainheader::file_type, IMAGE_DATA, IMG_STATUS_INITIALIZED, IMG_TEST, IMG_TYPE_RAW, IMG_UNKNOWN, imgEcat63Supported(), imgGetEcat63Fileformat(), imgGetEcat63MHeader(), imgSetStatus(), imgUnitFromEcat(), MATRIXLIST::matdir, MATRIXLIST::matrixNr, NORM_DATA, ecat63_mainheader::num_frames, ecat63_imageheader::pixel_size, ecat63_imageheader::quant_units, RAW_DATA, ecat63_imageheader::recon_scale, ecat63_scanheader::sample_distance, IMG::sampleDistance, IMG::sizex, IMG::sizey, IMG::sizez, ecat63_imageheader::slice_width, IMG::status, STATUS_FAULT, STATUS_INVALIDMATLIST, STATUS_NOFILE, STATUS_NOMAINHEADER, STATUS_NOMATLIST, STATUS_NOSUBHEADER, STATUS_OK, STATUS_UNSUPPORTED, MatDir::strtblk, IMG::type, IMG::unit, VAX_I2, VAX_I4, VAX_R4, and IMG::zoom.
Referenced by imgReadEcat63FirstFrame(), imgReadHeader(), and imgWriteEcat63Frame().
int imgReadEcat7 | ( | const char * | fname, |
IMG * | img | ||
) |
Read ECAT 7 image, volume or 2D sinogram.
fname | input filename |
img | initialized IMG structure |
Definition at line 83 of file img_e7.c.
References IMG::_dataType, IMG::_fileFormat, ecat7_mainheader::bin_size, ecat7_imageheader::data_type, ecat7_scanheader::data_type, ecat7_2Dscanheader::data_type, ecat7_polmapheader::data_type, ecat7_scanheader::deadtime_correction_factor, ecat7_2Dscanheader::deadtime_correction_factor, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat7_scanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_2DSCAN, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ecat7_id_to_val(), ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7CheckMatlist(), ecat7EmptyMatlist(), ecat7errmsg, ecat7InitMatlist(), ecat7PrintMatlist(), ecat7Read2DScanheader(), ecat7Read2DScanMatrix(), ecat7ReadImageheader(), ecat7ReadImageMatrix(), ecat7ReadMainheader(), ecat7ReadMatlist(), ecat7ReadPolarmapMatrix(), ecat7ReadPolmapheader(), ecat7ReadScanheader(), ecat7ReadScanMatrix(), ecat7SortMatlistByPlane(), ECAT7V_MAGICNR, ecat7_mainheader::ecat_calibration_factor, IMG::end, ECAT7_MatDir::endblk, ecat7_mainheader::file_type, ECAT7_Matval::frame, ecat7_imageheader::frame_duration, ecat7_2Dscanheader::frame_duration, ecat7_polmapheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_scanheader::frame_start_time, ecat7_2Dscanheader::frame_start_time, ecat7_polmapheader::frame_start_time, ECAT7_Matval::gate, ECAT7_MatDir::id, IMG_E7, IMG_E7_2D, IMG_POLARMAP, IMG_STATUS_INITIALIZED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_POLARMAP, IMG_TYPE_RAW, IMG_UNKNOWN, imgAllocate(), imgEcat7Supported(), imgGetEcat7MHeader(), imgSetStatus(), IMG::m, ecat7_mainheader::magic_number, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, IMG::mid, ecat7_scanheader::num_angles, ecat7_2Dscanheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_2Dscanheader::num_dimensions, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_scanheader::num_r_elements, ecat7_2Dscanheader::num_r_elements, ecat7_polmapheader::num_rings, ecat7_scanheader::num_z_elements, ecat7_2Dscanheader::num_z_elements, ecat7_polmapheader::pixel_size, ECAT7_Matval::plane, IMG::planeNumber, ecat7_scanheader::prompts, IMG::prompts, IMG::randoms, ecat7_imageheader::recon_zoom, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::sampleDistance, ecat7_polmapheader::sectors_per_ring, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_FAULT, STATUS_INVALIDMATLIST, STATUS_MISSINGMATRIX, STATUS_NOFILE, STATUS_NOMATRIX, STATUS_NOMEMORY, STATUS_NOSUBHEADER, STATUS_OK, STATUS_UNKNOWNFORMAT, STATUS_UNSUPPORTED, STATUS_VARMATSIZE, ECAT7_MatDir::strtblk, IMG::type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_scanheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, and IMG::zoom.
Referenced by imgRead().
int imgReadEcat7FirstFrame | ( | const char * | fname, |
IMG * | img | ||
) |
Read the first frame from an ECAT 7 file into IMG data structure.
fname | name of file from which IMG contents will be read |
img | pointer to the initiated but not preallocated IMG data |
Definition at line 1008 of file img_e7.c.
References IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG_STATUS_INITIALIZED, IMG_TEST, imgAllocate(), imgInfo(), imgReadEcat7Frame(), imgReadEcat7Header(), imgSetStatus(), IMG::status, STATUS_FAULT, STATUS_NOMEMORY, and STATUS_OK.
int imgReadEcat7Frame | ( | const char * | fname, |
int | frame_to_read, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Read a specified frame from an ECAT 7 file into preallocated IMG data structure. IMG header is assumed to be filled correctly before calling this function, except for information concerning separate planes and this frame, which is filled here. If frame does not exist, then and only then STATUS_NOMATRIX is returned.
fname | name of file from which IMG contents will be read |
frame_to_read | frame which will be read [1..frameNr] |
img | pointer to the IMG data. Place for the frame must be preallocated |
frame_index | IMG frame index [0..dimt-1] where data will be placed |
Definition at line 1051 of file img_e7.c.
References IMG::_fileFormat, ecat7_scanheader::deadtime_correction_factor, ecat7_2Dscanheader::deadtime_correction_factor, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrFactor, ecat7_scanheader::delayed, ecat7_2Dscanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ecat7_id_to_val(), ecat7CheckMatlist(), ecat7EmptyMatlist(), ecat7GatherMatlist(), ecat7InitMatlist(), ecat7Read2DScanMatrix(), ecat7ReadImageMatrix(), ecat7ReadMainheader(), ecat7ReadMatlist(), ecat7ReadPolarmapMatrix(), ecat7ReadScanMatrix(), ecat7SortMatlistByFrame(), ECAT7V_MAGICNR, ecat7_mainheader::ecat_calibration_factor, IMG::end, ECAT7_MatDir::endblk, ECAT7_Matval::frame, ecat7_imageheader::frame_duration, ecat7_2Dscanheader::frame_duration, ecat7_polmapheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_scanheader::frame_start_time, ecat7_2Dscanheader::frame_start_time, ecat7_polmapheader::frame_start_time, ECAT7_Matval::gate, ECAT7_MatDir::id, IMG_E7_2D, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_POLARMAP, imgEcat7Supported(), imgSetStatus(), IMG::m, ecat7_mainheader::magic_number, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, IMG::mid, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ECAT7_Matval::plane, IMG::planeNumber, ecat7_scanheader::prompts, ecat7_2Dscanheader::prompts, IMG::prompts, IMG::randoms, IMG::start, IMG::status, STATUS_FAULT, STATUS_INVALIDMATLIST, STATUS_MISSINGMATRIX, STATUS_NOFILE, STATUS_NOMAINHEADER, STATUS_NOMATLIST, STATUS_NOMATRIX, STATUS_OK, STATUS_UNKNOWNFORMAT, STATUS_UNSUPPORTED, ECAT7_MatDir::strtblk, and IMG::type.
Referenced by imgReadEcat7FirstFrame(), and imgReadFrame().
int imgReadEcat7Header | ( | const char * | fname, |
IMG * | img | ||
) |
Fill IMG struct header information from an image or sinogram file in ECAT 7 format. Information concerning separate frames or planes is not filled.
fname | image or sinogram filename |
img | pointer to initialized IMG structure |
Definition at line 827 of file img_e7.c.
References IMG::_dataType, IMG::_fileFormat, ecat7_mainheader::bin_size, ecat7_imageheader::data_type, ecat7_scanheader::data_type, ecat7_2Dscanheader::data_type, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_2DSCAN, ECAT7_3DSCAN, ECAT7_3DSCAN8, ECAT7_3DSCANFIT, ECAT7_IMAGE16, ECAT7_IMAGE8, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7_VOLUME8, ecat7CheckMatlist(), ecat7EmptyMatlist(), ecat7GatherMatlist(), ecat7GetMatrixBlockSize(), ecat7GetPlaneAndFrameNr(), ecat7InitMatlist(), ecat7Read2DScanheader(), ecat7ReadImageheader(), ecat7ReadMainheader(), ecat7ReadMatlist(), ecat7ReadPolmapheader(), ecat7ReadScanheader(), ECAT7V_MAGICNR, ecat7_mainheader::file_type, IMG_STATUS_INITIALIZED, IMG_TEST, IMG_UNKNOWN, imgEcat7Supported(), imgGetEcat7Fileformat(), imgGetEcat7MHeader(), imgSetStatus(), ecat7_mainheader::magic_number, ECAT7_MATRIXLIST::matdir, ECAT7_MATRIXLIST::matrixNr, MAX_POLARMAP_NUM_RINGS, ecat7_scanheader::num_angles, ecat7_2Dscanheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_2Dscanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_2Dscanheader::num_r_elements, ecat7_polmapheader::num_rings, ecat7_scanheader::num_z_elements, ecat7_2Dscanheader::num_z_elements, ecat7_polmapheader::pixel_size, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, IMG::polarmap_start_angle, ecat7_imageheader::recon_zoom, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, ecat7_polmapheader::ring_angle, ecat7_polmapheader::ring_position, IMG::sampleDistance, ecat7_polmapheader::sectors_per_ring, IMG::sizex, IMG::sizey, IMG::sizez, ecat7_polmapheader::start_angle, IMG::status, STATUS_FAULT, STATUS_INVALIDMATLIST, STATUS_INVALIDPOLARMAP, STATUS_NOFILE, STATUS_NOMAINHEADER, STATUS_NOSUBHEADER, STATUS_OK, STATUS_UNKNOWNFORMAT, STATUS_UNSUPPORTED, ECAT7_MatDir::strtblk, IMG::type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_scanheader::x_resolution, ecat7_2Dscanheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, and IMG::zoom.
Referenced by imgReadEcat7FirstFrame(), imgReadHeader(), and imgWriteEcat7Frame().
int imgReadFrame | ( | const char * | fname, |
int | frame_to_read, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Read one time frame from a supported PET image or sinogram file into IMG data structure. This functions can be called repeatedly to read all the frames one at a time to conserve memory.
fname | name of file from which IMG contents will be read. Currently supported file formats are ECAT 6.3 images and sinograms, ECAT 7.x 2D and 3D images and sinograms, and Analyze 7.5 3D and 4D images. |
frame_to_read | frame which will be read [1..frameNr] |
img | pointer to initiated or occupied IMG data. If occupied, then new frame is tested to match the previous file type, dimensions, and other fundamental information contained in the IMG. If not occupied, then memory is allocated here. |
frame_index | IMG frame index (0..dimt-1) where data will be placed. If index is >0, then the memory for that frame must be allocated before calling this function. |
Definition at line 389 of file imgfile.c.
References IMG::_fileFormat, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, IMG_ANA, IMG_ANA_L, IMG_E63, IMG_E7, IMG_E7_2D, IMG_POLARMAP, IMG_STATUS_INITIALIZED, IMG_STATUS_OCCUPIED, IMG_TEST, imgAllocate(), imgEmpty(), imgInfo(), imgInit(), imgReadAnalyzeFrame(), imgReadEcat63Frame(), imgReadEcat7Frame(), imgReadHeader(), imgSetStatus(), IMG::statmsg, IMG::status, STATUS_FAULT, STATUS_INVALIDHEADER, STATUS_NOMEMORY, STATUS_UNSUPPORTED, and IMG::type.
Referenced by imgReadMinMax().
int imgReadHeader | ( | const char * | fname, |
IMG * | img | ||
) |
Fill IMG struct header information from an image or sinogram file in ECAT 6.3, ECAT 7.x or Analyze 7.5 format. Information concerning separate frames or planes is not filled.
fname | image or sinogram filename |
img | pointer to initialized but not allocated IMG structure |
Definition at line 329 of file imgfile.c.
References anaDatabaseExists(), IMG_STATUS_INITIALIZED, IMG_TEST, imgReadAnalyzeHeader(), imgReadEcat63Header(), imgReadEcat7Header(), imgSetStatus(), IMG::status, STATUS_FAULT, STATUS_OK, and STATUS_UNKNOWNFORMAT.
Referenced by imgReadFrame().
int imgReadMainHeader | ( | const char * | fname, |
IMG * | img | ||
) |
int imgReadNextFrame | ( | char * | fname, |
IMG * | img | ||
) |
int imgSetAnalyzeHeader | ( | IMG * | img, |
const char * | dbname, | ||
ANALYZE_DSR * | dsr, | ||
float | fmin, | ||
float | fmax | ||
) |
Copy header information in IMG struct into Analyze 7.5 header struct. Min, max, and scale factor are set here and they apply to all frames.
img | pointer to IMG struct |
dbname | Analyze 7.5 database name |
dsr | pointer to Analyze header struct to be filled |
fmin | minimum pixel value in all frames that will be written |
fmax | maximum pixel value in all frames that will be written |
Definition at line 542 of file img_ana.c.
References IMG::_fileFormat, ANALYZE_DT_SIGNED_SHORT, ANALYZE_HEADER_IMGDIM::bitpix, ANALYZE_HEADER_IMGDIM::cal_max, ANALYZE_HEADER_IMGDIM::cal_min, ANALYZE_HEADER_KEY::data_type, ANALYZE_HEADER_IMGDIM::datatype, ANALYZE_HEADER_KEY::db_name, IMG::decayCorrected, ANALYZE_HEADER_HISTORY::descrip, ANALYZE_HEADER_IMGDIM::dim, ANALYZE_DSR::dime, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ANALYZE_HEADER_HISTORY::exp_date, ANALYZE_HEADER_HISTORY::exp_time, ANALYZE_HEADER_KEY::extents, ANALYZE_HEADER_IMGDIM::funused1, ANALYZE_HEADER_IMGDIM::funused3, ANALYZE_HEADER_IMGDIM::glmax, ANALYZE_HEADER_IMGDIM::glmin, ANALYZE_DSR::hist, ANALYZE_DSR::hk, IMG_ANA_L, IMG_STATUS_INITIALIZED, IMG_STATUS_OCCUPIED, IMG_TEST, imgMinMax(), imgSetStatus(), IMG::isotopeHalflife, ANALYZE_DSR::little, ANALYZE_HEADER_IMGDIM::pixdim, ANALYZE_HEADER_KEY::regular, ANALYZE_HEADER_HISTORY::scannum, IMG::scanStart, ANALYZE_HEADER_KEY::sizeof_hdr, IMG::sizex, IMG::sizey, IMG::sizez, IMG::status, STATUS_FAULT, STATUS_OK, and IMG::studyNr.
Referenced by imgWriteAnalyzeFrame().
void imgSetEcat63MHeader | ( | IMG * | img, |
ECAT63_mainheader * | h | ||
) |
Copy information from IMG struct into ECAT 6.3 main header
img | source image structure |
h | target Ecat 6.3 main header |
Definition at line 1208 of file img_e63.c.
References ecat63_mainheader::axial_fov, IMG::axialFOV, ecat63_mainheader::calibration_factor, ecat63_mainheader::calibration_units, ecat63_mainheader::data_type, IMG::dimt, IMG::dimz, ECAT63_SYSTEM_TYPE_DEFAULT, ecat63_mainheader::file_type, IMAGE_DATA, IMG_TYPE_IMAGE, imgIsotope(), imgUnitToEcat6(), ecat63_mainheader::isotope_code, ecat63_mainheader::isotope_halflife, IMG::isotopeHalflife, ecat63_mainheader::num_bed_pos, ecat63_mainheader::num_frames, ecat63_mainheader::num_gates, ecat63_mainheader::num_planes, ecat63_mainheader::patient_id, ecat63_mainheader::patient_name, IMG::patientID, IMG::patientName, ecat63_mainheader::plane_separation, ecat63_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, RAW_DATA, 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, IMG::scanner, IMG::scanStart, IMG::sizez, ecat63_mainheader::study_description, ecat63_mainheader::study_name, IMG::studyDescription, IMG::studyNr, ecat63_mainheader::sw_version, ecat63_mainheader::system_type, ecat63_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat63_mainheader::user_process_code, IMG::userProcessCode, and VAX_I2.
Referenced by imgWriteEcat63Frame().
void imgSetEcat63SHeader | ( | IMG * | img, |
void * | h | ||
) |
Copies Ecat6.3 sub header information
img | source image stucture |
h | target sub header stucture |
Definition at line 1790 of file img_e63.c.
References ecat63_imageheader::data_type, ecat63_scanheader::data_type, ecat63_imageheader::decay_corr_fctr, ecat63_imageheader::dimension_1, ecat63_scanheader::dimension_1, ecat63_imageheader::dimension_2, ecat63_scanheader::dimension_2, IMG::dimx, IMG::dimy, ecat63_imageheader::ecat_calibration_fctr, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_scanheader::frame_duration_sec, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, IMG_TYPE_RAW, imgUnitToEcat6(), ecat63_imageheader::loss_corr_fctr, ecat63_scanheader::loss_correction_fctr, ecat63_imageheader::num_dimensions, ecat63_imageheader::pixel_size, ecat63_imageheader::plane_eff_corr_fctr, ecat63_imageheader::quant_scale, ecat63_imageheader::quant_units, ecat63_imageheader::recon_scale, ecat63_scanheader::scale_factor, IMG::sizex, IMG::sizez, ecat63_imageheader::slice_width, IMG::type, VAX_I2, ecat63_imageheader::well_counter_cal_fctr, and IMG::zoom.
Referenced by imgWriteEcat63Frame().
void imgSetEcat7MHeader | ( | IMG * | img, |
ECAT7_mainheader * | h | ||
) |
Copy information from IMG to ECAT 7 main header
img | source structure |
h | target structure |
Definition at line 734 of file img_e7.c.
References IMG::_fileFormat, IMG::axialFOV, IMG::dimt, IMG::dimz, ecat7_mainheader::distance_scanned, ECAT7_2DSCAN, ECAT7_3DSCAN, ECAT7_IMAGE16, ECAT7_POLARMAP, ECAT7_VOLUME16, ECAT7S_MAGICNR, ECAT7V_MAGICNR, ecat7_mainheader::ecat_calibration_factor, ecat7_mainheader::file_type, IMG_E7_2D, IMG_TYPE_POLARMAP, IMG_TYPE_RAW, imgIsotope(), imgUnitToEcat7(), ecat7_mainheader::isotope_halflife, ecat7_mainheader::isotope_name, IMG::isotopeHalflife, ecat7_mainheader::magic_number, ecat7_mainheader::num_bed_pos, ecat7_mainheader::num_frames, ecat7_mainheader::num_gates, ecat7_mainheader::num_planes, IMG::orientation, ecat7_mainheader::patient_id, ecat7_mainheader::patient_name, ecat7_mainheader::patient_orientation, IMG::patientID, IMG::patientName, ecat7_mainheader::plane_separation, ecat7_mainheader::radiopharmaceutical, IMG::radiopharmaceutical, ecat7_mainheader::scan_start_time, IMG::scanner, IMG::scanStart, IMG::sizez, ecat7_mainheader::study_description, ecat7_mainheader::study_type, IMG::studyDescription, IMG::studyNr, ecat7_mainheader::sw_version, ecat7_mainheader::system_type, ecat7_mainheader::transaxial_fov, IMG::transaxialFOV, IMG::type, ecat7_mainheader::user_process_code, and IMG::userProcessCode.
Referenced by imgWrite2DEcat7(), imgWriteEcat7(), imgWriteEcat7Frame(), and imgWritePolarmap().
void imgSetEcat7SHeader | ( | IMG * | img, |
void * | h | ||
) |
Set ECAT7 subheader based on IMG contents
img | image structure |
h | Ecat7 image, scan, 2D scan or polar map header |
Definition at line 1391 of file img_e7.c.
References IMG::_fileFormat, ecat7_imageheader::data_type, ecat7_scanheader::data_type, ecat7_2Dscanheader::data_type, ecat7_polmapheader::data_type, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_SUNI2, ecat7_imageheader::fill_user, IMG_E7_2D, IMG_TYPE_POLARMAP, IMG_TYPE_RAW, ecat7_scanheader::num_angles, ecat7_2Dscanheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_scanheader::num_dimensions, ecat7_2Dscanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_2Dscanheader::num_r_elements, ecat7_polmapheader::num_rings, ecat7_scanheader::num_z_elements, ecat7_2Dscanheader::num_z_elements, ecat7_polmapheader::pixel_size, IMG::polarmap_num_rings, IMG::polarmap_ring_angle, IMG::polarmap_ring_position, IMG::polarmap_sectors_per_ring, ecat7_polmapheader::quant_units, ecat7_imageheader::recon_zoom, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, ecat7_polmapheader::ring_angle, ecat7_polmapheader::ring_position, IMG::sampleDistance, ecat7_polmapheader::sectors_per_ring, IMG::sizex, IMG::sizey, IMG::sizez, ecat7_polmapheader::start_angle, ecat7_scanheader::storage_order, IMG::type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_scanheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, and IMG::zoom.
Referenced by imgWriteEcat7Frame(), and imgWritePolarmap().
int imgWrite | ( | const char * | fname, |
IMG * | img | ||
) |
Write an image or sinogram file. Format depends on _fileFormat or filename extension.
fname | output filename |
img | pointer to IMG data |
Definition at line 277 of file imgfile.c.
References IMG::_fileFormat, ecat63WriteAllImg(), IMG_ANA, IMG_ANA_L, IMG_E63, IMG_E7_2D, IMG_POLARMAP, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_POLARMAP, IMG_TYPE_RAW, IMG_UNKNOWN, imgFormatFromFName(), imgSetStatus(), imgWrite2DEcat7(), imgWriteAnalyze(), imgWriteEcat7(), imgWritePolarmap(), IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, and IMG::type.
Referenced by imgMicropetCTToEcat7(), test_img_io(), and test_polarmap_io().
int imgWrite2DEcat7 | ( | const char * | fname, |
IMG * | img | ||
) |
Write ECAT 7 2D image or 2D sinogram.
fname | output filename |
img | pointer to image structure |
Definition at line 498 of file img_e7.c.
References ecat7_mainheader::bin_size, ecat7_imageheader::data_type, ecat7_2Dscanheader::data_type, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrFactor, ecat7_2Dscanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_2DSCAN, ECAT7_IMAGE16, ECAT7_SUNI2, ECAT7_TEST, ecat7_val_to_id(), ecat7Create(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), IMG::end, ecat7_mainheader::file_type, ecat7_imageheader::frame_duration, ecat7_2Dscanheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_2Dscanheader::frame_start_time, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgSetEcat7MHeader(), imgSetStatus(), IMG::m, ecat7_2Dscanheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_2Dscanheader::num_dimensions, ecat7_mainheader::num_planes, ecat7_2Dscanheader::num_r_elements, ecat7_2Dscanheader::num_z_elements, IMG::planeNumber, ecat7_2Dscanheader::prompts, IMG::prompts, IMG::randoms, ecat7_imageheader::recon_zoom, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::sampleDistance, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, STATUS_UNSUPPORTED, IMG::type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, and IMG::zoom.
Referenced by imgWrite().
int imgWriteAnalyze | ( | const char * | dbname, |
IMG * | img | ||
) |
Write Analyze 7.5 image. Analyze database name must be given with path. Path must exist. Image and header files with .img and .hdr extensions are created. Existing files are overwritten. anaFlipping() determines whether image is flipped in z-direction; image is always flipped in x,y-directions. Byte order is determined based on _fileFormat field.
dbname | analyze database name with path, without extension |
img | pointer to IMG data |
Definition at line 253 of file img_ana.c.
References IMG::_fileFormat, anaFlipping(), ANALYZE_DT_SIGNED_SHORT, anaWriteHeader(), ANALYZE_HEADER_IMGDIM::bitpix, ANALYZE_HEADER_IMGDIM::cal_max, ANALYZE_HEADER_IMGDIM::cal_min, ANALYZE_HEADER_KEY::data_type, ANALYZE_HEADER_IMGDIM::datatype, ANALYZE_HEADER_KEY::db_name, IMG::decayCorrected, ANALYZE_HEADER_HISTORY::descrip, ANALYZE_HEADER_IMGDIM::dim, ANALYZE_DSR::dime, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ANALYZE_HEADER_HISTORY::exp_date, ANALYZE_HEADER_HISTORY::exp_time, ANALYZE_HEADER_KEY::extents, ANALYZE_HEADER_IMGDIM::funused1, ANALYZE_HEADER_IMGDIM::funused3, ANALYZE_HEADER_IMGDIM::glmax, ANALYZE_HEADER_IMGDIM::glmin, ANALYZE_DSR::hist, ANALYZE_DSR::hk, IMG_ANA_L, IMG_STATUS_OCCUPIED, IMG_TEST, imgMinMax(), imgSetStatus(), IMG::isotopeHalflife, ANALYZE_DSR::little, IMG::m, ANALYZE_HEADER_IMGDIM::pixdim, ANALYZE_HEADER_KEY::regular, ANALYZE_HEADER_HISTORY::scannum, IMG::scanStart, ANALYZE_HEADER_KEY::sizeof_hdr, IMG::sizex, IMG::sizey, IMG::sizez, IMG::status, STATUS_CANTWRITEHEADERFILE, STATUS_CANTWRITEIMGFILE, STATUS_FAULT, STATUS_NOMEMORY, STATUS_OK, and IMG::studyNr.
Referenced by imgWrite().
int imgWriteAnalyzeFrame | ( | const char * | dbname, |
int | frame_to_write, | ||
IMG * | img, | ||
int | frame_index, | ||
float | fmin, | ||
float | fmax | ||
) |
Write one PET frame from IMG data struct into Analyze 7.5 database file. This function can be called repeatedly to write all frames one at a time to conserve memory.
dbname | name of file where IMG contents will be written. If file does not exist, it is created. Make sure to delete existing file, unless you want to add data |
frame_to_write | PET frame number (1..frameNr) which will be written: If set to 0, frame data will be written to an existing or new PET file as a new frame, never overwriting existing data. If >0, then frame data is written as specified frame number, overwriting any data existing with the same frame number |
img | pointer to the IMG data struct |
frame_index | IMG frame index (0..dimt-1) which will be written |
fmin | minimum pixel value in all frames that will be written; used only when writing the first frame |
fmax | maximum pixel value in all frames that will be written; used only when writing the first frame |
Definition at line 781 of file img_ana.c.
References IMG::_fileFormat, anaDatabaseExists(), anaFlipping(), anaReadHeader(), anaWriteHeader(), ANALYZE_HEADER_IMGDIM::dim, ANALYZE_DSR::dime, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ANALYZE_HEADER_IMGDIM::funused1, IMG_ANA, IMG_ANA_L, IMG_STATUS_OCCUPIED, IMG_TEST, imgEmpty(), imgInit(), imgReadAnalyzeHeader(), imgSetAnalyzeHeader(), ANALYZE_DSR::little, IMG::m, IMG::status, STATUS_CANTWRITEHEADERFILE, STATUS_CANTWRITEIMGFILE, STATUS_FAULT, STATUS_MISSINGMATRIX, STATUS_NOMAINHEADER, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, STATUS_VARMATSIZE, STATUS_WRONGFILETYPE, and IMG::type.
int imgWriteEcat63Frame | ( | const char * | fname, |
int | frame_to_write, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Write one PET frame from IMG data struct into ECAT 6.3 image or sinogram file; format is specified in IMG struct. This function can be called repeatedly to write all frames one at a time to conserve memory. However, file with just mainheader and matrix list without any previous frame is not accepted.
fname | name of file where IMG contents will be written. If file does not exist, it is created. Make sure to delete existing file, unless you want to add data |
frame_to_write | PET frame number (1..frameNr) which will be written: If set to 0, frame data will be written to an existing or new PET file as a new frame, never overwriting existing data. If >0, then frame data is written as specified frame number, overwriting any data existing with the same frame number |
img | pointer to the IMG data struct |
frame_index | IMG frame index (0..dimt-1) which will be written |
Definition at line 1656 of file img_e63.c.
References IMG::_fileFormat, ecat63_imageheader::decay_corr_fctr, IMG::decayCorrected, IMG::decayCorrFactor, ecat63_scanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT63_TEST, ecat63Create(), ecat63PrintMainheader(), ecat63ReadMainheader(), ecat63WriteImageMatrix(), ecat63WriteMainheader(), ecat63WriteScanMatrix(), IMG::end, ecat63_imageheader::frame_duration, ecat63_scanheader::frame_duration, ecat63_imageheader::frame_start_time, ecat63_scanheader::frame_start_time, IMG_E63, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgEmpty(), imgInit(), imgReadEcat63Header(), imgSetEcat63MHeader(), imgSetEcat63SHeader(), IMG::m, mat_numcod(), ecat63_mainheader::num_frames, IMG::planeNumber, ecat63_scanheader::prompts, IMG::prompts, IMG::randoms, IMG::start, IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMAINHEADER, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, STATUS_VARMATSIZE, STATUS_WRONGFILETYPE, and IMG::type.
Referenced by imgWriteFrame().
int imgWriteEcat7 | ( | const char * | fname, |
IMG * | img | ||
) |
Write ECAT 7 3D image volume or 3D sinogram.
fname | output filename |
img | pointer to IMG data |
Definition at line 380 of file img_e7.c.
References ecat7_mainheader::bin_size, ecat7_imageheader::data_type, ecat7_scanheader::data_type, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrFactor, ecat7_scanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_SUNI2, ECAT7_TEST, ecat7_val_to_id(), ecat7Create(), ecat7WriteImageMatrix(), ecat7WriteScanMatrix(), IMG::end, ecat7_imageheader::frame_duration, ecat7_scanheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_scanheader::frame_start_time, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_IMAGE, IMG_TYPE_RAW, imgSetEcat7MHeader(), imgSetStatus(), IMG::m, ecat7_scanheader::num_angles, ecat7_imageheader::num_dimensions, ecat7_scanheader::num_dimensions, ecat7_scanheader::num_r_elements, ecat7_scanheader::num_z_elements, ecat7_scanheader::prompts, IMG::prompts, IMG::randoms, ecat7_imageheader::recon_zoom, IMG::resolutionx, IMG::resolutiony, IMG::resolutionz, IMG::sampleDistance, IMG::sizex, IMG::sizey, IMG::sizez, IMG::start, IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, STATUS_UNSUPPORTED, ecat7_scanheader::storage_order, IMG::type, ecat7_imageheader::x_dimension, ecat7_imageheader::x_pixel_size, ecat7_imageheader::x_resolution, ecat7_scanheader::x_resolution, ecat7_imageheader::y_dimension, ecat7_imageheader::y_pixel_size, ecat7_imageheader::y_resolution, ecat7_imageheader::z_dimension, ecat7_imageheader::z_pixel_size, ecat7_imageheader::z_resolution, and IMG::zoom.
Referenced by imgWrite().
int imgWriteEcat7Frame | ( | const char * | fname, |
int | frame_to_write, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Write one PET frame from IMG data struct into ECAT 7 image or sinogram file; format is specified in IMG struct. This function can be called repeatedly to write all frames one at a time to conserve memory. However, file with just mainheader and matrix list without any previous frame is not accepted.
fname | name of file where IMG contents will be written. If file does not exist, it is created. Make sure to delete existing file, unless you want to add data |
frame_to_write | PET frame number (1..frameNr) which will be written: If set to 0, frame data will be written to an existing or new PET file as a new frame, never overwriting existing data. If >0, then frame data is written as specified frame number, overwriting any data existing with the same frame number |
img | pointer to the IMG data struct |
frame_index | IMG frame index (0..dimt-1) which will be written |
Definition at line 1222 of file img_e7.c.
References IMG::_fileFormat, ecat7_mainheader::bin_size, ecat7_imageheader::decay_corr_fctr, IMG::decayCorrFactor, ecat7_scanheader::delayed, ecat7_2Dscanheader::delayed, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ecat7_val_to_id(), ecat7Create(), ecat7ReadMainheader(), ecat7Write2DScanMatrix(), ecat7WriteImageMatrix(), ecat7WriteMainheader(), ecat7WritePolarmapMatrix(), ecat7WriteScanMatrix(), IMG::end, ecat7_imageheader::frame_duration, ecat7_scanheader::frame_duration, ecat7_2Dscanheader::frame_duration, ecat7_polmapheader::frame_duration, ecat7_imageheader::frame_start_time, ecat7_scanheader::frame_start_time, ecat7_2Dscanheader::frame_start_time, ecat7_polmapheader::frame_start_time, IMG_E7, IMG_E7_2D, IMG_POLARMAP, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_RAW, imgEmpty(), imgInit(), imgReadEcat7Header(), imgSetEcat7MHeader(), imgSetEcat7SHeader(), IMG::m, ecat7_mainheader::num_frames, IMG::planeNumber, ecat7_scanheader::prompts, ecat7_2Dscanheader::prompts, IMG::prompts, IMG::randoms, IMG::sampleDistance, IMG::start, IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMAINHEADER, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, STATUS_VARMATSIZE, STATUS_WRONGFILETYPE, and IMG::type.
Referenced by imgWriteFrame().
int imgWriteFrame | ( | const char * | fname, |
int | frame_to_write, | ||
IMG * | img, | ||
int | frame_index | ||
) |
Write one PET frame from IMG data struct into a supported PET image or sinogram file. This function can be called repeatedly to write all frames one at a time to conserve memory.
fname | name of file where IMG contents will be written. Currently supported file formats are ECAT 6.3 images and sinograms, and ECAT 7.x 2D and 3D images and sinograms. Analyze 7.5 images are NOT supported. If file exists, data is either overwritten or catenated as a new frame, depending on the following arguments. If file does not exist, it is created. |
frame_to_write | PET frame number (1..frameNr) which will be written: If set to 0, frame data will be written to an existing or new PET file as a new frame, never overwriting existing data. If >0, then frame data is written as specified frame number, overwriting any data existing with the same frame number |
img | pointer to the IMG data struct |
frame_index | IMG frame index (0..dimt-1) which will be written. |
Definition at line 493 of file imgfile.c.
References IMG::_fileFormat, IMG::dimt, IMG_ANA, IMG_ANA_L, IMG_E63, IMG_E7, IMG_E7_2D, IMG_POLARMAP, IMG_STATUS_OCCUPIED, IMG_TEST, imgFormatFromFName(), imgSetStatus(), imgWriteEcat63Frame(), imgWriteEcat7Frame(), IMG::status, STATUS_FAULT, and STATUS_UNSUPPORTED.
Referenced by imgMicropetPETToEcat7().
int imgWritePolarmap | ( | const char * | fname, |
IMG * | img | ||
) |
Write ECAT 7 polar map.
fname | output filename |
img | pointer to image structure |
Definition at line 606 of file img_e7.c.
References ecat7_mainheader::bin_size, IMG::dimt, IMG::dimx, IMG::dimy, IMG::dimz, ECAT7_TEST, ecat7_val_to_id(), ecat7Create(), ecat7WritePolarmapMatrix(), IMG::end, ecat7_polmapheader::frame_duration, ecat7_polmapheader::frame_start_time, IMG_STATUS_OCCUPIED, IMG_TEST, IMG_TYPE_POLARMAP, imgSetEcat7MHeader(), imgSetEcat7SHeader(), imgSetStatus(), IMG::m, IMG::sampleDistance, IMG::start, IMG::status, STATUS_DISKFULL, STATUS_FAULT, STATUS_NOMEMORY, STATUS_NOWRITEPERM, STATUS_OK, and IMG::type.
Referenced by imgWrite().