Skip to content

Working towards specΒ #1

@tpietzsch

Description

@tpietzsch

Goals:

  • Attach (arbitrary) metadata items to imglib2 RandomAccessible(Interval).
  • Dataset interface wrapping data and metadata.
  • Carry appropriately modified metadata through common View/Convert transforms. We should add a DatasetViews class analogous to the net.imglib2.view.Views class. Additionally, these methods are exposed through Dataset.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 (String identifying 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 MetadataItem is 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 MetadataItem should 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 MetadataItem may not be attached to any axis. For example "image name" or LUT.
  • Has a set of "varying axes" (may be empty). The value of the MetadataItem varies along those axes.
    • A MetadataItem should 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.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions