This repository contains the reproducible Python workflow used to compare three-dimensional electrical capacitance tomography (ECT) sensitivity matrices on a shared equal-volume cylindrical basis. It computes global spectral and spatial criteria, electrode-pair group summaries, greedy measurement subsets, and paired spherical-phantom image-reconstruction metrics.
- Open this repository folder as a PyCharm project.
- Select a Python 3.12 interpreter or create a new virtual environment.
- Install the packages from
requirements.txtusing PyCharm's Python Interpreter window. - Put the MATLAB v7.3 files
meshA.matthroughmeshO.matinmatrices/. - Open
main.pyand edit only thePYCHARM_CONFIGblock if required. - Right-click
main.pyand select Run 'main', or press the green Run button whilemain.pyis the current file.
No command-line arguments are required for the publication workflow. Paths in
PYCHARM_CONFIG are resolved relative to main.py, not to PyCharm's working
directory.
Open run_self_test.py and press Run. A correct installation prints:
SELF-TEST PASSED
The self-test does not require the .mat input files and does not generate the
publication results.
Each MATLAB v7.3/HDF5 file must contain:
S: sensitivity matrix, with one dimension equal to the tetrahedron count;vtx: mesh vertices, orientable asN x 3;simp: tetrahedral connectivity, orientable asM x 4.
The default publication configuration expects 32 electrodes and 496 unordered measurement channels for each of the 15 configurations A--O.
The default run creates SIMPAT_results/ with:
tables/: scorecards, selected channels, phantom metrics, statistical comparisons, and automated quality checks;figures/: publication figures generated from the same run;run_manifest.json: parameters, software versions, input hashes, grid definition, and interpretation notes.
The random seed and matched noise draws are fixed in PYCHARM_CONFIG.
main.py PyCharm entry point and editable configuration
run_self_test.py PyCharm installation test
ect_analysis/
cli.py argument validation and file discovery
mesh.py MATLAB/HDF5 loading and common-grid mapping
models.py shared data classes
metrics.py spectral and spatial criteria
channels.py electrode-pair classes and greedy selection
phantoms.py phantom generation, inversion, and statistics
plotting.py publication figures
reporting.py CSV, JSON, and checksum utilities
pipeline.py explicit end-to-end analysis orchestration
tests/ automated regression tests
Before submission, the exact code release and shareable sensitivity matrices should be archived in Zenodo. The Zenodo DOI should be cited in the manuscript; GitHub can remain the actively maintained development repository.
The software and data licences must be selected after confirming institutional rights to distribute the code and matrices.