Package sc.fiji.snt
Class BookmarkManager
java.lang.Object
sc.fiji.snt.BookmarkManager
Implements the Bookmark Manager pane.
- Author:
- Tiago Ferreira
-
Constructor Summary
ConstructorsConstructorDescriptionBookmarkManager(SNTUI sntui) SNT constructor: implements the Bookmark Manager pane embedded in SNT's UI.BookmarkManager(Bvv bvv) BVV constructor: implements a standalone marker manager for a BVV viewer. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double x, double y, double z) BVV mode: adds a marker at the specified world coordinates.voidBVV mode: adds a marker at the specified world coordinates with a color and size.voidadd(int x, int y, int z, int c, int t) Adds a bookmark at the specified coordinates and time/channel positions.protected voidadd(int x, int y, int z, ij.ImagePlus imp) voidAdds multiple bookmarks with the specified label and locations.voidAdds multiple bookmarks with the specified label, locations, and color tag.voidAdds multiple bookmarks with the specified label and locations.voidAdds multiple bookmarks from selected path nodesvoidvoidaddBvvToolbarButton(JComponent component) Adds a component to the BVV toolbar section of this panel.voidClears the selection of bookmarks in the table.Returns the floating dialog for BVV mode, creating it on first call.intgetCount()Returns the number of bookmarks.protected JPanelgetPanel()getPixelPositions(boolean onlySelectedRows) Returns a list of points representing the bookmarks.getPositions(boolean onlySelectedRows) Returns a list of points representing the bookmarks.static List<ij.gui.PointRoi> static List<ij.gui.PointRoi> Creates a list ofPointRois from XYZCT locations with a color tag.List<ij.gui.Roi> getROIs(boolean onlySelectedRows) Returns a list of ROIs representing the bookmarks.booleanReturns whether any bookmarks exist.protected booleanvoidload(ij.gui.Roi[] rois) booleanLoads bookmarks from the specified file.booleanvoidLoads bookmarks from the specified list of ROIs.voidvoidreset()Clears all bookmarks.booleanSaves bookmarks to the specified file.booleanvoidAlias fortoggleBvvPanel()shows the marker panel.voidShows or hides the floating BVV marker panel.voidtoOverlay(ij.gui.Overlay overlay) Adds the bookmark ROIs to the specified overlay.voidAdds the bookmarks to the ROI Manager.
-
Constructor Details
-
BookmarkManager
SNT constructor: implements the Bookmark Manager pane embedded in SNT's UI. -
BookmarkManager
BVV constructor: implements a standalone marker manager for a BVV viewer. Markers are rendered as spheres in the BVV overlay and can be placed with theMkey. The manager is displayed as a floating panel.- Parameters:
bvv- the BVV viewer instance to attach to
-
-
Method Details
-
getBvvPanel
Returns the floating dialog for BVV mode, creating it on first call. -
addBvvToolbarButton
Adds a component to the BVV toolbar section of this panel. The component is appended after a separator the first time this method is called. Bvv uses this to inject context-specific controls (e.g. a slab-clip toggle).- Parameters:
component- the component to add; must not benull
-
toggleBvvPanel
public void toggleBvvPanel()Shows or hides the floating BVV marker panel. -
showPanel
public void showPanel()Alias fortoggleBvvPanel()shows the marker panel. -
getPanel
-
add
public void add(double x, double y, double z) BVV mode: adds a marker at the specified world coordinates. The marker is auto-labelled and immediately rendered in the BVV overlay.- Parameters:
x- world x-coordinatey- world y-coordinatez- world z-coordinate
-
add
BVV mode: adds a marker at the specified world coordinates with a color and size.- Parameters:
x- world x-coordinatey- world y-coordinatez- world z-coordinatecolor- the marker color, ornullfor the viewer defaultsize- the sphere radius in world units; 0 uses the viewer default
-
add
protected void add(int x, int y, int z, ij.ImagePlus imp) -
add
-
remove
-
add
public void add(int x, int y, int z, int c, int t) Adds a bookmark at the specified coordinates and time/channel positions.- Parameters:
x- the x-coordinate of the bookmarky- the y-coordinate of the bookmarkz- the z-coordinate of the bookmarkc- the channel position of the bookmarkt- the time position of the bookmark
-
add
Adds multiple bookmarks with the specified label and locations.- Parameters:
label- the label for the bookmarkslocations- the list of SNTPoint locations for the bookmarkschannel- the channel position for the bookmarksframe- the time position for the bookmarks
-
add
Adds multiple bookmarks with the specified label and locations.- Parameters:
label- the label for the bookmarksxyzctLocations- the list of XYZCT locations
-
add
Adds multiple bookmarks with the specified label, locations, and color tag.- Parameters:
label- the label prefix for the bookmarksxyzctLocations- the list of XYZCT locationscolor- the color tag for the bookmarks, ornullfor no tag
-
add
Adds multiple bookmarks from selected path nodes- Parameters:
map- the map of [k=Path, v=list of node indices] from which node positions are extractedcommonLabel- an (optional) bookmark label suffix
-
clearSelection
public void clearSelection()Clears the selection of bookmarks in the table. Does nothing if no selection exists. -
reset
public void reset()Clears all bookmarks. -
hasBookmarks
public boolean hasBookmarks()Returns whether any bookmarks exist.- Returns:
- true if there is at least one bookmark
-
isShowing
protected boolean isShowing() -
load
Loads bookmarks from the specified file.- Parameters:
file- the file to load bookmarks from. File is expected to be a CSV file with 6 columns in the following order: Label, X, Y, Z, C, T.- Returns:
- true if bookmarks were loaded successfully, false otherwise
-
load
- See Also:
-
load
Loads bookmarks from the specified list of ROIs. ROIs can be of any type. If area ROIs are provided, their centroids are used as bookmark locations.- Parameters:
rois- the list of ROIs to load bookmarks from
-
load
public void load(ij.gui.Roi[] rois) - See Also:
-
save
Saves bookmarks to the specified file.- Parameters:
file- the file to save bookmarks to- Returns:
- true if bookmarks were saved successfully, false otherwise
-
save
- See Also:
-
getCount
public int getCount()Returns the number of bookmarks.- Returns:
- the number of bookmarks currently stored in the manager.
-
getROIs
Returns a list of ROIs representing the bookmarks.- Parameters:
onlySelectedRows- if true, only selected rows are included; otherwise, all ROIs in the manager are included- Returns:
- the list of ROIs (PointRoi) representing the bookmarks
-
getPixelPositions
Returns a list of points representing the bookmarks.- Parameters:
onlySelectedRows- if true, only selected rows are included; otherwise, all ROIs in the manager are included- Returns:
- the list of Points representing the bookmarks
-
getPositions
Returns a list of points representing the bookmarks.- Parameters:
onlySelectedRows- if true, only selected rows are included; otherwise, all ROIs in the manager are included- Returns:
- the list of Points representing the bookmarks
-
toOverlay
public void toOverlay(ij.gui.Overlay overlay) Adds the bookmark ROIs to the specified overlay. If no bookmarks are selected, all bookmarks are added, otherwise only the selected bookmarks are added.- Parameters:
overlay- the overlay to add the bookmarks to. Null not allowed
-
toRoiManager
public void toRoiManager()Adds the bookmarks to the ROI Manager. If no bookmarks are selected, all bookmarks are added, otherwise only the selected bookmarks are added. -
getRois
-
getRois
public static List<ij.gui.PointRoi> getRois(String commonLabel, List<double[]> xyzctLocations, Color color) Creates a list ofPointRois from XYZCT locations with a color tag.- Parameters:
commonLabel- the label prefix for each ROIxyzctLocations- the list of XYZCT locations (pixel coordinates)color- the stroke color for the ROIs, ornullfor default- Returns:
- list of PointRoi objects
-