Code covered by the BSD License  

Highlights from
imread for multiple life science image file formats

4.5

4.5 | 7 ratings Rate this file 64 Downloads (last 30 days) File Size: 3.7 KB File ID: #32920
image thumbnail

imread for multiple life science image file formats

by

 

16 Sep 2011 (Updated )

imports images and metadata using the LOCI Bioformats package

| Watch this File

File Information
Description

Detailed tutorial of imreadBF:

 http://imageprocessingblog.com/importing-generic-bioimage-files-to-matlab/

Imports formats from Zeiss, Leica, Nikon, Olympus, MetaMorph and others via BioFormats

Amongst others, following formats are supported:
lsm, zvi, ics, nd2, pic, dv, img, tif,

imreadBF loads multiple user-defined image slices at once.
[imageStack]=imreadBF(datname,zplanes,tframes,channel)

You can load multiple z and t slices at once, e.g. zplanes=[1 2 5] loads first,second and fifth z-slice in a 3D-Stack.

imreadBFmeta returns corresponding metadata.

To use the functions, you have to download loci_tools.jar here: http://www.loci.wisc.edu/bio-formats/downloads

make sure to have copied the file loci_tools.jar, in the folder where the
function is placed

modified from bfopen.m

More information about BioFormats:
http://www.loci.wisc.edu/software/bio-formats

MATLAB release MATLAB 7.9 (R2009b)
Other requirements loci_tools.jar( download here http://www.loci.wisc.edu/bio-formats/downloads and place in the same folder as the functions)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
02 Jun 2014 Ignacio

Hi,

I've been trying to use the imreadBFmeta funtion to obtain all of the metadata from my nd2 format files. However, when I run the function I get the following error messages:

No appropriate method, property, or field getMetadata for class
loci.formats.ChannelFiller

Error in ==> imreadBFmeta at 70
metadataList = r.getMetadata();

loci_tools is definitely in the right folder. Do you have any idea what could be wrong?

07 Aug 2013 Elad  
28 Jun 2013 Christoph Moehl

I suggest to use the matlab function from openmicroscopy (see Curtis Ruedens post).

When I published imreadBF here, the original importer bfopen had some drawbacks. But this seems to be solved now.

14 Mar 2013 Curtis Rueden

In response to the various questions being asked here: please try with the most up-to-date MATLAB script and documentation on the official site at:

https://www.openmicroscopy.org/site/support/bio-formats/users/matlab/

If you still have questions or issues, you will have better luck asking for help from the Bio-Formats developers on the OME mailing list (https://www.openmicroscopy.org/site/community/mailing-lists) or OME forums (https://www.openmicroscopy.org/community/).

29 Jan 2013 David Verrelli

Sorry, I accidentally submitted twice.

I also want to ask/comment about two specific problems:

(1) Reading a uint8 file
I open a LIF file which should have intensities 0 to 255, I guess (unless the bit depth is higher???). However, the results returned from this M-file are in the range of int8, that is from -128 to +127. Looking at the frequency histogram, this is clearly wrong. I can fix it like this:
% Begin DIV edit 2013-01-22 %
if sgn == 0,
whos sgn arr
arr = uint8(arr >= 0) .* uint8(arr) + uint8(arr < 0) .* (uint8(arr + 128) + 128);
end;
% End DIV edit 2013-01-22 %

but I notice that the variable
sgn = loci.formats.FormatTools.isSigned(pixelType);
is already defined in the code, but never used for anything (see my previous post). Is there some bug there?

(2) Opening a LIF file
A Leica LIF file can contain multiple series. By default this code opens only the last series. I wonder if there is a way to access (in a controlled way) the other series in the file.

29 Jan 2013 David Verrelli

To use this we need loci_tools.jar here: http://www.loci.wisc.edu/bio-formats/downloads

I am wondering how you know the syntax to access the methods in this jar file.

For example, how do you know to use

arr = loci.common.DataTools.makeDataArray2D(plane, bpp, fp, little, height);

??

I could not find any documentation on this.

29 Jan 2013 David Verrelli

To use this we need loci_tools.jar here: http://www.loci.wisc.edu/bio-formats/downloads

I am wondering how you know the syntax to access the methods in this jar file.

For example, how do you know to use

arr = loci.common.DataTools.makeDataArray2D(plane, bpp, fp, little, height);

??

I could not find any documentation on this.

30 Sep 2012 Omid G

Thank you, but if it is possible put a more detailed manual.

02 Apr 2012 Christoph Moehl

dear zhao and jian jiang

here is a way to read out the java hashtable as strings:

datname='good.oib'
meta=imreadBFmeta(datname);

parameterNames=meta.raw.keySet.toArray
values=meta.raw.values.toArray

This gives you all the rawdata. However, the parameternames are somewhat cryptic and you have to find out what is the important parameter for you.

01 Apr 2012 ZHAO

Very nice tool!
Is the detail imaging information of Olympus oib file in the results of meta.raw? It is a hashtable file ,but how can I get some informaton from it?

16 Jan 2012 Liat

I have oib files which I want to open. I feed the function with the parameters but I get an error message.
What is the input arguments type? Does the file have to be in the same folder?

Thank you

13 Jan 2012 Jian Jiang

Good sofware!
But how to get detailed information of the Olympus/Zeiss figure? For example, the time, rotation and others that saved in the raw files.

Updates
28 Sep 2011

path of loci_tools.jar is now added automatically (code was copied from bfopen.m)

28 Sep 2011

files were completed

02 Aug 2013

updated metadata import

13 Sep 2013

added link to tutorial on image processing blog

Contact us