Skip to content

ISET python plan

Brian Wandell edited this page Sep 1, 2026 · 1 revision

Strategy 1: A Targeted, Standalone "Core" Python Package (Recommended)

Instead of porting the entire extensive ISET suite, extract and port only the essential, high-demand front-end modules into a clean, lightweight Python package (e.g., pyiset or isetcore).

  • What goes into Python:
    • Scene spectral radiance representation and basic illumination spectra.
    • Human optical transfer functions / wavefront optics.
    • Cone mosaic generation, spectral absorptance, and photopigment isomerizations.
    • Basic sensor pixel response and Poisson/read noise simulation.
  • What stays in MATLAB:
    • Complex GUIs, legacy analysis scripts, deep device calibration tools, and niche hardware interfaces.
  • Why it works: It satisfies 90% of what external ML/vision researchers want—an image-computable, biophysically accurate front end they can drop into a PyTorch Dataset or training loop—without having to maintain the other 80% of legacy tooling.

Strategy 2: Python Bindings via MATLAB Compiler SDK

If maintaining separate logic is unacceptable, generate a native Python package directly from the validated MATLAB codebase.

  • How it works: Use the MATLAB Compiler SDK to build a standalone Python wheel (import isetcam).
  • Pros: Exactly one codebase to maintain. Zero porting errors. Free for end users (requires only the free MATLAB Runtime installer).
  • Cons: Slower startup times, large runtime binaries, and harder for the open-source Python community to contribute directly.

Strategy 3: Clean Transition (Commitment to One)

If the upcoming textbook revision and documentation push represent a long-term milestone, treat Python as the future standard:

  • Modern Python (using @dataclass, Pydantic for validation, and NumPy/SciPy) allows for much cleaner object-oriented representations than traditional MATLAB structs.
  • Build automated regression tests comparing the new Python outputs directly against the ground-truth MATLAB matrices.
  • Once the core is verified and documented alongside the book, freeze the MATLAB codebase as the stable legacy release and point new users to Python.

A Sensible Next Step

If you want to test the waters without committing to a full rewrite, start with one fundamental pipeline—for example, multispectral scene $\rightarrow$ optical blur / PSF $\rightarrow$ cone isomerizations.

Setting up a clean Python implementation for just that core calculation will show immediately whether the modern syntax and integration with NumPy/PyTorch feel worth expanding, or if the MATLAB foundation remains the right primary home for the project.

Clone this wiki locally