We're Hiring!

Read CZI in MATLAB

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.

Read CZI in MATLAB

Postby cherrie » Mon Aug 17, 2015 12:47 pm

Hi there

I am having trouble reading Zeiss .CZI files in MATLAB R2014b, using bfopen().

The same bioformats_package.jar (tested builds (a)11 May 2015 and (b) 17 July 2015) is able to read the same file in ImageJ (1.45s). Bio-formats MATLAB Toolbox is version 5.1.3, downloaded today moments ago. The same MATLAB Toolbox can read the file and pixel sizes when it has been exported as a TIFF stack from ImageJ. The error message in MATLAB is the same regardless of bioformats_package.jar and occurs in bfGetReader:

Error using bfGetReader (line 85)
Java exception occurred:
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:454)
at java.lang.Integer.parseInt(Integer.java:527)
at loci.formats.in.ZeissCZIReader.translateExperiment(ZeissCZIReader.java:1889)
at loci.formats.in.ZeissCZIReader.translateMetadata(ZeissCZIReader.java:980)
at loci.formats.in.ZeissCZIReader.initFile(ZeissCZIReader.java:553)
at loci.formats.FormatReader.setId(FormatReader.java:1244)
at loci.formats.ImageReader.setId(ImageReader.java:727)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:529)
at loci.formats.ChannelFiller.setId(ChannelFiller.java:263)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:529)
at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:274)

Error in bfopen (line 114)
r = bfGetReader(id, stitchFiles);

Any help would be greatly appreciated.

Best wishes,
Cherrie
cherrie
 
Posts: 2
Joined: Tue Aug 11, 2015 2:32 pm

Re: Read CZI in MATLAB

Postby sbesson » Mon Aug 17, 2015 3:31 pm

Hi Cherrie,

from the error lines in you stack trace, it does not look like the version of Bio-Formats used in MATLAB is actually 5.1.3. What is the output of the following command?

>> [~,version] = bfCheckJavaPath


If this does not 5.1.3 as I suspect, it might be you have an outdated Bio-Formats JAR shadowing the new JAR and you may want to double check the content of your Java classpath using:

>> javaclasspath


Let us know if this solves your issue,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Read CZI in MATLAB

Postby sbesson » Mon Aug 17, 2015 4:47 pm

Hi Cherrie,

fantastic. Glad to hear the issue was a simple outdated JAR.

Regarding physical pixel size, I assume you have upgraded from a 5.0.x version of Bio-Formats. Since 5.1.0, Bio-Formats now stores some OME-XML metadata, especially length and time metadata, as Quantity objects, i.e. including both the value and the unit.

Instructions for unwrapping the physical pixel size from the Length objects can be found on the Using Bio-Formats in MATLAB documentation page.

Let us know if anything is unclear,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Read CZI in MATLAB

Postby cherrie » Mon Aug 17, 2015 5:28 pm

Hi Sebastien

Thanks for replying so quickly again- yes I saw that it had changed to ...value() instead of getValue(), so I deleted my reply and was going to write a new one with the "stupid" question removed.

Thank you so much for your help!

Best wishes,
Cherrie
cherrie
 
Posts: 2
Joined: Tue Aug 11, 2015 2:32 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest