Package sc.fiji.snt.gui.cmds
Class SNTLink
java.lang.Object
sc.fiji.snt.gui.cmds.SNTLink
Schema helpers for
snt:// links: parsing of link parameters, source
normalization and the pre-flight check that decides how a link should be
handled given the current state of SNT. Only URL references are supported
for images and tracings. Local resources must be absolute paths or
file: URIs.
Parameters (all optional):
image=URI image/dataset to open (or to match against the open one) stream=boolean forces (or disables) SNT Stream for the given image viewer=bvv|bdv viewer to use for streamed images (default: bvv) tracer=boolean false for a plain viewer, with no SNT session attached tracings=URI reconstruction(s) to load view=x,y,z[,t] location (world coordinates) to fly to, and timepoint
- Author:
- Tiago Ferreira
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractBigVieweractiveViewer(SNT snt) Gets the big viewer a link should act on: SNT's active viewer if SNT is running, otherwise a standalone (SNT-less) Bvv/Bdv, if anystatic booleanGets whether a source is a bundled demo, i.e.,demo:<name>static booleanGets whether a path/URL refers to a local file or directorystatic StringlocationLink(String source, AbstractBigViewer viewer, boolean tracer, double x, double y, double z, int t) Builds a link that openssource(if not already open) and flies to a location.static StringsourceOf(SNT snt, AbstractBigViewer viewer) Gets the source of the data currently displayed
-
Method Details
-
activeViewer
Gets the big viewer a link should act on: SNT's active viewer if SNT is running, otherwise a standalone (SNT-less) Bvv/Bdv, if any- Parameters:
snt- the running instance of SNT (can be null)- Returns:
- an open viewer, or null
-
locationLink
public static String locationLink(String source, AbstractBigViewer viewer, boolean tracer, double x, double y, double z, int t) Builds a link that openssource(if not already open) and flies to a location. Local sources are written asfile:URIs- Parameters:
source- the image/dataset path or URL (seesourceOf(sc.fiji.snt.SNT, sc.fiji.snt.viewer.AbstractBigViewer))viewer- the viewer displayingsource(can be null)tracer- whether the viewer is tethered to SNT (SNT Stream)x- the X coordinate (world units)y- the Y coordinate (world units)z- the Z coordinate (world units)t- the 1-based timepoint (< 1 for the current one)- Returns:
- the
fiji://snt/open?...link. Thefiji://form is used on all platforms, assnt://cannot be registered on macOS, and links must be shareable across operating systems
-
isDemo
Gets whether a source is a bundled demo, i.e.,demo:<name> -
isLocal
Gets whether a path/URL refers to a local file or directory -
sourceOf
Gets the source of the data currently displayed- Parameters:
snt- the running instance of SNT (can be null)viewer- the big viewer (can be null, in which case SNT's active viewer is used if in stream mode)- Returns:
- the source path/URL, or null if unknown
-