public class SNTService
extends org.scijava.service.AbstractService
implements net.imagej.ImageJService
SNT
.Constructor and Description |
---|
SNTService() |
Modifier and Type | Method and Description |
---|---|
void |
assignValues(boolean selectedPathsOnly)
Assigns pixel intensities at each Path node, storing them as Path values.
|
ij.ImagePlus |
captureView(java.lang.String view,
boolean project)
Retrieves a WYSIWYG 'snapshot' of a tracing canvas.
|
Tree |
demoTree()
Returns a toy reconstruction (fractal tree).
|
ij.ImagePlus |
demoTreeImage()
Returns the image associated with the demo (fractal) tree.
|
java.util.List<Tree> |
demoTrees()
Returns a collection of four demo reconstructions (dendrites from pyramidal
cells from the MouseLight database).
|
void |
dispose()
Quits SNT.
|
TreeAnalyzer |
getAnalyzer(boolean selectedPathsOnly)
Returns a
TreeAnalyzer instance constructed from current Paths. |
SciViewSNT |
getOrCreateSciViewSNT() |
PathAndFillManager |
getPathAndFillManager()
Returns the
PathAndFillManager associated with the current SNT
instance. |
java.util.List<Path> |
getPaths()
Gets the paths currently listed in the Path Manager
|
SNT |
getPlugin()
Returns a reference to the active
SNT plugin. |
Viewer3D |
getRecViewer()
Returns a reference to SNT's Reconstruction Viewer.
|
Viewer3D |
getRecViewer(int id)
Returns a reference to an opened Reconstruction Viewer (standalone instance).
|
SciViewSNT |
getSciViewSNT() |
java.util.Collection<Path> |
getSelectedPaths()
Gets the paths currently selected in the Path Manager list.
|
TreeStatistics |
getStatistics(boolean selectedPathsOnly)
Returns a
TreeStatistics instance constructed from current Paths. |
org.scijava.table.DefaultGenericTable |
getTable()
Returns a reference to SNT's main table of measurements.
|
Tree |
getTree(boolean selectedPathsOnly)
Gets the collection of paths listed in the Path Manager as a
Tree
object. |
SNTUI |
getUI()
Returns a reference to SNT's UI.
|
SNT |
initialize(boolean startUI)
Initializes SNT.
|
SNT |
initialize(ij.ImagePlus imp,
boolean startUI)
Initializes SNT.
|
SNT |
initialize(java.lang.String imagePath,
boolean startUI)
Initializes SNT.
|
boolean |
isActive()
Gets whether SNT is running.
|
void |
loadTracings(java.lang.String filePath)
Loads the specified tracings file.
|
void |
loadTree(Tree tree)
Loads the specified tree.
|
Viewer3D |
newRecViewer(boolean guiControls)
Instantiates a new standalone Reconstruction Viewer.
|
boolean |
save(java.lang.String filePath)
Saves all the existing paths to a file.
|
void |
updateViewers()
Script-friendly method for updating (refreshing) all viewers currently in use
by SNT.
|
getInfo, getPriority, setInfo, setPriority
public boolean isActive()
SNTService
is active, tied to the active
instance of SNTpublic void assignValues(boolean selectedPathsOnly) throws java.lang.UnsupportedOperationException, java.lang.IllegalArgumentException
selectedPathsOnly
- If true, only selected paths will be assigned
values, otherwise voxel intensities will be assigned
to all pathsjava.lang.UnsupportedOperationException
- if SNT is not runningjava.lang.IllegalArgumentException
- If valid imaged data is not availablePathProfiler
,
Path.setNodeValues(double[])
public SNT initialize(boolean startUI)
startUI
- Whether SNT's UI should also be initialized;public SNT initialize(java.lang.String imagePath, boolean startUI)
imagePath
- the image to be traced. If "demo" (case insensitive), SNT is
initialized using the demoTreeImage()
. If empty or
null and SNT's UI is available an "Open" dialog prompt is
displayed.startUI
- Whether SNT's UI should also be initialized;public SNT initialize(ij.ImagePlus imp, boolean startUI)
imp
- the image to be traced (null not allowed)startUI
- Whether SNT's UI should also be initialized;public SNT getPlugin()
SNT
plugin.SNT
instancepublic void loadTracings(java.lang.String filePath)
filePath
- either a "SWC", "TRACES" or "JSON" file. Null not allowed.java.lang.UnsupportedOperationException
- if SNT is not runningpublic void loadTree(Tree tree)
tree
- the Tree
to be loaded (null not allowed)java.lang.UnsupportedOperationException
- if SNT is not runningpublic boolean save(java.lang.String filePath)
filePath
- the saving output file path. If filePath
ends in
".swc" (case insensitive), an SWC file is created, otherwise
a "traces" file is created. If empty and a GUI exists, a save
prompt is displayed.java.lang.UnsupportedOperationException
- if SNT is not runningpublic java.util.Collection<Path> getSelectedPaths()
java.lang.UnsupportedOperationException
- if SNT is not runninggetTree(boolean)
public java.util.List<Path> getPaths()
java.lang.UnsupportedOperationException
- if SNT is not runninggetTree(boolean)
public Tree getTree(boolean selectedPathsOnly)
Tree
object.selectedPathsOnly
- If true, only selected paths are retrievedjava.lang.UnsupportedOperationException
- if SNT is not runningpublic TreeAnalyzer getAnalyzer(boolean selectedPathsOnly)
TreeAnalyzer
instance constructed from current Paths.selectedPathsOnly
- If true only selected paths will be consideredjava.lang.UnsupportedOperationException
- if SNT is not runningpublic TreeStatistics getStatistics(boolean selectedPathsOnly)
TreeStatistics
instance constructed from current Paths.selectedPathsOnly
- If true only selected paths will be consideredjava.lang.UnsupportedOperationException
- if SNT is not runningpublic PathAndFillManager getPathAndFillManager()
PathAndFillManager
associated with the current SNT
instance.java.lang.UnsupportedOperationException
- if no SNT instance exists.public void updateViewers()
public SNTUI getUI()
SNTUI
window, or null if SNT is not running, or is
running without GUIpublic Viewer3D getRecViewer()
Viewer3D
instance.java.lang.UnsupportedOperationException
- if SNT is not runningpublic Viewer3D getRecViewer(int id)
id
- the unique numeric ID of the Reconstruction Viewer to be retrieved
(as used by the "Script This Viewer" command, and typically
displayed in the Viewer's window title)Viewer3D
instance, or null if id was not
recognizedpublic Viewer3D newRecViewer(boolean guiControls)
Viewer3D
instancepublic SciViewSNT getOrCreateSciViewSNT()
public SciViewSNT getSciViewSNT()
public org.scijava.table.DefaultGenericTable getTable()
java.lang.UnsupportedOperationException
- if SNT is not runningpublic Tree demoTree()
demoTreeImage()
public ij.ImagePlus demoTreeImage()
demoTree()
public java.util.List<Tree> demoTrees()
Tree
s, corresponding to the dendritic arbors of
cells "AA0001", "AA0002", "AA0003", "AA0004" (MouseLight database
IDs).public ij.ImagePlus captureView(java.lang.String view, boolean project)
view
- A case-insensitive string specifying the canvas to be captured.
Either "xy" (or "main"), "xz", "zy" or "3d" (for legacy's 3D
Viewer).project
- whether the snapshot of 3D image stacks should include its
projection (MIP), or just the current planejava.lang.UnsupportedOperationException
- if SNT is not runningjava.lang.IllegalArgumentException
- if view is not a recognized optionpublic void dispose()
dispose
in interface org.scijava.Disposable