Bump to next development cycle

Signed-off-by: Mark Hiner <hinerm@gmail.com>
ChannelFiller: ensure color table is stripped

In the case of FalseColor images there may be a ColorTable still
attached to the plane. This ensures it is removed.
Don't check indexed state for ImgPlus

We were checking if the base image was indexed to determine the
composite channel count (the base had to be checked because we're always
using channel fillers and plane separators, so the top-level metadata
shouldn't have any planar channels).

First of all, we should have been setting the # of composite channels to
the LUT length in cases of indexed color, and second we should have been
also checking if the image was false color (in which case there are NOT
LUT length # of additional real channels).

But for now since we are using the ChannelFiller, let's just remove the
index basis for setting composite channel count.
ChannelFillerMetadata: remove unused import

No longer need the SCIFIOAxes import.
Defensively check color table

In ChannelFillerMetadata we assume that there will always be a
ColorTable available for indexed images. This may not be true if the
image is false color. So let's make sure the table is non-null before
accessing it.
PlaneSeparator: account for negative indices

When determining indices of separated axes, we were just checking if the
index was less than the number of planar axes. However, if the index was
-1 it was of course less than the number of planar axes, yet we wanted
to trigger index population as though the plane had been separated
(because a negative index suggests that a length 1 axis was separated
and there were no significant trailing axes, resulting in its discard).
Bump to next development cycle

Signed-off-by: Mark Hiner <hinerm@gmail.com>
Revert "ChannelFiller: ensure color table is stripped"

This reverts commit fc43616193b73808501b61ed386236c70c743220.

We were being overly-aggressive in stripping color tables. If a color
table is available, we should return it even if we don't explicitly
expand it via the ChannelFiller.
FormatTools: add getNonPlanarAxisPosition method

Added a convenience method to look up the axis position, given a
corresponding plane index.
TIFFFormat: parse IJ1 color table

ImageJ 1.x can write 8-bit lookup tables in the TIFF ImageJ 1.x comment.
These are not properly read when retrieved from the IFD as a String.
They need to be parsed by reading the metadata tags and determining the
actual offsets and lengths.

We now parse and use the IJ 1.x color table if needed.

Closes #202

NB: See also #203 for future plans
Bump to next development cycle

Signed-off-by: Mark Hiner <hinerm@gmail.com>
Bump to pom-scijava 2.20

Update to latest pom-scijava. By depending on an old pom-scijava, the
SCIFIO-dev update site shadows the scijava-common artifact with an older
and incompatible version, thus breaking Fiji.
Bump parent to 2.22

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
FormatTools: do not default calibration to microns

There is absolutely nothing special about microns (um) that they should
somehow be the default unit for axis calibrations. Rather, the default
unit should be null -- i.e., unknown -- when no explicit unit is given.
FormatTools: fail loudly when axis is nonlinear

Previously, the calibration would fail silently. But in this scenario we
really want to know if something went wrong, including if the axis in
question is null.

Time will tell whether this change is too aggressive. If that proves to
be the case, we can perhaps return a boolean instead indicating success.
But doing nothing silently is bad news.
TIFFFormat: apply the spacing to the correct axis

Before this change, the spacing would be parsed but then lost, because
at the time of parsing, there are three axes: X, Y and TIME. There is no
Z, so a new Z is created. But later the axes get reshuffled and that Z
axis gets lost again, including its unit and spacing, in favor of the
time axis (which was never calibrated properly).

This change defers the assignment of the calibration until the axes have
settled down, resulting in a correctly calibrated Z axis.

This is not the greatest patch in the world, but it gets the job done
for now, until the ImageJ comment parsing logic gets rewritten as
documented in issue #203.

This change address the second half of Fiji bug 802.
MetadataTest: switch to JUnit

Running TestNG tests in Eclipse is a real pain. Let's use a framework
that actually works out of the box.

Note that this conversion exposed at least one lurking bug in the unit
tests: a test method with "expectedExceptions" is throwing its
exception _before_ the comment in the source says it should. But it was
not noticed due to how that annotation behaves with TestNG...
MetadataTest: remove fake string's trailing commas
AbstractImageMetadata: refactor getAxisIndex

This introduces a new method for searching for the axis index from _any_
list of axes. It will be useful for finding the _raw_ index in cases
where it is needed.
AbstractImageMetadata: fix bug in setAxisLength

The problem, identified by MetadataTest#testAdjustTrailingAxis, was that
the getAxisIndex method now discards trailing axes of length 1. So the
setAxisLength method was erroneously determining that it needed to add
another axis of the same type that already existed in the raw axes list.

The fix is to check the _raw_ axes list for the axis of that type,
rather than the "effective" axes list as was being done.