Skip to content

Handling multiple Sources with different units #198

@bogovicj

Description

@bogovicj

How should Bdv behave when multiple loaded sources have different units?

Currently, the ScaleBarOverlayRenderer uses units to create a scale bar, and even does some neat unit conversion when very zoomed in or out (and units are one of a known type). I think this may be the only way units are used currently (is that right?).

Bigdataviewer appears to currently assume that the source transformations for all sources bring them into the same world coordinates with the same unit. It might be nice to handle different units simultaneously - to know that a source with 0.1um resolution is "the same" as one with 100 nm resolution. But what unit should the world coordinates use if sources use different units?

Ideas:

  • The units of the first source
    • simple but inflexible
  • The units of the current source
    • more flexible, but would need to constantly change source transforms of all sources when changing current source. maybe unintuitive?
  • User specified
    • perhaps more intuitive than the above

Note for unit conversion - ucars.udunits seems to have some nice functionality for unit conversion:

final UnitFormat format = UnitFormatManager.instance();

// all three lines below return 0.001
format.parse("nm").convertTo(1.0, format.parse("um")));
format.parse("nanometer").convertTo(1.0, format.parse("micrometer"));
format.parse("nanometer").convertTo(1.0, format.parse("micron"));

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