Class Bvv
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRenders spherical annotations atSNTPointworld coordinates.static classA snapshot of the BVV viewer state at a particular moment, used as a keyframe for movie recording.Nested classes/interfaces inherited from class sc.fiji.snt.viewer.AbstractBigViewer
AbstractBigViewer.AbstractTracer, AbstractBigViewer.Actions, AbstractBigViewer.PathRenderingOptions, AbstractBigViewer.RecenterStrategy -
Field Summary
Fields inherited from class sc.fiji.snt.viewer.AbstractBigViewer
cal, calUnit, CLICK_MOVE_TOLERANCE_PX, dims, lastInstance, markerManager, renderedTrees, renderingOptions, snt, spimDataFilePaths, syncedPathManagerLabels, tracingEnabled -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleaccel(double t, int type) Easing functions for keyframe transitions, adapted from BDV movie recorder.voidLoads reconstruction files and adds them to the viewer with live progress feedback.voidScript friendly method to add a supported object (Tree,DirectedWeightedGraph,Path) to the viewer overlay.protected voidInternal dispatcher with deferred sync support.voidAdds a mouse listener to the viewer's canvas component so that click events on the display surface can be handled (e.g. for hit testing annotation markers).Returns the annotation overlay for this viewer.Captures the current viewer state as aBvv.Keyframe.protected BookmarkManagerCreates and returns a newBookmarkManagerfor this viewer.double[][]Returns the world-space endpoints of the perspective ray through the current mouse cursor position: result[0] = near-clip world point, result[1] = far-clip world point.double[]Finds the world-space point of maximum intensity along the perspective ray through the current mouse cursor position.protected bdv.viewer.SourceAndConverter<?> Returns the currently active source, or null if none.Returns the default color for newly placed markers, or null to use the viewer's own fallback color.floatReturns the default sphere radius (in physical units) for newly placed markers.booleanReturns whether paths are currently rendered with per-node radii as tapered frusta (true) or as simple lines (false).voidgetGlobalMouseCoordinates(net.imglib2.RealPoint pos) Writes the current global (world-space) mouse position intopos.static BvvReturns the most recently createdBvvinstance, ornullif none has been created yet.Returns allBvvMultiSourcegroups currently managed by this viewer.bvv.vistools.BvvOptionsResolves the physical unit string for the currently loaded volume.Gets the path rendering options for controlling thickness, transparency, etc.bvv.core.BigVolumeViewerprotected ActiongetViewerAction(String name) Looks up a named action from the viewer's keybindings action map.bvv.core.VolumeViewerFrameReturns the top-level Swing window for this viewer, or null if not yet open.intReturns the height of the viewer canvas in logical pixels, or 0 if the viewer is not yet initialized.bvv.core.VolumeViewerPanelprotected JSplitPaneReturns the JSplitPane that separates the viewer canvas from the card panel.net.imglib2.realtransform.AffineTransform3DReturns a snapshot of the current viewer-to-screen (world-to-screen) transform.intReturns the width of the viewer canvas in logical pixels, or 0 if the viewer is not yet initialized.booleanisOpen()Returns true if the viewer window is currently visible and usable.protected booleanReturns true if path/tree overlay rendering is currently enabled.static Bvvopen(ij.ImagePlus... imps) Convenience factory: creates a standalone BVV viewer and displays one or moreImagePlusvolumes in one step.static BvvConvenience factory: opens a file path into a BVV viewer.static BvvConvenience factory: opens one or more file paths into the same BVV viewer window, choosing the most appropriate loading strategy per file: .ims Imaris HDF5: creates a BDV XML sidecar file next to the.imsfile (using the same base name, e.g.static BvvScript friendly convenience factory: creates a standalone BVV viewer and displays a list of images in one step.static Bvvopen(mpicbg.spim.data.generic.AbstractSpimData<?> spimData) Convenience factory: creates a standalone BVV viewer and displays aAbstractSpimDatadataset using BVV's pyramid-aware GPU cache manager.static <T extends net.imglib2.type.numeric.RealType<T>>
Bvvopen(net.imagej.ImgPlus<T>... imgs) Convenience factory: creates a standalone BVV viewer and displays one or moreImgPlusvolumes in one step.static BvvConvenience factory: creates a BVV instance tethered to the givenSNTinstance and immediately displays its currently loaded image data.voidplayback(List<Bvv.Keyframe> keyframes) Plays back an animation between keyframes in the viewer without saving frames.voidplayback(List<Bvv.Keyframe> keyframes, int from, int to) Plays back a subset of keyframes (from indexfromto indexto, inclusive).voidrenderFrames(List<Bvv.Keyframe> keyframes, String outputDir) Renders an animation between a list of keyframes, saving each frame as a PNG screenshot.voidrepaint()Forces a repaint of the viewer, updating volume renderings but not overlays.voidResets the viewer to a fit-to-viewport transform, centering the loaded volume in the canvas.booleansaveSnapshot(String filePath) Saves a snapshot of current scene as a PNG image to the specified path.voidsetCalibration(double[] spacing, String unit) Overrides the voxel calibration (spacing and unit) for all loaded sources.voidsetCanvasOffset(double offsetX, double offsetY, double offsetZ) Offsets all paths being rendered.voidsetChannelColors(Color... colors) Sets per-channel colors across all source groups, assigning colors sequentially by global channel order across all groups.voidsetChannelColors(String... colorNames) Script-friendly method for setting per-channel colorsvoidsetChannelColors(BvvMultiSource group, Color... colors) Sets per-channel colors for a specific source group.voidsetDisplayRadii(boolean display) Sets whether paths are rendered as tapered frusta with per-node radii (true) or as anti-aliased lines (false).voidsetDisplayRange(BvvMultiSource group, double min, double max) Sets the display range (min/max intensity) for all channels of a specific source group.protected voidsetPathRenderingEnabled(boolean enabled) Enables or disables path/tree overlay rendering.voidsetViewerTransform(net.imglib2.realtransform.AffineTransform3D target, long durationMs) Animates the viewer transform totargetoverdurationMsmilliseconds.bvv.vistools.BvvSourceshow(ij.ImagePlus imp) Displays the BVV viewer with the specified image.<T extends net.imglib2.type.numeric.RealType<T>>
List<BvvMultiSource> Displays a list ofRandomAccessibleIntervalvolumes, each as aBvvMultiSource.show(mpicbg.spim.data.generic.AbstractSpimData<?> spimData) Displays aAbstractSpimDatadataset using BVV's pyramid-aware GPU cache manager.<T extends net.imglib2.type.numeric.RealType<T>>
bvv.vistools.BvvSourceshow(net.imagej.ImgPlus<T> imgPlus) <T extends net.imglib2.type.numeric.RealType<T>>
bvv.vistools.BvvSourceshow(net.imglib2.RandomAccessibleInterval<T> img, double... calibration) Displays the BVV viewer with the specified image.show(SpimDataUtils.N5Sources n5Sources) Displays sources loaded from an N5 or OME-Zarr container (seeSpimDataUtils.resolvePathToSource(String)), using BVV's pyramid-aware GPU cache manager.bvv.vistools.BvvSourceDisplays the main tracing data from the associated SNT instance.bvv.vistools.BvvSourceDisplays the secondary tracing data from the associated SNT instance.voidshowViewerMessage(String msg) Displays a short status message in the viewer's overlay area.ij.ImagePlussnapshot()Retrieves the current scene as an image.ij.ImagePlusRetrieves the specified scene view as an image.voidUpdates the viewer display to reflect changes in rendered trees and paths.booleanSynchronizes the Path Manager contents with BVV display.voidLightweight alternative tosyncPathManagerList()for pure selection changes.voidupdateStatus(String message, int step, int nSteps) Updates the progress bar at the bottom of the BVV frame.Methods inherited from class sc.fiji.snt.viewer.AbstractBigViewer
addCollection, addTree, addTree, buildBaseSceneControlToolbar, clearAllTrees, getCalibration, getCalUnit, getMarkerManager, getRenderedTrees, getSNT, getUniqueLabel, registerMarkerKeyBinding, removeTree, showCalibrationDialog
-
Constructor Details
-
Bvv
public Bvv()Constructor for standalone BVV instance. -
Bvv
Constructor for assembling a BVV instance tethered to SNT.- Parameters:
snt- the snt instance providing paths and imagery to be rendered
-
-
Method Details
-
getInstance
Returns the most recently createdBvvinstance, ornullif none has been created yet. Convenience accessor for scripts.- Returns:
- the last initialised Bvv, or
null
-
show
public <T extends net.imglib2.type.numeric.RealType<T>> bvv.vistools.BvvSource show(net.imglib2.RandomAccessibleInterval<T> img, double... calibration) Displays the BVV viewer with the specified image.- Type Parameters:
T- the numeric type of the image data- Parameters:
img- the image data to displaycalibration- optional calibration values for x, y, z dimensions. If null, defaults to {1, 1, 1}- Returns:
- the BvvSource representing the displayed image
-
show
public <T extends net.imglib2.type.numeric.RealType<T>> bvv.vistools.BvvSource show(net.imagej.ImgPlus<T> imgPlus) -
show
public <T extends net.imglib2.type.numeric.RealType<T>> List<BvvMultiSource> show(List<net.imglib2.RandomAccessibleInterval<T>> imgs, List<double[]> calibrations) Displays a list ofRandomAccessibleIntervalvolumes, each as aBvvMultiSource. All volumes are added to the same BVV window.- Type Parameters:
T- the numeric type- Parameters:
imgs- the volumes to displaycalibrations- per-image calibration arrays (x, y, z pixel sizes); may benullto use defaults of {1,1,1}- Returns:
- list of
BvvMultiSource, one per volume
-
getMultiSources
Returns allBvvMultiSourcegroups currently managed by this viewer. This includes multichannel images and any grouped multi-image sources.- Returns:
- unmodifiable list of
BvvMultiSourcegroups
-
setChannelColors
Script-friendly method for setting per-channel colors- Parameters:
colorNames- color representations (HTML/css values, or hex)- See Also:
-
setChannelColors
Sets per-channel colors for a specific source group. Each color is applied to the corresponding channel in order; extra colors are ignored, and channels without a supplied color are left unchanged. Typical script usage:def bvv = Bvv.open([reference, moving]) bvv.setChannelColors(bvv.getMultiSources().get(0), Color.RED, Color.GREEN, Color.BLUE)
- Parameters:
group- the target source group, obtained fromgetMultiSources()colors- one color per channel, in channel order
-
setChannelColors
Sets per-channel colors across all source groups, assigning colors sequentially by global channel order across all groups. For example, with two 3-channel images and colors [R, G, B, C, M, Y], image 1 gets R/G/B and image 2 gets C/M/Y. With a single multichannel image or a dataset where each setup is its own group (e.g. IMS), colors are assigned one-to-one in load order.To apply the same color pattern to every group independently, call
Typical script usage:setChannelColors(BvvMultiSource, Color...)per group.def bvv = Bvv.open(img) bvv.setChannelColors(Color.RED, Color.GREEN, Color.BLUE)
- Parameters:
colors- colors assigned sequentially across all channels in all groups
-
setDisplayRange
Sets the display range (min/max intensity) for all channels of a specific source group.- Parameters:
group- the target source group, obtained fromgetMultiSources()min- the minimum intensity value (maps to black)max- the maximum intensity value (maps to full color)
-
open
Convenience factory: creates a standalone BVV viewer and displays one or moreImagePlusvolumes in one step. Multichannel images have their channels grouped and transformed together.Equivalent to:
Bvv bvv = new Bvv(); bvv.show(imp); // single image bvv.show(Arrays.asList(ref, moving)); // multiple images
Typical Groovy/PySNT usage:def bvv = Bvv.open(imp) // single image def bvv = Bvv.open(reference, moving) // multiple images
- Parameters:
imps- one or more images to display; all are added to the same BVV window- Returns:
- the fully initialised
Bvvinstance - Throws:
IllegalArgumentException- if an image type is unsupported (COLOR_256)
-
open
@SafeVarargs public static <T extends net.imglib2.type.numeric.RealType<T>> Bvv open(net.imagej.ImgPlus<T>... imgs) Convenience factory: creates a standalone BVV viewer and displays one or moreImgPlusvolumes in one step. Calibration (pixel sizes) is read automatically from eachImgPlus's metadata.Equivalent to:
Bvv bvv = new Bvv(); bvv.show(img); // single image
Typical Groovy/PySNT usage:def bvv = Bvv.open(imgPlus) def bvv = Bvv.open(imgPlus1, imgPlus2)
- Type Parameters:
T- the numeric type of the image data- Parameters:
imgs- one or more volumes to display; all are added to the same BVV window- Returns:
- the fully initialised
Bvvinstance
-
open
Script friendly convenience factory: creates a standalone BVV viewer and displays a list of images in one step. Accepts any mix ofImagePlus,ImgPlus, orRandomAccessibleIntervalobjects.Typical Groovy/PySNT usage:
def bvv = Bvv.open([reference, moving]) def bvv = Bvv.open(myImageList)
- Parameters:
imgs- the images to display; all are added to the same BVV window. Each element must be anImagePlus,ImgPlus, orRandomAccessibleInterval- Returns:
- the fully initialised
Bvvinstance - Throws:
IllegalArgumentException- if any element is null or of an unsupported type
-
open
Convenience factory: creates a BVV instance tethered to the givenSNTinstance and immediately displays its currently loaded image data.Equivalent to:
Bvv bvv = new Bvv(snt); bvv.showLoadedData();
Typical Groovy/PySNT usage:def bvv = Bvv.open(snt) bvv.add(snt.getPathAndFillManager().getTrees())
- Parameters:
snt- theSNTinstance providing image data and paths- Returns:
- the fully initialised
Bvvinstance tethered tosnt - Throws:
IllegalArgumentException- if no valid image data is loaded insnt
-
open
Convenience factory: creates a standalone BVV viewer and displays aAbstractSpimDatadataset using BVV's pyramid-aware GPU cache manager. Unlike theImgPlus/ImagePluspaths, this does not attempt to upload the entire volume at once: data is streamed as tiles on demand, making it suitable for out-of-core datasets.The caller is responsible for constructing the
AbstractSpimDataobject, typically via an XML/HDF5 loader:import bdv.spimdata.XmlIoSpimDataMinimal spimData = new XmlIoSpimDataMinimal().load("/path/to/dataset.xml") def bvv = Bvv.open(spimData)or via Bio-Formats/IMS loaders that produce aAbstractSpimDatawith a multiresolution pyramid.- Parameters:
spimData- the dataset to display- Returns:
- the fully initialised
Bvvinstance
-
open
Convenience factory: opens a file path into a BVV viewer. Seeopen(String...)for supported formats and behavior.- Parameters:
filePathOrUrl- the file path or URL to open- Returns:
- the fully initialised
Bvvinstance - Throws:
IllegalArgumentException- if the file cannot be opened or an.imsdirectory is not writable
-
open
Convenience factory: opens one or more file paths into the same BVV viewer window, choosing the most appropriate loading strategy per file:- .ims Imaris HDF5: creates a BDV XML sidecar file next to
the
.imsfile (using the same base name, e.g.dataset.xml), then loads it viaXmlIoSpimDataMinimal. BVV's pyramid-aware GPU cache manager is used, so the full volume is never loaded into RAM. If the directory is not writable, anIllegalArgumentExceptionis thrown with instructions to create the XML manually usingPlugins > BigDataViewer > Create XML for Imaris file. - .xml BDV XML/HDF5: loaded directly via
XmlIoSpimDataMinimaland displayed using BVV's cache manager. This covers BDV HDF5 and BDV N5 datasets. - .n5 / .zarr directories: opened directly via
n5-viewer_fiji(no XML sidecar) and displayed using BVV's cache manager. This covers plain N5 multiscale groups and OME-NGFF (OME-Zarr) containers. - anything else delegated to
ImgUtils.open(String)and displayed via the standardImgPluspath. Very large flat volumes will fail with a descriptive error rather than a GL crash.
def bvv = Bvv.open("/path/to/reference.xml", "/path/to/moving.ims")- Parameters:
paths- one or more file paths or URLs to open- Returns:
- the fully initialised
Bvvinstance - Throws:
IllegalArgumentException- if any file cannot be opened or an.imsdirectory is not writable
- .ims Imaris HDF5: creates a BDV XML sidecar file next to
the
-
show
Displays aAbstractSpimDatadataset using BVV's pyramid-aware GPU cache manager. Each setup (channel/angle) is added as a source and wrapped in aBvvMultiSource. Unlike theImgPlus/ImagePluspaths, the full volume is never loaded into RAM or GPU at once.- Parameters:
spimData- the dataset to display- Returns:
- list of
BvvMultiSource, one per BDV setup, in setup order
-
show
Displays sources loaded from an N5 or OME-Zarr container (seeSpimDataUtils.resolvePathToSource(String)), using BVV's pyramid-aware GPU cache manager. Unlikeshow(AbstractSpimData), there is no BDV-XML descriptor orAbstractSpimDatainvolved: sources are built directly usingn5-viewer_fiji.- Parameters:
n5Sources- the sources to display- Returns:
- list containing a single
BvvMultiSourcegrouping all setups
-
show
public bvv.vistools.BvvSource show(ij.ImagePlus imp) Displays the BVV viewer with the specified image.- Parameters:
imp- the ImagePlus to display- Returns:
- the BvvSource representing the displayed image
- Throws:
IllegalArgumentException- if the image type is unsupported (COLOR_256)
-
add
Script friendly method to add a supported object (Tree,DirectedWeightedGraph,Path) to the viewer overlay. Collections are also supported, which is an effective way of adding multiple items since the scene is only updated once all items have been added.- Overrides:
addin classAbstractBigViewer- Parameters:
object- the object to be added; null is silently ignored- Throws:
IllegalArgumentException- if object is not a supported type
-
add
Internal dispatcher with deferred sync support. Extends the parent's handling with support forPathobjects and null-tolerant behavior.- Overrides:
addin classAbstractBigViewer
-
add
Loads reconstruction files and adds them to the viewer with live progress feedback. Files are loaded one at a time on a background thread; the viewer scene is updated after each file so the user sees trees appearing incrementally. The progress bar in the SNT Annotations card tracks progress.- Overrides:
addin classAbstractBigViewer- Parameters:
reconstructionFiles- the reconstruction files (SWC, JSON, etc.) to load
-
updateStatus
Updates the progress bar at the bottom of the BVV frame.nSteps = 0: hides the barnSteps < 0: indeterminate mode (animated, no percentage)nSteps > 0: determinate mode showingstep/nSteps
- Parameters:
message- short status message displayed inside the barstep- current step (0-based; ignored in indeterminate mode)nSteps- total steps (0 = hide, negative = indeterminate)
-
syncOverlays
public void syncOverlays()Updates the viewer display to reflect changes in rendered trees and paths. This method should be called after modifying the collection of rendered objects to ensure the display is synchronized.- Specified by:
syncOverlaysin classAbstractBigViewer
-
annotations
Description copied from class:AbstractBigViewerReturns the annotation overlay for this viewer. The overlay renders point markers in the viewer's world coordinate space. May return null if the viewer has not been opened yet.- Specified by:
annotationsin classAbstractBigViewer
-
repaint
public void repaint()Forces a repaint of the viewer, updating volume renderings but not overlays.- Specified by:
repaintin classAbstractBigViewer
-
resetView
public void resetView()Resets the viewer to a fit-to-viewport transform, centering the loaded volume in the canvas. Equivalent to the Reset button in Camera Controls. No-op if no volume has been loaded.- Specified by:
resetViewin classAbstractBigViewer
-
snapshot
public ij.ImagePlus snapshot()Retrieves the current scene as an image.- Returns:
- the bitmap image of the current scene
-
snapshot
Retrieves the specified scene view as an image. Must be called from a non-EDT thread (e.g. a script or SwingWorker), otherwise the render latch will time out.- Parameters:
viewMode- the view mode (case-insensitive):"xy","xz","yz","default"(fit-to-viewport), or"current"(scene as-is).- Returns:
- the bitmap image of the scene view, or
nullif the viewer is not initialized
-
saveSnapshot
Saves a snapshot of current scene as a PNG image to the specified path.- Parameters:
filePath- the absolute path of the destination file- Returns:
- true, if file was successfully saved
-
getViewerFrame
public bvv.core.VolumeViewerFrame getViewerFrame()Description copied from class:AbstractBigViewerReturns the top-level Swing window for this viewer, or null if not yet open.- Specified by:
getViewerFramein classAbstractBigViewer- Returns:
- a reference to the viewer's frame.
-
getViewerSplitPanel
Description copied from class:AbstractBigViewerReturns the JSplitPane that separates the viewer canvas from the card panel. Both BDV and BVV frames expose this via their own getSplitPanel() methods, but those classes share no common supertype above JFrame, so this method lets subclasses expose the split pane without the abstract method returning a viewer-specific frame type.- Specified by:
getViewerSplitPanelin classAbstractBigViewer
-
getOptions
public bvv.vistools.BvvOptions getOptions()- Returns:
- a reference to the viewer's options.
-
getViewer
public bvv.core.BigVolumeViewer getViewer()- Returns:
- a reference to the underlying BigVolumeViewer instance.
-
getViewerPanel
public bvv.core.VolumeViewerPanel getViewerPanel()- Returns:
- a reference to the viewer's panel.
-
getRenderingOptions
Gets the path rendering options for controlling thickness, transparency, etc.- Overrides:
getRenderingOptionsin classAbstractBigViewer- Returns:
- the rendering options
-
isOpen
public boolean isOpen()Description copied from class:AbstractBigViewerReturns true if the viewer window is currently visible and usable.- Specified by:
isOpenin classAbstractBigViewer
-
getViewerWidth
public int getViewerWidth()Description copied from class:AbstractBigViewerReturns the width of the viewer canvas in logical pixels, or 0 if the viewer is not yet initialized.- Specified by:
getViewerWidthin classAbstractBigViewer
-
getViewerHeight
public int getViewerHeight()Description copied from class:AbstractBigViewerReturns the height of the viewer canvas in logical pixels, or 0 if the viewer is not yet initialized.- Specified by:
getViewerHeightin classAbstractBigViewer
-
getViewerTransform
public net.imglib2.realtransform.AffineTransform3D getViewerTransform()Description copied from class:AbstractBigViewerReturns a snapshot of the current viewer-to-screen (world-to-screen) transform. The returned object is a copy; callers may modify it freely.- Specified by:
getViewerTransformin classAbstractBigViewer
-
getCurrentSource
protected bdv.viewer.SourceAndConverter<?> getCurrentSource()Description copied from class:AbstractBigViewerReturns the currently active source, or null if none.- Specified by:
getCurrentSourcein classAbstractBigViewer
-
getViewerAction
Description copied from class:AbstractBigViewerLooks up a named action from the viewer's keybindings action map. Returns null if the action is not registered or the viewer is not ready.- Specified by:
getViewerActionin classAbstractBigViewer- Parameters:
name- the action key (e.g., "align XY plane")
-
addMouseListenerToDisplay
Description copied from class:AbstractBigViewerAdds a mouse listener to the viewer's canvas component so that click events on the display surface can be handled (e.g. for hit testing annotation markers).- Specified by:
addMouseListenerToDisplayin classAbstractBigViewer- Parameters:
ml- the listener to add
-
setViewerTransform
public void setViewerTransform(net.imglib2.realtransform.AffineTransform3D target, long durationMs) Description copied from class:AbstractBigViewerAnimates the viewer transform totargetoverdurationMsmilliseconds. UsedurationMs = 0for an immediate jump.- Specified by:
setViewerTransformin classAbstractBigViewer- Parameters:
target- the desired world-to-screen transformdurationMs- animation duration in milliseconds (0 = immediate)
-
showViewerMessage
Description copied from class:AbstractBigViewerDisplays a short status message in the viewer's overlay area.- Specified by:
showViewerMessagein classAbstractBigViewer- Parameters:
msg- the message to show
-
getGlobalMouseCoordinates
public void getGlobalMouseCoordinates(net.imglib2.RealPoint pos) Description copied from class:AbstractBigViewerWrites the current global (world-space) mouse position intopos. Callers must supply a pre-allocatedRealPointwith at least 3 dimensions.- Specified by:
getGlobalMouseCoordinatesin classAbstractBigViewer- Parameters:
pos- 3D point to receive the world-space cursor position
-
findClickRay
public double[][] findClickRay()Returns the world-space endpoints of the perspective ray through the current mouse cursor position: result[0] = near-clip world point, result[1] = far-clip world point. Returns null if the mouse is outside the display or the viewer is not initialized.The ray correctly accounts for BVV's perspective projection (
pf = dCam/(dCam+viewerZ)), giving a well-defined 3D ray for every screen pixel regardless of where the volume's focal plane sits. Use this instead ofgetGlobalMouseCoordinates(net.imglib2.RealPoint)when the Z coordinate of the picked point is important (e.g. landmark placement). -
findClickRayMaxima
public double[] findClickRayMaxima()Finds the world-space point of maximum intensity along the perspective ray through the current mouse cursor position.Casts a ray from the near clip plane to the far clip plane, samples the active source at 0.5-voxel intervals, and refines the peak location to sub-voxel accuracy via a 3-point parabola fit. Use this for landmark placement when the Z coordinate from the focal plane alone is unreliable.
- Returns:
- world-space [x, y, z] of the intensity maximum, or null if the ray misses the volume, the mouse is outside the display, or no source is loaded
-
getDefaultMarkerSize
public float getDefaultMarkerSize()Description copied from class:AbstractBigViewerReturns the default sphere radius (in physical units) for newly placed markers. Implementations typically derive this from their rendering-options or a sensible default.- Specified by:
getDefaultMarkerSizein classAbstractBigViewer
-
getDefaultMarkerColor
Description copied from class:AbstractBigViewerReturns the default color for newly placed markers, or null to use the viewer's own fallback color.- Specified by:
getDefaultMarkerColorin classAbstractBigViewer
-
createMarkerManager
Description copied from class:AbstractBigViewerCreates and returns a newBookmarkManagerfor this viewer. Called exactly once (lazily) byAbstractBigViewer.getMarkerManager().- Specified by:
createMarkerManagerin classAbstractBigViewer
-
setCalibration
Overrides the voxel calibration (spacing and unit) for all loaded sources. This is useful when the image metadata does not carry the correct spatial calibration (e.g., ND2 files opened via SCIFIO/Bio-Formats where the unit string is lost). The change takes effect immediately: the scale bar, distance measurements, and slab-thickness controls will all use the new values.- Overrides:
setCalibrationin classAbstractBigViewer- Parameters:
spacing- voxel size in {x, y, z} orderunit- physical unit string (e.g. "µm")
-
setDisplayRadii
public void setDisplayRadii(boolean display) Sets whether paths are rendered as tapered frusta with per-node radii (true) or as anti-aliased lines (false). Line rendering is significantly faster for datasets with many paths. Automatically invalidates the overlay cache and repaints.- Specified by:
setDisplayRadiiin classAbstractBigViewer- Parameters:
display-truefor frustum/radius rendering (default),falsefor fast line rendering
-
getDisplayRadii
public boolean getDisplayRadii()Returns whether paths are currently rendered with per-node radii as tapered frusta (true) or as simple lines (false).- Returns:
trueif frustum/radius rendering is active
-
setCanvasOffset
public void setCanvasOffset(double offsetX, double offsetY, double offsetZ) Offsets all paths being rendered. This allows for 'dislodging' paths from their underlying signal without altering their coordinates.- Specified by:
setCanvasOffsetin classAbstractBigViewer- Parameters:
offsetX- X offset (calibrated distance)offsetY- Y offset (calibrated distance)offsetZ- Z offset (calibrated distance)
-
isPathRenderingEnabled
protected boolean isPathRenderingEnabled()Description copied from class:AbstractBigViewerReturns true if path/tree overlay rendering is currently enabled.- Specified by:
isPathRenderingEnabledin classAbstractBigViewer
-
setPathRenderingEnabled
protected void setPathRenderingEnabled(boolean enabled) Description copied from class:AbstractBigViewerEnables or disables path/tree overlay rendering.- Specified by:
setPathRenderingEnabledin classAbstractBigViewer
-
showLoadedData
public bvv.vistools.BvvSource showLoadedData()Displays the main tracing data from the associated SNT instance. This method is only available for BVV instances that are tethered to an SNT instance.- Returns:
- the BvvSource representing the displayed tracing data
- Throws:
IllegalArgumentException- if this is a standalone viewer or no valid image data is available
-
showSecondaryData
public bvv.vistools.BvvSource showSecondaryData()Displays the secondary tracing data from the associated SNT instance. This method is only available for BVV instances that are tethered to an SNT instance.- Returns:
- the BvvSource representing the displayed secondary data
- Throws:
IllegalArgumentException- if this is a standalone viewer or no valid image data is available
-
syncPathManagerList
public boolean syncPathManagerList()Synchronizes the Path Manager contents with BVV display.- Overrides:
syncPathManagerListin classAbstractBigViewer- Returns:
- true if synchronization was successful
- Throws:
IllegalArgumentException- if this is a standalone viewer not tethered to a SNT instance
-
updateSelection
public void updateSelection()Lightweight alternative tosyncPathManagerList()for pure selection changes. Patches color/thickness in place for already-rendered trees instead of rebuilding the Path Manager's tree grouping and recomputing screen-space geometry for the whole scene. Does nothing if paths haven't been rendered yet (e.g., before the first sync); The nextsyncPathManagerList()call renders and colors them correctly regardless.- Throws:
IllegalArgumentException- if this viewer is not tethered to a SNT instance
-
getPhysicalUnit
Resolves the physical unit string for the currently loaded volume. Checks (in order): calUnit field, SNT spacing units, first source's VoxelDimensions (same source used by the scale bar renderer).- Overrides:
getPhysicalUnitin classAbstractBigViewer
-
captureKeyframe
Captures the current viewer state as aBvv.Keyframe. The transform, camera/slab parameters, and visible actor set are all snapshotted.- Returns:
- the current state as a Keyframe
-
accel
public static double accel(double t, int type) Easing functions for keyframe transitions, adapted from BDV movie recorder.- Parameters:
t- progress value in [0, 1]type- easing type: 0 = symmetric, 1 = slow start, 2 = slow end, 3 = soft symmetric, 4 = soft slow start, 5 = soft slow end- Returns:
- eased progress value in [0, 1]
-
playback
Plays back an animation between keyframes in the viewer without saving frames. Useful for previewing a movie before committing to a render. The frame count for each transition is read fromBvv.Keyframe.frameson the destination keyframe.- Parameters:
keyframes- ordered list of keyframes (at least 2)- See Also:
-
playback
Plays back a subset of keyframes (from indexfromto indexto, inclusive). Useful for previewing a specific transition without replaying the entire sequence.- Parameters:
keyframes- ordered list of all keyframesfrom- start index (inclusive, 0-based)to- end index (inclusive, 0-based)- See Also:
-
renderFrames
Renders an animation between a list of keyframes, saving each frame as a PNG screenshot. The transform is interpolated smoothly between keyframes usingSimilarityTransformAnimator; visibility and slab bounds snap at keyframe boundaries (no interpolation).The number of frames for each transition is read from
Bvv.Keyframe.frameson each destination keyframe (the first keyframe's value is ignored).This method must be called from a non-EDT thread. It blocks until all frames have been rendered and saved.
- Parameters:
keyframes- ordered list of keyframes (at least 2)outputDir- directory where PNGs will be saved (created if needed); ifnull, frames are played back live without saving- Throws:
IllegalArgumentException- if arguments are inconsistentIllegalStateException- if no BVV viewer is active
-