Viewer3D Class Documentation#
Package: sc.fiji.snt.viewer
Implements SNT’s Reconstruction Viewer. Relies heavily on the org.jzy3d package.
Methods#
Getters Methods#
- getAnnotation(String)#
Gets the annotation associated with the specified label.
- getAnnotations()#
Returns all annotations added to this viewer.
- getFrame()#
Gets the frame containing this viewer, optionally controlling its visibility.
Returns the AWT Frame that contains this viewer’s 3D canvas and UI components. If no frame exists, one will be created with the specified visibility setting. This method is useful when you need to control whether the viewer window appears immediately or remains hidden for programmatic manipulation.
- getID()#
Returns this Viewer’s id.
- getManagerPanel()#
Returns a reference to ‘RV Controls’ panel.
- getMesh(String)#
Gets the mesh associated with the specified label.
- getMeshes()#
Returns all meshes added to this viewer.
- getRecorder(boolean)#
Gets the script recorder for this viewer, optionally creating one if needed.
- getTree(String)#
Gets the tree associated with the specified label.
- getTrees()#
Returns all trees added to this viewer.
- isActive()#
Checks whether this instance is currently active
- isDarkModeOn()#
Checks if scene is being rendered under dark or light background.
- isSNTInstance()#
Checks whether this instance is SNT’s Reconstruction Viewer.
- isSplitDendritesFromAxons()#
Checks whether axons and dendrites of imported Trees are set to be imported as separated objects.
I/O Operations Methods#
- loadMesh(String, ColorRGB, double)#
Loads a Wavefront .OBJ file. Files should be loaded _before_ displaying the scene, otherwise, if the scene is already visible, validate() should be called to ensure all meshes are visible.
- loadRefBrain(String)#
Loads the surface mesh of a supported reference brain/neuropil. Internet connection may be required.
Other Methods#
- add(File;, String)#
Script friendly method to add a supported object (Tree, OBJMesh, AbstractDrawable, etc.) to this viewer. Note that collections of supported objects are also supported, which is an effective way of adding multiple items since the scene is only rebuilt once all items have been added.
- addColorBarLegend(ColorMapper)#
Adds a color bar legend (LUT ramp).
- addLabel(String)#
Adds an annotation label to the scene.
- addMesh(OBJMesh)#
Loads a Wavefront .OBJ file. Should be called before_ displaying the scene, otherwise, if the scene is already visible, validate() should be called to ensure all meshes are visible.
- addTree(Tree)#
Adds a tree to this viewer. Note that calling updateView() may be required to ensure that the current View’s bounding box includes the added Tree.
- addTrees(Collection, String, String;)#
- annotateLine(Collection, String)#
Adds a line annotation to this viewer.
- annotateMidPlane(BoundingBox, int, String)#
- annotatePlane(SNTPoint, SNTPoint, String)#
- annotatePoint(SNTPoint, String)#
Adds a highlighting point annotation to this viewer.
- annotatePoints(Collection, String)#
Adds a scatter (point cloud) annotation to this viewer.
- annotateSurface(Collection, String, boolean)#
Computes a convex hull from a collection of points and adds it to the scene as an annotation.
- assignUniqueColors(Collection)#
- colorCode(Collection, String, ColorTable)#
Runs TreeColorMapper on the specified Tree.
- dispose()#
Closes and releases all the resources used by this viewer.
- duplicate()#
Creates a duplicate of this viewer containing only visible objects.
This method creates a new Viewer3D instance and copies all currently visible objects (trees, meshes, annotations) from this viewer to the new one. The duplicate viewer maintains the same visual settings and object properties but operates independently from the original.
- freeze()#
Does not allow scene to be interactive. Only static orthogonal views allowed.
- logSceneControls()#
Logs API calls controlling the scene (view point, bounds, etc.) to Script Recorder (or Console if Script Recorder is not running). Useful for programmatic control of animations.
- mergeAnnotations(Collection, String)#
Merges a collection of annotations into a single object.
- rebuild(Object)#
Rebuilds (repaints) a scene object (e.g., a Tree after being modified elsewhere)
- recordRotation(float, int, File)#
Records an animated rotation of the scene as a sequence of images.