public abstract class BdvOverlay extends Object implements OverlayRenderer
BdvFunctions.showOverlay(BdvOverlay, String, BdvOptions): This method
will add a dummy Source and ConverterSetup to the
BigDataViewer such that the visibility, display range, and color for
the overlay can be adjusted by the user, like for a normal Source.
Derived classes need to implement draw(Graphics2D). They can access
the current viewer transform using
getCurrentTransform2D(AffineTransform2D),
getCurrentTransform3D(AffineTransform3D). They can access the
user-set display range and color via info.
| Modifier and Type | Field and Description |
|---|---|
protected PlaceHolderOverlayInfo |
info |
protected net.imglib2.realtransform.AffineTransform3D |
sourceTransform |
| Constructor and Description |
|---|
BdvOverlay() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
draw(Graphics2D g) |
void |
drawOverlays(Graphics g)
Render overlays.
|
protected void |
getCurrentTransform2D(net.imglib2.realtransform.AffineTransform2D transform)
Can be used by derived classes in the
draw(Graphics2D) method to
get the current transform from 2D source coordinates to screen
coordinates. |
protected void |
getCurrentTransform3D(net.imglib2.realtransform.AffineTransform3D transform)
Can be used by derived classes in the
draw(Graphics2D) method to
get the current transform from 3D source coordinates to 3D screen
coordinates (where Z coordinate is distance from the slice shown on the
screen). |
void |
setCanvasSize(int width,
int height)
This is called, when the screen size of the canvas (the component
displaying the image and generating mouse events) changes.
|
void |
setOverlayInfo(PlaceHolderOverlayInfo info) |
void |
setSourceTransform(net.imglib2.realtransform.AffineTransform3D t) |
protected final net.imglib2.realtransform.AffineTransform3D sourceTransform
protected PlaceHolderOverlayInfo info
public void setOverlayInfo(PlaceHolderOverlayInfo info)
public void setSourceTransform(net.imglib2.realtransform.AffineTransform3D t)
public void drawOverlays(Graphics g)
OverlayRendererdrawOverlays in interface OverlayRendererprotected void getCurrentTransform2D(net.imglib2.realtransform.AffineTransform2D transform)
draw(Graphics2D) method to
get the current transform from 2D source coordinates to screen
coordinates.transform - protected void getCurrentTransform3D(net.imglib2.realtransform.AffineTransform3D transform)
draw(Graphics2D) method to
get the current transform from 3D source coordinates to 3D screen
coordinates (where Z coordinate is distance from the slice shown on the
screen).transform - protected abstract void draw(Graphics2D g)
public void setCanvasSize(int width,
int height)
OverlayRenderersetCanvasSize in interface OverlayRendererwidth - the new canvas width.height - the new canvas height.Copyright © 2012–2025 BigDataViewer. All rights reserved.