We're Hiring!

Matlab R2017b and bfopen error

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

Matlab R2017b and bfopen error

Postby Ajaxel » Wed Sep 27, 2017 2:34 pm

Hello,
after update of Matlab to R2017b use of bfopen gives an error. I believe it has something to do with java version that Matlab is using because on R2017a everything is fine.
Is there a way to fix this?

The command I used to open a file:
data = bfopen('d:\DataMix\PLSNLS\07_PLSNLS.zvi');

Error message in R2017b:

Error using bfGetReader (line 75)
Java exception occurred:
java.lang.NoSuchFieldError: MICROMETER
at loci.formats.in.NiftiReader.<init>(NiftiReader.java:78)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at loci.formats.ImageReader.<init>(ImageReader.java:129)
at loci.formats.in.FilePatternReader.<init>(FilePatternReader.java:77)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at loci.formats.ImageReader.<init>(ImageReader.java:129)
at loci.formats.ImageReader.<init>(ImageReader.java:116)
at loci.formats.ReaderWrapper.<init>(ReaderWrapper.java:61)
at loci.formats.ChannelFiller.<init>(ChannelFiller.java:71)
Error in bfopen (line 114)
r = bfGetReader(id, stitchFiles);

Java version in R2017a:
Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

Java version in R2017b:
Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode

BioFormats version: 5.7.1 (2017 September 20)

Thanks!
Ilya
Ajaxel
 
Posts: 14
Joined: Mon Apr 22, 2013 8:33 pm

Re: Matlab R2017b and bfopen error

Postby dgault » Thu Sep 28, 2017 10:43 am

Hi Ilya,

That error would suggest there has been a mismatch of 2 different Bio-Formats versions. When you upgraded did you reinstall the Bio-Formats Matlab toolbox? Also are there any other Bio-Formats or OME jar files in your Matlab path other than bioformats_package.jar?

David Gault
User avatar
dgault
Team Member
 
Posts: 208
Joined: Fri Aug 14, 2015 2:56 pm

Re: Matlab R2017b and bfopen error

Postby Ajaxel » Thu Sep 28, 2017 12:51 pm

Hi David,
thank you for the suggestion!
Indeed it seems to be the case.

The following command caused the error:
Code: Select all
% Create a loci.formats.ReaderWrapper object
r = javaObject('loci.formats.ChannelSeparator', ...
               javaObject('loci.formats.ChannelFiller'));


And the reason was due to omero_client.jar library before bioformats_package.jar in the path. I updated omero from 5.2.7 to 5.3.4 and now it looks fine.
Thanks a lot again!

Ilya
Ajaxel
 
Posts: 14
Joined: Mon Apr 22, 2013 8:33 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 0 guests