public class SNTService extends AbstractService implements 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(String view,
boolean project)
Retrieves a WYSIWYG 'snapshot' of a tracing canvas.
|
ij.ImagePlus |
captureView(String view,
ColorRGB backgroundColor)
Retrieves a WYSIWYG 'snapshot' of a tracing canvas without voxel data.
|
ij.ImagePlus |
demoImage(String img)
Returns one of the demo images bundled with SNT image associated with the
demo (fractal) tree.
|
Tree |
demoTree()
Deprecated.
|
Tree |
demoTree(String tree)
Returns a demo tree.
|
ij.ImagePlus |
demoTreeImage()
Deprecated.
|
List<Tree> |
demoTrees()
Returns a collection of four demo reconstructions (dendrites from pyramidal
cells from the MouseLight database).
|
protected List<Tree> |
demoTreesSWC() |
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. |
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 the active Reconstruction Viewer (either stand-alone
or SNT-associated instance).
|
Viewer3D |
getRecViewer(int id)
Returns a reference to an opened Reconstruction Viewer (standalone instance).
|
SciViewSNT |
getSciViewSNT() |
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. |
SNTTable |
getTable()
Returns a reference to SNT's main table of measurements.
|
Tree |
getTree()
Gets the collection of paths listed in the Path Manager as a
Tree
object. |
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(String imagePath,
boolean startUI)
Initializes SNT.
|
boolean |
isActive()
Gets whether SNT is running.
|
void |
loadGraph(DirectedWeightedGraph graph) |
void |
loadTracings(String filePathOrURL)
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(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.
|
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public boolean isActive()
SNTService
is active, tied to the active
instance of SNTpublic void assignValues(boolean selectedPathsOnly) throws UnsupportedOperationException, IllegalArgumentException
selectedPathsOnly
- If true, only selected paths will be assigned
values, otherwise voxel intensities will be assigned
to all pathsUnsupportedOperationException
- if SNT is not runningIllegalArgumentException
- 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(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. URL's supported.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(String filePathOrURL) throws UnsupportedOperationException, IOException
filePathOrURL
- either a "SWC", "TRACES" or "JSON" file path. URLs
defining remote files also supported.. Null not allowed.UnsupportedOperationException
- if SNT is not runningIOException
- if data cannot be importedpublic void loadTree(Tree tree) throws UnsupportedOperationException
Tree.assignImage(ImagePlus)
, before loading it.tree
- the Tree
to be loaded (null not allowed).UnsupportedOperationException
- if SNT is not runningpublic void loadGraph(DirectedWeightedGraph graph) throws UnsupportedOperationException
UnsupportedOperationException
public boolean save(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.UnsupportedOperationException
- if SNT is not runningpublic Collection<Path> getSelectedPaths()
UnsupportedOperationException
- if SNT is not runninggetTree(boolean)
public List<Path> getPaths()
UnsupportedOperationException
- if SNT is not runninggetTree(boolean)
public Tree getTree(boolean selectedPathsOnly)
Tree
object.selectedPathsOnly
- If true, only selected paths are retrievedUnsupportedOperationException
- if SNT is not runningpublic Tree getTree()
Tree
object.UnsupportedOperationException
- if SNT is not runningpublic TreeAnalyzer getAnalyzer(boolean selectedPathsOnly)
TreeAnalyzer
instance constructed from current Paths.selectedPathsOnly
- If true only selected paths will be consideredUnsupportedOperationException
- if SNT is not runningpublic TreeStatistics getStatistics(boolean selectedPathsOnly)
TreeStatistics
instance constructed from current Paths.selectedPathsOnly
- If true only selected paths will be consideredUnsupportedOperationException
- if SNT is not runningpublic PathAndFillManager getPathAndFillManager()
PathAndFillManager
associated with the current SNT
instance.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. For stand-alone viewers, this
is typically the viewer that is frontmost or the last initiated viewer.public 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() throws NoClassDefFoundError
NoClassDefFoundError
public SciViewSNT getSciViewSNT() throws UnsupportedOperationException, NoClassDefFoundError
public SNTTable getTable()
DefaultGenericTable
)UnsupportedOperationException
- if SNT is not running@Deprecated public Tree demoTree()
demoTreeImage()
public Tree demoTree(String tree)
tree
- a string describing the type of demo tree. Either 'fractal' for
the L-system toy neuron, 'pyramidal' for the dendritic arbor of
mouse pyramidal cell (MouseLight's cell AA0001), or 'OP1'for the
DIADEM OP_1 reconstruction.demoImage(String)
,
demoTrees()
@Deprecated public ij.ImagePlus demoTreeImage()
demoTree()
public ij.ImagePlus demoImage(String img)
img
- a string describing the type of demo image. Either 'fractal' for
the L-system toy neuron or 'ddaC' for the C4 ddaC drosophila
neuron, a demo image initially distributed with the Sholl plugin.demoTree(String)
public List<Tree> demoTrees()
Tree
s, corresponding to the dendritic arbors of
cells "AA0001", "AA0002", "AA0003", "AA0004" (MouseLight database
IDs).public ij.ImagePlus captureView(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 planeUnsupportedOperationException
- if SNT is not runningIllegalArgumentException
- if view is not a recognized optionpublic ij.ImagePlus captureView(String view, ColorRGB backgroundColor) throws IllegalArgumentException
view
- A case-insensitive string specifying the canvas to be
captured. Either "xy" (or "main"), "xz", "zy" or "3d"
(for legacy's 3D Viewer).backgroundColor
- the background color of the canvas (string, hex, or
html)UnsupportedOperationException
- if SNT is not runningIllegalArgumentException
- if view
or
backgroundColor
are not
recognizedpublic void dispose()
dispose
in interface Disposable
Copyright © 2015–2021 Fiji. All rights reserved.