API Reference
SMLMView.CHANNEL_COLOR_PRESETSSMLMView.DEFAULT_CHANNEL_COLORSSMLMView.configure_display!SMLMView.get_keybindingsSMLMView.list_actionsSMLMView.list_keysSMLMView.reset_keybindings!SMLMView.set_keybinding!SMLMView.smlmview
Main Functions
SMLMView.smlmview — Function
smlmview(data::AbstractArray{T,N}; kwargs...) -> NamedTupleLaunch an interactive viewer for N-dimensional array data (N ≥ 2).
Arguments
data: N-dimensional numeric array to display
Keyword Arguments
display_dims::Tuple{Int,Int}=(1,2): Which dims to display (rowdim, coldim)dim_names::Union{Nothing,NTuple{N,String}}=nothing: Optional labels for each dimensionclip::Tuple{Real,Real}=(0.0, 1.0): Percentile clipping for intensity stretch (0.0, 1.0 = full range)title::String="": Window/axis titlecolormap::Symbol=:grays: Colormap for displayfigsize::Tuple{Int,Int}=(800, 700): Maximum figure size in pixelsshow::Bool=true: Whether to display the figure immediately
Returns
NamedTuple with:
fig: The Makie Figureax: The image Axisdata: Reference to original array (no copy)display_dims: Observable for current display dimensionsslice_indices: Vector of Observables for each dim's slice indexcolorrange: Observable for intensity rangecursor_pos: Observable for cursor (row, col) positionpixel_value: Observable for value under cursor
Keyboard Shortcuts
1-9+1-9: Two-number sequence sets display_dims (e.g.,21for transpose)c: Cycle colormap (grays, inferno, viridis, turbo, plasma, twilight)m: Cycle mapping (linear, log, p199, p595)g: Cycle stretch mode (global, slice)r: Reset view (fit entire image)i/o: Zoom in/oute/s/d/f: Pan up/left/down/rightj/l: Previous/next slice on first slider dim
Example
using SMLMView
# 3D data
data3d = rand(256, 256, 10)
v = smlmview(data3d)
# 4D data with custom display
data4d = rand(64, 64, 10, 5)
v = smlmview(data4d; display_dims=(1, 3), dim_names=("Y", "X", "Z", "T"))
# Change view interactively: press 2 then 3 to show dims (2,3)Notes
- Data is displayed with standard image orientation: row 1 at top, col 1 at left
- Status bar shows current display dims: (1,2) means dim1→rows, dim2→cols
- For N-dim data, N-2 sliders are created for non-display dimensions
smlmview(channels::Tuple{Vararg{AbstractArray}}; kwargs...) -> NamedTupleLaunch an interactive viewer for multi-channel composite display.
Arguments
channels: Tuple of 2-3 arrays with matching spatial dimensions
Keyword Arguments
colors: Channel colors, default CMY (cyan, magenta, yellow)names: Channel names for displaydisplay_dims::Tuple{Int,Int}=(1,2): Which dims are (rows, cols)clip::Tuple{Real,Real}=(0.0, 1.0): Percentile clipping (0.0, 1.0 = full range)figsize::Tuple{Int,Int}=(800, 700): Max figure sizeshow::Bool=true: Whether to display immediately
Keyboard Shortcuts
1/2/3: Toggle channel visibilitym: Cycle mapping (linear, log, percentile)g: Cycle stretch mode (global, slice)j/l: Previous/next slicei/o: Zoom in/outr: Reset view
Example
ch1 = rand(256, 256, 10) # "DAPI"
ch2 = rand(256, 256, 10) # "GFP"
ch3 = rand(256, 256, 10) # "Alexa647"
v = smlmview((ch1, ch2, ch3); names=("DAPI", "GFP", "A647"))SMLMView.configure_display! — Function
configure_display!(; port=8080)Configure WGLMakie and Bonito server for display. Call once per Julia session. Automatically called on first smlmview() if not already configured.
For VSCode Remote, this sets up the proxy_url for proper WebSocket tunneling.
Keybinding Functions
SMLMView.get_keybindings — Function
get_keybindings() -> Dict{String,String}Return current keybindings as action => key string pairs.
SMLMView.set_keybinding! — Function
set_keybinding!(action::String, key::String)
set_keybinding!(action::Symbol, key::String)Set a keybinding for an action. Persists to LocalPreferences.toml.
Example
SMLMView.set_keybinding!(:zoom_in, "k")
SMLMView.set_keybinding!("pan_up", "w")SMLMView.reset_keybindings! — Function
reset_keybindings!()Reset all keybindings to defaults. Clears preferences.
SMLMView.list_keys — Function
list_keys() -> Vector{String}List all valid key names for keybindings.
SMLMView.list_actions — Function
list_actions() -> Vector{String}List all configurable actions.
Constants
SMLMView.DEFAULT_CHANNEL_COLORS — Constant
DEFAULT_CHANNEL_COLORSDefault channel colors for multi-channel composite viewing (Cyan, Magenta, Yellow). CMY additive blending: C+M=Blue, C+Y=Green, M+Y=Red, C+M+Y=White.
SMLMView.CHANNEL_COLOR_PRESETS — Constant
CHANNEL_COLOR_PRESETSNamed color presets for multi-channel composite viewing. Available presets: :cmy (default), :rgb, :mgc (Magenta-Green-Cyan).