Package sc.fiji.snt

Class SciViewSNT

java.lang.Object
sc.fiji.snt.SciViewSNT

public class SciViewSNT extends Object
Bridges SNT to SciView, allowing Trees to be rendered as scenery objects
Author:
Kyle Harrington, Tiago Ferreira
  • Constructor Details

    • SciViewSNT

      public SciViewSNT(org.scijava.Context context) throws NoClassDefFoundError
      Instantiates a new SciViewSNT instance.
      Parameters:
      context - the SciJava application context providing the services required by the class
      Throws:
      NoClassDefFoundError - if SciView/scenery are not available
      org.scijava.NullContextException - If context is null
    • SciViewSNT

      public SciViewSNT(sc.iview.SciView sciView)
      Instantiates SciViewSNT from an existing SciView instance.
      Parameters:
      sciView - the SciView instance to be associated with this SciViewSNT instance
      Throws:
      NullPointerException - If sciView is null
    • SciViewSNT

      public SciViewSNT(SNT snt) throws NoClassDefFoundError
      Throws:
      NoClassDefFoundError
  • Method Details

    • getSciView

      public sc.iview.SciView getSciView()
      Gets the SciView instance currently in use.
      Returns:
      the SciView instance. It is never null: A new instance is created if none has been specified
    • setSciView

      public void setSciView(sc.iview.SciView sciView)
      Sets the SciView to be used.
      Parameters:
      sciView - the SciView instance. Null allowed.
    • addTree

      public void addTree(Tree tree)
      Adds a tree to the associated SciView instance. A new SciView instance is automatically instantiated if setSciView(SciView) has not been called.
      Parameters:
      tree - the Tree to be added. The Tree's label will be used as identifier. It is expected to be unique when rendering multiple Trees, if not (or no label exists) a unique label will be generated.
      See Also:
    • getTreeAsSceneryNode

      public graphics.scenery.Node getTreeAsSceneryNode(Tree tree)
      Gets the specified Tree as a Scenery Node.
      Parameters:
      tree - the tree previously added to SciView using addTree(Tree)
      Returns:
      the scenery Node
    • removeTree

      public boolean removeTree(Tree tree)
      Removes the specified Tree.
      Parameters:
      tree - the tree previously added to SciView using addTree(Tree)
      Returns:
      true, if tree was successfully removed.
      See Also:
    • syncPathManagerList

      public boolean syncPathManagerList()
      (Re)loads the current list of Paths in the Path Manager list.
      Returns:
      true, if Path Manager list is not empty and synchronization was successful
      Throws:
      IllegalArgumentException - if SNT is not running
    • main

      public static void main(String[] args) throws InterruptedException
      Throws:
      InterruptedException