-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Goals:
- Attach (arbitrary) metadata items to imglib2
RandomAccessible(Interval). Datasetinterface wrapping data and metadata.- Carry appropriately modified metadata through common View/Convert transforms. We should add a
DatasetViewsclass analogous to thenet.imglib2.view.Viewsclass. Additionally, these methods are exposed throughDataset.view().
Non-Goals:
- I would leave out RealRandomAccessible(Interval) etc for now. For the first version, we can just keep it on the radar and try to not make it impossible to add in the future. For the next version, I would then deal with "RealDataset" metadata independently, and only after that works worry about how to carry metadata through interpolation / rasterization.
- Work with arbitrary new View-like transformations without additional work.
Examples of metadata items:
When thinking about how transformations interact with metadata, here are some examples of metadata that should work:
- LUT per channel
- Axis label
- Axis calibration (unit, scale)
- Axis calibration (unit, scale, offset)
- Rectangle ROI
Transformations:
These are the basic transformations we consider important.
- slice
- addDimension
- permute
- translate
- invertAxis
- interval
- convert
Note that these cover also other Views methods, that can be seen as combinations of the above.
For example, rotate() is a combination of several permute() and invertAxis().
MetadataItem:
- Has a
name(Stringidentifying this piece of metadata) - Has a
value(potentially varying along one or more axes) - Has a set of "attached axes" (may be empty).
- If any of the attached axes is removed by a transformation, this
MetadataItemis removed as well. For example, an "axis name" metadata item would be attached to one axis; if that axis is sliced away, the item is removed. - A
MetadataItemshould be able to report the list of axes (indices) it is attached to. If a transformation modifies the axis order, the reported indices are appropriately modified. - A
MetadataItemmay not be attached to any axis. For example "image name" or LUT.
- If any of the attached axes is removed by a transformation, this
- Has a set of "varying axes" (may be empty). The value of the
MetadataItemvaries along those axes.- A
MetadataItemshould be able to report the list of varying axes (indices). If a transformation modifies the axis order, the reported indices are appropriately modified. (If a transformation slices in a varying axis, the corresponding index is just removed.) - For example LUT may vary along the CHANNEL axis. If we take one channel as a slice, the set of varying axes of LUT becomes empty.
- A
MetadataItem<T> extends RandomAccessible<T>. Values are broadcast along all non-varying axis.
(Probably?) There should be a hook for MetadataItem to modify itself (or rather provide a modified view) with a given transformation. For example, if we support a subsample view, then a "Axis calibration" item might modify its scale parameter. Another example would be a "history" MetadataItem that keeps a list of all transformations that were applied to a Dataset.
MetadataStore:
A Collection of MetadataItems.
(Probably?) Items are uniquely identified by key (the item name) and set of attached axes. There can be only one item with the same key/attached-axes combination.