[ImageJ-devel] Scifio question - how to use (recently updated) bioformats proprietary formats (programmatically)

Curtis Rueden ctrueden at wisc.edu
Tue Mar 3 11:28:59 CST 2015


Hi Jay,

> I thought it used to be automatic upon adding the scifio and
> scifio-bf-compat dependencies.

Yeah, that's correct.

> A "limited" list of 30 formats show up in the DefaultFormatService
> currently and don't include ND2.

The format that supports ND2 (and all Bio-Formats formats) is the
"Bio-Formats Compatibility Format" at the front of your list.

You'll need to debug into the code to find out why the BioFormatsFormat is
not being selected properly for your ND2 file.

> It looks like the parent pom of scifio-bf-compat (pom-scijava)
> specifies <bio-formats.version>5.0.7</bio-formats.version>.
> Is it likely to be "risky" to leverage the most recent changes
> for ND2 compatibility?

Yes, it will not work. The scifio-bf-compat component has not yet been
updated to use the Bio-Formats 5.1.x codebase.

The good news is: updating it to use the OME 5.1 API was easy. I pushed a
branch:

https://github.com/scifio/scifio-bf-compat/compare/ome-5.1

You can use it during development by:

* Cloning scifio-bf-compat.
* Switching to the ome-5.1 branch.
* Importing scifio-bf-compat into your Eclipse.
* Setting your project's bio-formats.version property to 5.1.0-SNAPSHOT.
* Setting your project's scifio-bf-compat.version property to
1.11.1-SNAPSHOT.

And then Eclipse should switch to a project coupling for scifio-bf-compat
and use the branch.

But you'll want to stay on a corresponding branch of your own project
development until the OME 5.1.0 release.

Regards,
Curtis

On Tue, Mar 3, 2015 at 10:42 AM, Jay Warrick <jay.w.warrick at gmail.com>
wrote:

> Hi All,
>
> I have 2 problems you all hopefully have suggestions for... (thanks in
> advance)
>
> *Problem 1:*
>
> I'm interested in opening ND2 file format programmatically in Java via a
> SCIFIO object used with an ImageJ context but can't seem to get it to work.
> (see listing A) Error message indicates format not found.
>
> Hopefully relevant details of what I am currently doing with maven imports
> are below. (see listing B)
>
> Suggestions? Is there a BioFormats dependency I am not bringing in that is
> necessary to expose/discover all the additional proprietary formats or do I
> have to add the proprietary formats myself using a combination of a
> bioformats artifact I'm not aware of and adding each format using the
> mechanism provided by scifio-bf-compat? I thought it used to be automatic
> upon adding the scifio and scifio-bf-compat dependencies. Any help is
> appreciated. I looked in scifio tutorials but couldn't figure it out. Sorry.
>
> *Problem 2:*
>
> After resolution of problem 1, I'd like to leverage recent changes to the
> bioformats package that addresses a bug in ND2 metadata handling that was
> affecting me (https://trac.openmicroscopy.org.uk/ome/ticket/12548). The
> link suggests using bioformats 5.1.x vs 5.0.x which also requires use a few
> other updated jars (as noted near end of ticket). Suggestions on the best
> way to do this given my use case? It looks like the parent pom of
> scifio-bf-compat (pom-scijava)
> specifies <bio-formats.version>5.0.7</bio-formats.version>. Is it likely to
> be "risky" to leverage the most recent changes for ND2 compatibility?
>
> Thanks,
>
> Jay
>
> %%%%%%%%%%%%%
> Listing A
> %%%%%%%%%%%%%
>
> final SCIFIO scifio = new SCIFIO(ij.getContext());
> Reader reader;
> try
> {
> reader = scifio.initializer().initializeReader(nd2File, new
>  SCIFIOConfig().checkerSetOpen(true));
> }
> catch (Exception e)
> {
> e.printStackTrace();
> return false;
> }
>
>
> %%%%%%%%%%%%%
> Listing B
> %%%%%%%%%%%%%
>
> My project parent pom is
>
> <parent>
> <groupId>net.imagej</groupId>
> <artifactId>pom-imagej</artifactId>
> <version>5.12.0</version>
> </parent>
>
>  I have the following maven dependencies
>
> <dependency>
> <groupId>io.scif</groupId>
> <artifactId>scifio</artifactId>
> </dependency>
> <dependency>
> <groupId>io.scif</groupId>
> <artifactId>scifio-bf-compat</artifactId>
> <scope>runtime</scope>
> </dependency>
>
> A "limited" list of 30 formats show up in the DefaultFormatService
> currently and don't include ND2. (see Listing C)
>
>
> %%%%%%%%%%%%%
> Listing C
> %%%%%%%%%%%%%
>
> (*) Formats in DefaultFormatService
>
> ImageJ ij = new ImageJ();
> Set<Format> formats = ij.scifio().format().getAllFormats();
>
> returns
>
> [Bio-Formats Compatibility Format, Animated PNG, Audio Video Interleave,
> Windows Bitmap, DICOM, Encapsulated PostScript, Flexible Image Transport
> System, Simulated data, Graphics Interchange Format, Image Cytometry
> Standard, JPEG-2000, JPEG, Java source code, Multiple Network Graphics,
> Micro-Manager, NRRD, OBF, PCX, Portable Gray Map, Text, Zip, QuickTime,
> PICT, plugin:class io.scif.ome.formats.OMEXMLFormat, Tile JPEG, QuickTime,
> plugin:class io.scif.ome.formats.OMETIFFFormat, Tagged Image File Format,
> Minimal TIFF, Tagged Image File Format]
>
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150303/c0e57b98/attachment-0001.html>


More information about the ImageJ-devel mailing list