Bio-formats octave error on bfsave

Hello. I’m experimenting with Octave and bio-formats. Everything seems to work well except on calling bfsave() I get the following error:
error: [java] java.lang.NoSuchMethodException: setPixelsBigEndian
error: called from
createMinimalOMEXMLMetadata at line 61 column 1
bfsave at line 78 column 14

I suspect a problem with my setup - thanks for any suggestions.

Hi @Ian, that does seem like an odd error. I would suspect that there is a missing or conflicted jar file. Do you have any more details on your setup and the version of Bio-Formats you are using?

Hi David I’m using Octave 4.2.2 and the latest bio-formats. I really just wanted to check this wasn’t a known error before I tried re-installing everything.

Thanks

Ian

Hi @Ian,

I was able to reproduce this issue using Octave 4.2.2/Bio-Formats 6.1.1

$ docker run --rm -it openmicroscopy/bio-formats-octave
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
GNU Octave, version 4.2.2
Copyright (C) 2018 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> pkg load bioformats
octave:2> [~,v]=bfCheckJavaPath 
v = 6.1.1
octave:3> bfsave(zeros(100,100,2,1,3), 'test.tiff')
error: [java] java.lang.NoSuchMethodException: setPixelsBigEndian
error: called from
    createMinimalOMEXMLMetadata at line 61 column 1
    bfsave at line 78 column 14

It looks like the issue is related to this metadata call.

It looks like using javaObject works however:

octave:3> OMEXMLService = javaObject('loci.formats.services.OMEXMLServiceImpl');
octave:4> metadata = OMEXMLService.createOMEXMLMetadata();
octave:5> metadata.setPixelsBigEndian(java_get('java.lang.Boolean', 'TRUE'), 0)
error: [java] java.lang.NoSuchMethodException: setPixelsBigEndian
octave:5> metadata.setPixelsBigEndian(javaObject('java.lang.Boolean', 'TRUE'), 0)
ans = [](0x0)
octave:6> metadata.setPixelsBigEndian(javaObject('java.lang.Boolean', 'FALSE'), 0)
ans = [](0x0)
octave:7> metadata.getPixelsBigEndian(0)
ans = 0
octave:8> metadata.setPixelsBigEndian(javaObject('java.lang.Boolean', 'TRUE'), 0)
ans = [](0x0)
octave:9> metadata.getPixelsBigEndian(0)
ans = 1

So it is possible the following change in createMinimalOMEXMLMetadata is sufficient to fix the behavior of bfsave if you wanted to test it locally:

-  java_true = java_get('java.lang.Boolean', 'TRUE');
+  java_true = javaObject('java.lang.Boolean', 'TRUE');

We will open a change on the Bio-Formats code repository and review this change. Once ready, it will be released in an upcoming patch release.

Sebastien

Many thanks Sebasttien. I’ll try that and let you know how it goes.

Ian

Le lun. 15 juil. 2019 à 10:09, Sébastien Besson via Image.sc Forum imagej@discoursemail.com a écrit :

After a quick test that seems to have done the trick . Thanks again.

Ian