PathAndFillManager Class Documentation#
Package: sc.fiji.snt
The PathAndFillManager is responsible for importing, handling and managing of Paths and Fills. Typically, a PathAndFillManager is accessed from a SNT instance, but accessing a PathAndFillManager directly is useful for batch/headless operations.
Methods#
Utilities Methods#
- clear()#
Deletes all paths and fills.
Getters Methods#
- getBoundingBox(boolean)#
Returns the BoundingBox enclosing all nodes of all existing Paths.
- getCorrespondences(PathAndFillManager, double)#
For each point in this PathAndFillManager, find the corresponding point on the other one. If there’s no corresponding one, include a null instead. *
- getLoadedFills()#
- getPath(int)#
Returns the Path at the specified position in the PathAndFillManager list.
- getPathFromID(int)#
Returns the Path with the specified id.
- getPathFromName(String, boolean)#
Returns the Path with the specified name.
- getPaths()#
Returns all the paths.
- getPathsFiltered()#
Returns the ‘de facto’ Paths.
- getPathsInROI(Roi)#
- getPathsStructured(Collection)#
- getPlugin()#
Gets the SNT instance.
- getSWCFor(Collection)#
Converts a collection of connected Path objects into SWC points for export.
SWC is the standardized format used for neuromorphological data exchange. The conversion process:
Validates that paths form a proper tree structure with exactly one primary path (tree’s root) Uses breadth-first traversal to ensure correct parent-child relationships Assigns sequential SWC IDs starting from 1 Establishes proper parent references based on path connectivity Preserves path properties including SWC type, color, annotations, and custom tags
Path Requirements:
Must contain exactly one primary path (root of the tree) All non-primary paths must have valid parent relationships Paths must form a connected tree structure (no disconnected components) Empty paths (size == 0) are automatically skipped
- getSelectedPaths()#
Gets all paths selected in the GUI
I/O Operations Methods#
- static createFromFile(String, [I)
Creates a PathAndFillManager instance from imported data
- exportAllPathsAsSWC(String)#
Exports all as Paths as SWC file(s). Multiple files are created if multiple Trees exist.
- exportFillsAsCSV(File)#
Export fills as CSV.
- exportToCSV(File)#
Output some potentially useful information about all the Paths managed by this instance as a CSV (comma separated values) file.
- exportTree(int, File)#
Other Methods#
- addPath(Path)#
- addPathAndFillListener(PathAndFillListener)#
Adds a PathAndFillListener. This is used by the interface to have changes in the path manager reported so that they can be reflected in the UI.
- addTree(Tree, String)#
Adds a Tree. If an image is currently being traced, it is assumed it is large enough to contain the tree.
- addTrees(Collection)#
Adds a collection of Trees.
- allPointsIterator()#
- anySelected()#
Checks whether at least one Path is currently selected in the UI.
- assignSpatialSettings(ImagePlus)#
- canvasResized()#
- characters([C, int, int)#
- contentAdded(Content)#
- contentChanged(Content)#
- contentRemoved(Content)#
- contentSelected(Content)#
- static createFromGraph(DirectedWeightedGraph, boolean)
Create a new PathAndFillManager instance from the graph.
- static createFromNodes(Collection)
Creates a PathAndFillManager instance from a collection of reconstruction nodes.
- declaration(String, String, String)#
- deletePath(int)#
Deletes a path.
- deletePaths([I)#
Delete paths by position.
- dispose()#
- downsampleAll(double)#
Downsamples alls path using Ramer–Douglas–Peucker simplification. Downsampling occurs only between branch points and terminal points.
- endDocument()#
- endElement(String, String, String)#
- endPrefixMapping(String)#
Sets whether this PathAndFillManager instance should run headless.
- error(SAXParseException)#
- fatalError(SAXParseException)#