Skip to content

Show4DSTEM: accept inspection products (DPC_r/DPC_c/SSB phase) as map presets #188

Description

@bobleesj

Why

Collaborators often already have BF/ADF/DPC/SSB products from a prior run. They should open one Show4DSTEM widget and switch between raw 4D navigation and those maps without re-running SSB inside the widget.

Show4DSTEM(
    data,
    products={
        "DPC r": dpc_r,
        "DPC c": dpc_c,
        "SSB": ssb.phase,   # phase only; amplitude not required for v1
    },
)

The widget shows those as selectable map presets/tabs. Do not run SSB (or other heavy recon) inside Show4DSTEM by default.

Scope

Show4DSTEM (this issue — implement first)

  • Add products= (or equivalent) argument.
  • Accept 2D arrays and simple 3D stacks (e.g. multi-frame products).
  • Register names in the map selector / preset row with same label font as existing BF/ABF/ADF controls.
  • Use a sensible colormap scheme:
    • DPC r / DPC c: diverging (e.g. coolwarm / RdBu-style), zero-centered when appropriate
    • SSB phase: cyclic or standard phase map consistent with house style (match existing SSB/phase displays if any)
  • If a value looks like an SSBResult-like object, auto-register phase only (not amplitude) for v1.
  • No heavy SSB compute inside Show4DSTEM unless explicitly requested later.

Out of scope for this issue (follow-ups)

Design split

Surface Role
Show4DSTEM 4D navigation + passed-in inspection products (DPC r/c, SSB phase)
ShowPtycho Full SSB/ptycho interactive exploration

Acceptance

  • products={"DPC r": ..., "DPC c": ..., "SSB": ...} works on Show4DSTEM
  • Map selector lists product names next to / with BF/ADF-style presets
  • Switching product updates the virtual-image panel without kernel SSB
  • Colormaps: DPC diverging; SSB phase appropriate; label font matches existing presets
  • Docs or docstring example with post-SSB embed into Show4DSTEM
  • Unit test: register 2D products, switch selection, bytes shape match scan

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions