OME / bio-formats / Metadata type error

bio-formats
Tags: #<Tag:0x00007fd542040f78>

#1

Hello everybody,

I’m trying to get the timing metadata from an image by duplicating this example:

However, on my code, I get a type error in this line:

The method meta.getPixelsTimeIncrement returns a Double instead of a ome.units.quantity.Time object.

I suspect this is a version error, but I can’t find how I should solve this.
For the record the dependencies I used are:

		<dependency>
  			<groupId>ome</groupId>
  			<artifactId>bio-formats</artifactId>
  			<version>5.0.0-rc2</version>
		</dependency>
		<dependency>
		    <groupId>org.openmicroscopy</groupId>
		    <artifactId>ome-xml</artifactId>
		    <version>5.5.4</version>
		</dependency>

If you have any idea for solving this, thank you!


#2

Hi @NicoKiaru,

You are indeed correct that this is an issue with versioning. The simplest option would likely be to upgrade the Bio-Formats plugin to the latest revision (5.7.0) to keep up to date with the latest improvements.

Or alternatively if you do not wish to update you can use the same code sample from the dev-5_0 branch:

David Gault


#3

Hi @NicoKiaru,

I suggest you don’t override the versions inherited from pom-scijava unless really necessary for your project. (Eclipse should even warn you about that, no?) The goal of the pom-scijava parent is to define a set of fully compatible components:


#5

Ok thanks @imagejan and @dgault,

I’m still not fully understanding all of this, but I think the right thing to do was for me to remove dependencies, as @imagejan told me, and then simply add this one, without any version:

		<dependency>
  			<groupId>ome</groupId>
  			<artifactId>bio-formats_plugins</artifactId>
		</dependency>

With that, everything’s compiling!

I still get a NullPointerException, but that’s another story…

Thanks again!