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

Jay Warrick jay.w.warrick at gmail.com
Tue Mar 3 10:42:07 CST 2015


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 <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]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150303/b48a001e/attachment.html>


More information about the ImageJ-devel mailing list