Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,20 @@ A set of tutorial videos introducing aspects of ISETCam and the companion tool f
* May 10, 2024 We work more smoothly with EXR files, including sceneFromFile now reading in EXR files, and writing out sensor2EXR) This work was implemented for the extensions to HDR imaging and application of the Restormer PyTorch network for demosaicing sensor data.
* April 15, 2024 Implemented a remote copy function ieSCP, to help with the distributed nature of our assets and datafiles

## Octave Support
- July 14, 2025: Ayush Jamdar.
- New: A function `isOctave` tests if code is being run in Octave and uses modified code accordingly.
- GNU Octave is an free open-source alternative to MATLAB. While MATLAB (> R2022b) has its own tools to read `exr` files, Octave doesn't have native support for this and relies on other tools like `openexr`.
- We have added/modified `exrinfo.cpp`, `exrread.cpp`, `exrreadchannels.cpp`, `exrwrite.cpp`, and `exrwritechannels.cpp` to work with Octave-compatible headers and datatypes.
- These readers and writers are completely based on OpenEXR tools. One doesn't need MATLAB to run these scripts.
- `make.m` calls `mkoctfile` with the `--mex` flag so that the executable functions hence generated can be called by Octave.
- We've added `octave-functions/` that replicate the behaviour of certain MATLAB functions.
- We only used the Octave CLI; the `ipWindow` GUIs don't yet work.
- We have tested `isethdrsensor/scripts/fullSimulation.m` on examples from the ISET HDR dataset.
- Known warnings that Octave throws:
- Octave can't read `filterNames` from the `.mat` files. As a temporary fix, we've hardcoded r, g, b filter names.
- After the recent updates to `isetcam/main`, Octave throws a new but benign warning "Invalid UTF-8 byte sequences have been replaced."

## Instructions for Octave Packages
- Get kernel-level packages for a conda environment from `environment.yml`
- Get packages for Octave as listed in `octave-requirements.txt`
218 changes: 218 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
name: octave-env
channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- _x86_64-microarch-level=4
- alsa-lib=1.2.14
- arpack=3.9.1
- attr=2.5.1
- binutils=2.44
- binutils_impl_linux-64=2.44
- binutils_linux-64=2.44
- bzip2=1.0.8
- c-ares=1.34.5
- c-compiler=1.10.0
- ca-certificates=2025.7.9
- cairo=1.18.4
- curl=8.14.1
- cxx-compiler=1.10.0
- cyrus-sasl=2.1.28
- dbus=1.16.2
- fftw=3.3.10
- fltk=1.3.10
- font-ttf-dejavu-sans-mono=2.37
- font-ttf-inconsolata=3.000
- font-ttf-source-code-pro=2.038
- font-ttf-ubuntu=0.83
- fontconfig=2.15.0
- fonts-conda-ecosystem=1
- fonts-conda-forge=1
- freetype=2.13.3
- fribidi=1.0.10
- gcc=13.3.0
- gcc_impl_linux-64=13.3.0
- gcc_linux-64=13.3.0
- gettext=0.25.1
- gettext-tools=0.25.1
- gfortran=13.3.0
- gfortran_impl_linux-64=13.3.0
- gfortran_linux-64=13.3.0
- ghostscript=10.04.0
- giflib=5.2.2
- gl2ps=1.4.2
- glib=2.84.2
- glib-tools=2.84.2
- glpk=5.0
- gmp=6.3.0
- gnuplot=5.4.10
- graphicsmagick=1.3.45
- graphite2=1.3.14
- gst-plugins-base=1.24.11
- gstreamer=1.24.11
- gxx=13.3.0
- gxx_impl_linux-64=13.3.0
- gxx_linux-64=13.3.0
- harfbuzz=11.2.1
- hdf5=1.14.6
- icu=75.1
- imath=3.1.12
- intel-openmp=2022.0.1
- kernel-headers_linux-64=3.10.0
- keyutils=1.6.1
- krb5=1.21.3
- lame=3.100
- ld_impl_linux-64=2.44
- lerc=4.0.0
- libaec=1.1.4
- libamd=3.3.3
- libasprintf=0.25.1
- libasprintf-devel=0.25.1
- libblas=3.9.0
- libbtf=2.3.2
- libcamd=3.3.3
- libcap=2.75
- libcblas=3.9.0
- libccolamd=3.3.4
- libcholmod=5.3.1
- libclang-cpp20.1=20.1.7
- libclang13=20.1.7
- libcolamd=3.3.4
- libcups=2.3.3
- libcurl=8.14.1
- libcxsparse=4.4.1
- libdeflate=1.24
- libdrm=2.4.125
- libedit=3.1.20250104
- libegl=1.7.0
- libev=4.33
- libevent=2.1.12
- libexpat=2.7.0
- libffi=3.4.6
- libflac=1.4.3
- libfreetype=2.13.3
- libfreetype6=2.13.3
- libgcc=15.1.0
- libgcc-devel_linux-64=13.3.0
- libgcc-ng=15.1.0
- libgcrypt-lib=1.11.1
- libgd=2.3.3
- libgettextpo=0.25.1
- libgettextpo-devel=0.25.1
- libgfortran=15.1.0
- libgfortran-ng=15.1.0
- libgfortran5=15.1.0
- libgl=1.7.0
- libglib=2.84.2
- libglu=9.0.3
- libglvnd=1.7.0
- libglx=1.7.0
- libgomp=15.1.0
- libgpg-error=1.55
- libiconv=1.18
- libjpeg-turbo=3.1.0
- libklu=2.3.5
- liblapack=3.9.0
- liblapacke=3.9.0
- libldl=3.3.2
- libllvm20=20.1.8
- liblzma=5.8.1
- liblzma-devel=5.8.1
- libmpdec=4.0.0
- libnghttp2=1.64.0
- libntlm=1.8
- libogg=1.3.5
- libopenblas=0.3.30
- libopengl=1.7.0
- libopus=1.5.2
- libparu=1.0.0
- libpciaccess=0.18
- libpng=1.6.50
- libpq=17.5
- librbio=4.3.4
- libsanitizer=13.3.0
- libsndfile=1.2.2
- libspex=3.2.3
- libspqr=4.3.4
- libsqlite=3.50.2
- libssh2=1.11.1
- libstdcxx=15.1.0
- libstdcxx-devel_linux-64=13.3.0
- libstdcxx-ng=15.1.0
- libsuitesparseconfig=7.10.1
- libsystemd0=257.7
- libtiff=4.7.0
- libumfpack=6.3.5
- libuuid=2.38.1
- libvorbis=1.3.7
- libwebp=1.6.0
- libwebp-base=1.6.0
- libxcb=1.17.0
- libxcrypt=4.4.36
- libxkbcommon=1.10.0
- libxml2=2.13.8
- libzlib=1.3.1
- lz4-c=1.10.0
- metis=5.1.0
- mkl=2022.1.0
- mpfr=4.2.1
- mpg123=1.32.9
- ncurses=6.5
- nspr=4.36
- nss=3.113
- octave=9.4.0
- openexr=3.3.4
- openldap=2.6.10
- openssl=3.5.1
- packaging=25.0
- pango=1.56.4
- pcre=8.45
- pcre2=10.45
- perl=5.32.1
- pip=25.1.1
- pixman=0.46.2
- ply=3.11
- portaudio=19.7.0
- pthread-stubs=0.4
- pulseaudio-client=17.0
- pyqt=5.15.11
- pyqt5-sip=12.17.0
- python=3.13.5
- python_abi=3.13
- qhull=2020.2
- qscintilla2=2.14.1
- qt-main=5.15.15
- readline=8.2
- setuptools=80.9.0
- sip=6.10.0
- suitesparse=7.10.1
- sundials=7.3.0
- sysroot_linux-64=2.17
- texinfo=7.2
- tk=8.6.13
- toml=0.10.2
- tomli=2.2.1
- tzdata=2025b
- xcb-util=0.4.1
- xcb-util-image=0.4.0
- xcb-util-keysyms=0.4.1
- xcb-util-renderutil=0.3.10
- xcb-util-wm=0.4.2
- xkeyboard-config=2.45
- xorg-libice=1.1.2
- xorg-libsm=1.2.6
- xorg-libx11=1.8.12
- xorg-libxau=1.0.12
- xorg-libxcomposite=0.4.6
- xorg-libxdamage=1.1.6
- xorg-libxdmcp=1.1.5
- xorg-libxext=1.3.6
- xorg-libxfixes=6.0.1
- xorg-libxrender=0.9.12
- xorg-libxshmfence=1.3.3
- xorg-libxxf86vm=1.1.6
- zlib=1.3.1
- zstd=1.5.7
prefix: /home/OVT/ayush.jamdar/miniconda3/envs/iset-lfm
7 changes: 6 additions & 1 deletion imgproc/openexr/ImfToMatlab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
#include <cassert>

#include <mex.h>
#include <matrix.h>

#ifdef OCTAVE
// #include <matrix.h>
#else
#include <matrix.h>
#endif

#ifdef __clang__
#pragma clang diagnostic push
Expand Down
8 changes: 6 additions & 2 deletions imgproc/openexr/ImfToMatlab.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
#pragma once

#include <mex.h>

#include <ImfNamespace.h>
#include <ImfAttribute.h>

#ifdef OCTAVE
// #include <ImfNamespace.h>
#else
#include <ImfNamespace.h>
#endif


// Utilities to convert from OpenEXR types to Matlab types

Expand Down
11 changes: 9 additions & 2 deletions imgproc/openexr/MatlabToImf.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,17 @@ inline void convertData(TargetType * dest,

switch(srcType) {
case mxDOUBLE_CLASS:
convertData<real64_T>(dest, pa, len);
#ifdef OCTAVE
convertData<double>(dest, pa, len);
#else
convertData<real64_T>(dest, pa, len);
break;
case mxSINGLE_CLASS:
convertData<real32_T>(dest, pa, len);
#ifdef OCTAVE
convertData<float>(dest, pa, len);
#else
convertData<real32_T>(dest, pa, len);
#endif
break;
case mxINT8_CLASS:
convertData<int8_T>(dest, pa, len);
Expand Down
8 changes: 8 additions & 0 deletions imgproc/openexr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ You may also need to update `~/.matlab/YOUR_MATLAB_VERSION/mexopts.sh` (e.g. in
300 300 3

>> exrwrite(a, 'a.exr');


# Octave Support
- July 24, 2025: Ayush Jamdar
- New: Added `#ifdef OCTAVE` tests in cpp files. During compile, Octave's `mkoctfile` defines a macro `OCTAVE` automatically. MATLAB does not.
- Modified `cpp` files to generate `mex` executables compatible with Octave.
- Run `make.m` to generage the executable functions.
- The `dev-octave` branch has been tested to work with Octave 6.4.0
Loading