M-ECAT(4)
π m-ecat(4) β the CTI ECAT 6/7 medical image format π
okay bestie, welcome to m-ecat, a page from the Kernel Interfaces Manual (yes, section 4, we're fancy). This is the CTI ECAT 6/7 medical image format for (X)MedCon, and girlβ¦ it's a lot. Buckle up. π
π NAME
m-ecat β the CTI ECAT 6/7 medical image format for (X)MedCon.
πΈ DESCRIPTION
This is a painful format. Like, genuinely. You should check the source code for more info. π
Below you will find the specs for the ECAT 6 format. The ECAT 7 format differs a little in header definitions and there is only one matrix entry per volume, while for ECAT 6 files there is one matrix entry per plane. All ECAT image data is written in one file, with the ECAT 6 .img extension or the ECAT 7 .v extension. β¨
π Important Definitions
typedef struct mat_main_header {
char original_file_name[20];
Int16 sw_version;
Int16 data_type;
Int16 system_type;
Int16 file_type;
char node_id[10];
Int16 scan_start_day,
scan_start_month,
scan_start_year,
scan_start_hour,
scan_start_minute,
scan_start_second;
char isotope_code[8];
float isotope_halflife;
char radiopharmaceutical[32];
float gantry_tilt,
gantry_rotation,
bed_elevation;
Int16 rot_source_speed,
wobble_speed,
transm_source_type;
float axial_fov,
transaxial_fov;
Int16 transaxial_samp_mode,
coin_samp_mode,
axial_samp_mode;
float calibration_factor;
Int16 calibration_units,
compression_code;
char study_name[12],
patient_id[16],
patient_name[32],
patient_sex,
patient_age[10],
patient_height[10],
patient_weight[10],
patient_dexterity,
physician_name[32],
operator_name[32],
study_description[32];
Int16 acquisition_type,
bed_type,
septa_type;
char facility_name[20];
Int16 num_planes,
num_frames,
num_gates,
num_bed_pos;
float init_bed_position,
bed_offset[15],
plane_separation;
Int16 lwr_sctr_thres,
lwr_true_thres,
upr_true_thres;
float collimator;
char user_process_code[10];
Int16 acquisition_mode;
} Main_header;
#define MH_64_SIZE 446
typedef struct mat_scan_subheader {
Int16 data_type,
dimension_1,
dimension_2,
smoothing,
processing_code;
float sample_distance,
isotope_halflife;
Int16 frame_duration_sec;
Int32 gate_duration,
r_wave_offset;
float scale_factor;
Int16 scan_min,
scan_max;
Int32 prompts,
delayed,
multiples,
net_trues;
float cor_singles[16],
uncor_singles[16],
tot_avg_cor,
tot_avg_uncor;
Int32 total_coin_rate,
frame_start_time,
frame_duration;
float loss_correction_fctr;
Int32 phy_planes[8];
} Scan_subheader;
#define SSH_64_SIZE 236
typedef struct mat_image_subheader {
Int16 data_type,
num_dimensions,
dimension_1,
dimension_2;
float x_origin,
y_origin,
recon_scale, /* Image ZOOM from reconstruction */
quant_scale; /* Scale Factor */
Int16 image_min,
image_max;
float pixel_size,
slice_width;
Int32 frame_duration,
frame_start_time;
Int16 slice_location,
recon_start_hour,
recon_start_minute,
recon_start_sec;
Int32 gate_duration;
Int16 filter_code;
Int32 scan_matrix_num,
norm_matrix_num,
atten_cor_matrix_num;
float image_rotation,
plane_eff_corr_fctr,
decay_corr_fctr,
loss_corr_fctr,
intrinsic_tilt ;
Int16 processing_code,
quant_units,
recon_start_day,
recon_start_month,
recon_start_year;
float ecat_calibration_fctr,
well_counter_cal_fctr,
filter_params[6];
char annotation[40];
} Image_subheader;
#define ISH_64_SIZE 172
typedef struct mat_norm_subheader {
Int16 data_type,
dimension_1,
dimension_2;
float scale_factor;
Int16 norm_hour,
norm_minute,
norm_second,
norm_day,
norm_month,
norm_year;
float fov_source_width;
float ecat_calib_factor;
} Norm_subheader;
#define NSH_64_SIZE 30
typedef struct mat_attn_subheader {
Int16 data_type,
attenuation_type,
dimension_1,
dimension_2;
float scale_factor,
x_origin,
y_origin,
x_radius,
y_radius,
tilt_angle,
attenuation_coeff,
sample_distance;
} Attn_subheader;
#define ASH_64_SIZE 40
π¦ What does the format support or not support
Okay so here's the vibe check on what it can and can't do:
- Color Map β Supported: grayscale. Not supported:
- - File Endian β Supported: big. Not supported: little
- Pixeltypes β Supported: VAX Int16 (write) | All (read). Not supported:
-
- Scaling factors β quantify & calibrate factors/image are supported π
- Dimensions/Image β different dimensions for each image are NOT supported π
- Pixeltypes/Image β different pixeltypes for each image are NOT supported π
π«Ά NOTES
The (X)MedCon programs also support the reading of sinogram, attenuation and normalization files for conversion purposes, but it does not support writing those file types. In fact, they will be considered as reconstructed data! π
The format supports more pixeltypes. The reason for our restriction of writing only the Int16 type was our ECAT software that only supports the Int16 type. (not us being limited by our own tools, it's giving "it's not me it's the software" π
)
We consider three kinds of images (planes) in an ECAT file:
- plain pixel values
[no unit](ppv = ppv)- the planes/images are NOT normalized
- quantified values
[counts/second/pixel](qpv = ppv * quant_scale)- the planes/images are normalized
- calibrated values
[uCi/ml](cpv = qpv * calibr_fctr)- the planes/images are normalized
β οΈ The float values in the header are stored as VAX format. Periodt.
π FILES
/usr/local/xmedcon/source/m-ecat64.hβ The header file./usr/local/xmedcon/source/m-ecat64.cβ The source file./usr/local/xmedcon/source/m-matrix64.hβ CTI header file./usr/local/xmedcon/source/m-matrix64.cβ CTI source file.
β¨ SEE ALSO
medcon(1), xmedcon(1), xmedcon-config(1)
m-acr(4), m-anlz(4), m-gif(4), m-inw(4), m-intf(4)
π AUTHOR
The (X)MedCon project was originally written by Erik Nolf (eNlf) for the former PET-Centre at Ghent University (Belgium). π
- e-mail:
enlf-at-users.sourceforge.net - www:
http://xmedcon.sourceforge.net
and that's the whole page bestie π This was M-ECAT(4) out of the Kernel Interfaces Manual, page M-ECAT(4) β go drink some water, you read a whole manpage, that's main character energy fr fr π¦β¨
π¦ where this page comes from
- debian trixie: libmdc-dev 0.25.1-gtk3+dfsg-1 Β· GPL-2.0-or-later
- fedora 43: xmedcon-devel 0.25.3-1.fc43 Β· LGPL-2.1-or-later AND LicenseRef-Callaway-Copyright-only AND LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD and libtiff
- fedora 44: xmedcon-devel 0.25.3-2.fc44 Β· LGPL-2.1-or-later AND LicenseRef-Callaway-Copyright-only AND LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD and libtiff
- nixos 26.05: xmedcon 0.26.2
- nixpkgs unstable: xmedcon 0.26.2
- ubuntu questing: libmdc-dev 0.25.1-gtk3+dfsg-1
- ubuntu resolute: libmdc-dev 0.25.1-gtk3+dfsg-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: libmdc-dev 0.26.1-gtk3+dfsg-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms