Class SNTLink

java.lang.Object
sc.fiji.snt.gui.cmds.SNTLink

public final class SNTLink extends Object
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 Details

    • activeViewer

      public static AbstractBigViewer activeViewer(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 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 opens source (if not already open) and flies to a location. Local sources are written as file: URIs
      Parameters:
      source - the image/dataset path or URL (see sourceOf(sc.fiji.snt.SNT, sc.fiji.snt.viewer.AbstractBigViewer))
      viewer - the viewer displaying source (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. The fiji:// form is used on all platforms, as snt:// cannot be registered on macOS, and links must be shareable across operating systems
    • isDemo

      public static boolean isDemo(String source)
      Gets whether a source is a bundled demo, i.e., demo:<name>
    • isLocal

      public static boolean isLocal(String source)
      Gets whether a path/URL refers to a local file or directory
    • sourceOf

      public static String sourceOf(SNT snt, AbstractBigViewer viewer)
      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