imagej/imglib — pull request #27 by MichaelZinsmaier (2013-08-22 14:16:29+00:00)
Title: Add a Utility class to copy metadata - requires copy for TypedAxis

see class MetadataUtil

The idea is to provide a utility class for copying Named -> Named, Sourced -> Sourced, ... Metadata -> Metadata. Dimension dependent data (calibrated space ...) can be copied either to an object of the same dimensionality or if the copyAndClean* methods are used to an object where nr.dims = nr.dims(in) - nr.dims( size == 1 ). The 2nd case exists to allow removal of metadata for dimensions of size 1. (e.g. cutting out a subintervals from an ImgPlus)

The new class makes several copy metadata ops unecessary. They come orginally from the KNIP branch and have been most likely be used mainly in our projects => I removed them.

So far so good. But to get this functional AxisTypes have to be copied. I tried to introduce a copy method and got it working with some hardcoded casts in MetadataUitl but I fear to do it in a clean way something like TypedAxis < T extends TypedAxis < T > > would be necessary. Any other ideas?

Regards Michael