Open
Conversation
digital-pro
reviewed
Jul 25, 2025
sensor/sensorCreate.m
Outdated
| [data, ~] = ieReadColorFilter(wave, qeFile); | ||
|
|
||
| % Hardcoded filter names (since Octave can't read the cell array from .mat) | ||
| filterNames = {'r', 'g', 'b'}; |
Collaborator
There was a problem hiding this comment.
Can we tell whether we're running under Octave and only hardcode the filter names if we are?
Collaborator
|
Maybe Ayush can insert an ‘isOctave’ test at the relevant locations?
function retval = isOctave
persistent cacheval;
if isempty (cacheval)
cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0);
end
retval = cacheval;
end
Putting it in the relevant spots has some value because we then know which parts of the code are modified for Octave – which I think is a great thing.
(Very glad that people could use Octave.)
From: David Cardinal ***@***.***>
Date: Friday, July 25, 2025 at 2:47 PM
To: ISET/isetcam ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [ISET/isetcam] Octave Support for `isetcam` (PR #37)
@digital-pro commented on this pull request.
________________________________
In sensor/sensorCreate.m<#37 (comment)>:
@@ -357,10 +357,14 @@
end
qeFile = fullfile(isetRootPath,'data','sensor','colorfilters','OVT','ovt-large.mat');
- wave = sensorGet(sensor,'wave');
- [data,filterNames] = ieReadColorFilter(wave,qeFile);
- sensor = sensorSet(sensor,'filter spectra',data);
- sensor = sensorSet(sensor,'filter names',filterNames);
+ wave = sensorGet(sensor, 'wave');
+ [data, ~] = ieReadColorFilter(wave, qeFile);
+
+ % Hardcoded filter names (since Octave can't read the cell array from .mat)
+ filterNames = {'r', 'g', 'b'};
Can we tell whether we're running under Octave and only hardcode the filter names if we are?
—
Reply to this email directly, view it on GitHub<#37 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOAQWLGPLQDSMRVVPO22JD3KKQVLAVCNFSM6AAAAACCKKV4NWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTANJWHA3DCMBSGQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Collaborator
|
Brian's function looks like a good way to address the issue. That way the changes will be isolated to Octave users. Otherwise I don't think we have enough test coverage in our validation suite to make sure something subtle isn't broken for Matlab users. In any case, as Brian said, this is really cool! |
Author
|
Yes, I can indeed add an Glad you found this useful! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While ISET is an amazing simulation tool, it depends on its user's having paid MATLAB licenses which might not be accessible to all individuals and organizations interested in using the toolbox.
GNU Octave is a free and open-source alternative for MATLAB. It imitates most MATLAB functionality with code and CLI but has different libraries, toolboxes, and datatypes. One third-party package of importance in
isethdrsensorisopenexr. With help from Brian and David, I was able to modify the current ISET codebase to work with Octave 6.4.0.The changes are briefly described at the end of
README.mdand the necessary packages are listed inenvironment.ymland `octave-requirements.txt.This PR goes along with the two others opened in
iset3d-tinyandisethdrsensorrepos. All these branches are nameddev-octave. I have tested this code on Octave 6.4.0.Hope this helps extend access to ISET!