Skip to content

Conversation

@brandonjnelsonFDA
Copy link
Member

This PR addresses multiple issues preventing the Octave/MATLAB demos from running successfully, specifically targeting the bugs reported in Issue #14. It also adds a comprehensive integration test suite to ensure all demos (Python and Octave) continue to work in the future.

Fixes for Issue #14

This PR resolves the following specific points raised in Issue #14:

  1. Correct Path Construction & Directory Iteration:
  • Fixed demo_03_tworecon_dosecurve_LCD.m to correctly discover and iterate through dose_* subdirectories. Previously, it passed the parent reconstruction directory directly to measure_LCD, causing "File not found" errors because measure_LCD expects to find signal_present/ immediately within the target directory.
  1. writetable / Table Compatibility:
  • Updated src/lcdct/measure_LCD.m to explicitly return a table (using struct2table) instead of a struct when running in Octave. This resolves the downstream compatibility issues with writetable and plot_results.
  • Fixed src/lcdct/write_lcd_results.m to robustly handle cell-array string columns (like recon and observer) which can occur in Octave tables, preventing type errors during CSV generation.
  1. Environment & Dependencies:
  • Added checks for the tablicious package in Octave, which is required for table support.

Additional Changes

Integration Tests: Added

  • tests/test_integration_demos.py
    which runs:
  • All Python demos (demo_01, demo_02, demo_03).
  • All Octave demos (demo_01, demo_02, demo_03) via subprocess.
  • This ensures end-to-end verification of the example scripts in both languages.

Verification

Ran pytest tests/test_integration_demos.py locally.
Confirmed all 6 tests (3 Python, 3 Octave) passed.
Closes #14

google-labs-jules bot and others added 11 commits January 17, 2026 21:18
- Refactored `measure_LCD.m` to support flexible input arguments (directory path vs image arrays) using `varargin`, matching demo usage.
- Fixed observer instantiation loop to correctly handle object instances, preventing crashes when observers are passed as objects.
- Updated `measure_LCD` to return a `table` (in MATLAB) or struct (in Octave) with `diameter` and `dose_level` columns, ensuring compatibility with `write_lcd_results`.
- Updated `demo_01_singlerecon_LCD.m` and `demo_02_tworecon_LCD.m` to explicitly set `dose_level` in results.
- Added comprehensive unit tests (`tests/test_measure_LCD.m`) covering directory inputs, array inputs, and observer handling.
- Added GitHub Actions workflow (`.github/workflows/matlab_tests.yml`) to run tests on Ubuntu using Octave.
- Refactored `measure_LCD.m` to support flexible input arguments (directory path vs image arrays) using `varargin`, matching demo usage.
- Fixed observer instantiation loop to correctly handle object instances, preventing crashes when observers are passed as objects.
- Updated `measure_LCD` to return a `table` (in MATLAB) or struct (in Octave) with `diameter` and `dose_level` columns, ensuring compatibility with `write_lcd_results`.
- Updated `demo_01_singlerecon_LCD.m` and `demo_02_tworecon_LCD.m` to explicitly set `dose_level` in results.
- Added comprehensive unit tests (`tests/test_measure_LCD.m`) covering directory inputs, array inputs, and observer handling.
- Added GitHub Actions workflow (`.github/workflows/matlab_tests.yml`) to run tests on Ubuntu using Octave.
- Added comprehensive Python unit tests (`tests/test_lcd_python.py`) covering basic functionality, different observers, and object inputs.
- Added GitHub Actions workflow (`.github/workflows/python_tests.yml`) to run Python tests on multiple Python versions.
…ty-15639152124994219495

Fix compatibility issues in measure_LCD and demos and add unit tests
…ult writing for recon and observer fields, and standardize table creation in the measurement function.
- Added `liboctave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation.
- Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml`.
- Updated `tablicious` version from 0.3.7 to 0.4.5 in `install.sh`.
- Added `octave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation.
- Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml`.
- Updated `tablicious` version from 0.3.7 to 0.4.5 in `install.sh`.
- Added `octave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation.
- Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml` and `install.sh`.
- Updated `tests/test_measure_LCD.m` to correctly handle `tablicious` table outputs in Octave (using `istable` instead of `isfield`).
…l-12027862352368848439

Fix Octave CI missing headers and update tablicious
@brandonjnelsonFDA brandonjnelsonFDA merged commit fe94e61 into DIDSR:main Jan 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical issues running MATLAB demos (demo_01 & demo_02): Argument mismatches and Logic errors

1 participant