Skip to content

imglib/imglib2-meta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Caveat emptor: this is experimental code, which will be later merged elsewhere!

Motivation

Metadata is incredibly important in scientific image processing. The ImgLib2 ecosystem has no formal mechanism for working with metadata. This repository aims to solve that.

Goals

The library goals are:

  • Compatibility with existing ImgLib2 types: data+metadata should behave like standard RandomAccessible / RandomAccessibleInterval objects.
  • Transform-aware metadata: views or transforms applied to data should automatically apply to associated metadata as well.
  • Type-safe, interface-driven access: a small, well-typed API for querying and composing metadata without unnecessary copying.
  • Convenient structured metadata access for common formats (for example, OME).

The main metadata stand-in throughout the Fiji ecosystem is the Dataset class of ImageJ2, used by e.g. SCIFIO. However, it has a number of issues:

  • It cannot operate within a type-safe environment. This hinders use within ImgLib2-algorithm, SciJava Ops, etc.
  • It requires the dependency of imagej-common.

Build

Currently, this project depends upon a few snapshots, which you'll need to obtain before building this project:

  • imglib2, based on the raiview-generics branch
  • imglib2-imagej, based on the main branch. Used as a test dependency.

Current Status

The current design is centered around a few interfaces:

  • The MetadataItem is a piece of metadata in an n-dimensional data space.
    • It can be identified by a String key and a set of "attached" dimensional axes.
      • Metadata can (but may not) vary along each of its attached axes, e.g.:
        • Channel LUTs might be a 1-dimensional piece of metadata "attached" to the channel axis. The LUT used for a pixel varies only on the channel axis.
        • An axis label (X, Y, Channel, etc.) is a 0-dimensional piece of metadata "attached" to some axis. It does not vary along that axis.
        • ROIs are n-dimensional pieces of metadata "attached" to all axes.
  • The MetadataStore is a collection of metadata, supporting retrieval (MetadataStore.item), agglomeration (MetadataStore.add) of MetadataItems.
    • MetadataStores can be viewed like RandomAccessibles can be viewed with the ImgLib2 Fluent API.
  • The Dataset class as the fundamental currency in metadata-rich data processing.
    • A union of a MetadataStore and a RandomAccessible
    • Viewable using the fluent views API. e.g. Dataset new = old.permute(3, 2) should be painless.

The pain points are:

  • RandomAccessibleView and its subclasses have difficult typing.
    • This makes it difficult to subclass Dataset, if we want a DatasetInterval or a RealDataset
    • See imglib/imglib2#379
  • Creating mutable MetadataItems are tedious.
    • RandomAccessibleIntervals are tricky to mutate - they rely on element mutability.
      • Many common-sense metadata types (e.g. String, ColorTable) are not mutable.
    • Do we even need metadata mutability?

Future Work Where do we go from here?

  • Spec out HasMetadataStore interfaces for OME-NGFF metadata?
  • Get those imglib PRs merged? (Note that imglib/imglib2#379 is technically a breaking change).
  • Package review?

About

IGNORE ME!! πŸ™ˆ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages