EyeFlowPython is a clean Python rewrite of EyeFlow focused on downstream analysis.
Important scope change:
- EyeFlowPython does not run AI segmentation.
- Vessel masks are expected to already exist in the input H5 files.
- The application consumes precomputed data and produces biomarkers, quality-control outputs, and exported analysis results.
- Input one H5 file, a folder tree of H5 files, or a zip archive containing H5 files.
- Output one analysis result per input file.
- Preserve the input folder structure in batch and zip processing.
- Provide a CLI and a GUI with the same analysis capabilities.
- Keep the GUI user friendly and oriented around review, configuration, execution, and quality control.
- Produce clean, structured, reproducible outputs.
Create and activate a virtual environment, then install the project.
python -m venv .venv
.\.venv\Scripts\activate
pip install -e .eyeflowRun selected pipelines over one HOLO file, a folder tree of HOLO files, or a zip archive:
eyeflow-cli --data path\to\input.holo --pipelines path\to\pipelines.txt --output path\to\outputs- Loading H5 files containing:
- statistical moments
- precomputed masks
- acquisition metadata
- optional spectral data
- Preprocessing before analysis.
- Velocity and waveform analysis.
- Pulse-wave velocity analysis.
- Cross-section signal generation.
- Cross-section result export and derived hemodynamic metrics.
- Spectral analysis when the required spectral data is present.
- Batch processing from folders and zip archives.
- Persistent user settings for GUI and CLI.
- H5, JSON, and log outputs.
- CPU-first implementation with optional GPU acceleration where useful.
- AI inference inside EyeFlowPython.
- Training or shipping segmentation models.
- Automatic generation of artery and vein masks from raw images.
- Manual mask painting inside the application.
- Full MATLAB visual/report parity for the first Python release.
The GUI may still provide mask visualization and overlay-based quality control, but not mask creation.
The data contract must be strict and documented early. A clean Python implementation depends more on a stable input schema than on UI details.
/moment0- 3D array:
(height, width, frames)
- 3D array:
/moment1- 3D array:
(height, width, frames)
- 3D array:
/moment2- 3D array:
(height, width, frames)
- 3D array:
/masks/artery- 2D binary mask:
(height, width)
- 2D binary mask:
/masks/vein- 2D binary mask:
(height, width)
- 2D binary mask:
/SH- Required only if spectral analysis is enabled.
- Additional masks if useful for QC or downstream analysis
- examples: vessel, background, diaphragm, optic-disc, cross-section exclusions
At least one valid way to recover the time axis and one valid way to recover the spatial scale must be present.
- Frame timing metadata
- preferred: timestamps in microseconds
- fallback: frame rate and stride
- Spatial calibration metadata
- preferred:
pixel_size_mm - fallback: another explicit upstream calibration value already resolved before EyeFlowPython
- preferred:
- Frame range metadata if the source data has already been cropped upstream
- Any metadata needed to interpret units correctly
Do not make EyeFlowPython infer physical units from weak assumptions. If a biomarker depends on time or spatial scale, the needed metadata should be explicitly present in the input.
The application should be structured as a dependency-driven pipeline.
- Validate required datasets and metadata.
- Validate shapes, dtypes, mask consistency, and units.
- Reject malformed inputs early with clear errors.
Preprocessing remains part of the Python app even if masks are already provided.
- frame cropping
- rigid registration
- local normalization
- resizing
- interpolation
- outlier handling
- optional non-rigid registration if still needed
- blood-flow velocity analysis
- arterial and venous waveform analysis
- heartbeat-related metrics
- per-beat and statistical metrics
- pulse-wave velocity
- cross-section signal generation
- cross-section exports
- flow-rate and hemodynamic outputs
- spectral analysis when
SHis available
Some metrics depend on earlier stages. This should be implemented explicitly as a dependency graph, not as scattered conditionals.
Examples:
- preprocessing -> velocity analysis
- velocity analysis -> waveform biomarkers
- velocity analysis -> pulse-wave velocity
- velocity analysis + masks + spatial calibration -> cross-section analysis
- cross-section analysis -> exported cross-section biomarkers
SH+ masks + timing metadata -> spectral analysis
The user must be able to select requested outputs, and the app should automatically execute the required upstream dependencies.
Each processed input should generate a clean result package.
- one result H5 file with structured biomarker datasets
- one result JSON file for scalar and summary outputs
- one execution log file
- one saved copy of the effective analysis settings used for the run
- stable dataset naming
- explicit units
- quality-control fields
- run metadata
- clear failure reporting for partial or skipped modules
Optional figures and visual exports can be added later, but they are not the core deliverable for v1.
The CLI and GUI must expose the same analysis features.
- single-file processing
- folder-tree batch processing
- zip processing
- settings file support through
eyeflow-settings.json - module selection
- clear logging and non-zero exit codes on failure
- Python project managed with a
pyproject.toml - easy setup with a virtual environment
- use standard scientific Python libraries such as
numpy,h5py, and related tooling - modular codebase with small focused files
- clear separation between:
- IO
- validation
- preprocessing
- analysis modules
- exports
- CLI
- GUI
- optional GPU support designed in from the start, but not required for all modules
- The data contract comes first.
- The pipeline must be deterministic and testable.
- Every module should have a clear input and output interface.
- Failures should be local when possible: one failed optional module should not necessarily invalidate the whole run.
- Re-running downstream modules should not require repeating expensive upstream work when cached intermediates are available.
- The codebase should stay readable and easy to extend.
A good first Python release would include:
- strict H5 input validation
- preprocessing
- velocity analysis
- waveform metrics
- cross-section analysis
- H5 and JSON export
- CLI and GUI parity
- settings persistence
- batch and zip support
Then add, in later iterations:
- pulse-wave velocity
- spectral analysis
- richer QC exports
- more visual reports
EyeFlowPython is an analysis application, not a segmentation application.
Its success depends on:
- a strict H5 input schema
- explicit metadata for time and spatial calibration
- a clean dependency-aware analysis pipeline
- consistent outputs across CLI and GUI