openmicroscopy/bioformats — pull request #160 by hinerm (2012-09-30 16:16:20+00:00)
Title: Dimswapper refactoring

This branch makes the following changes:

The concept of dimensionOrder in CoreMetadata is now tied to the getDimensionOrder() method in IFormatReader. This is reasonable given that at the IFormatReader level there is no concept of storage vs. returned dimension orders.

Where such a concept is introduced, at the DimensionSwapper scope, there is now a SwappableMetadata class which extends CoreMetadata and includes a separate inputOrder field. DimensionSwapper can use SwappableMetadata to maintain input/output orders without necessitating parallel arrays.

In the updating of DimensionSwapper a bug was fixed in that, previously, when setting the input order, the new order was checked against the current output order instead of the current input order to decide if a change was necessary.

To accommodate the SwappableMetadata class, the ReaderWrapper protected method copyCoreMetadata was generalized to return an array of any type of CoreMetadata (and thus now requres a CoreMetadata class parameter). Also, the CoreMetadata constructor that copies a specified CoreMetadata of a provided IFormatReader was refactored out to an explicit copy method.