- java.lang.Object
-
- bdv.util.BdvOverlay
-
- All Implemented Interfaces:
OverlayRenderer
- Direct Known Subclasses:
PointsOverlay
public abstract class BdvOverlay extends Object implements OverlayRenderer
An overlay that can be shown withBdvFunctions.showOverlay(BdvOverlay, String, BdvOptions): This method will add a dummySourceandConverterSetupto theBigDataViewersuch that the visibility, display range, and color for the overlay can be adjusted by the user, like for a normalSource.Derived classes need to implement
draw(Graphics2D). They can access the current viewer transform usinggetCurrentTransform2D(AffineTransform2D),getCurrentTransform3D(AffineTransform3D). They can access the user-set display range and color viainfo.- Author:
- Tobias Pietzsch
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaceHolderOverlayInfoinfoprotected net.imglib2.realtransform.AffineTransform3DsourceTransform
-
Constructor Summary
Constructors Constructor Description BdvOverlay()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddraw(Graphics2D g)voiddrawOverlays(Graphics g)Render overlays.protected voidgetCurrentTransform2D(net.imglib2.realtransform.AffineTransform2D transform)Can be used by derived classes in thedraw(Graphics2D)method to get the current transform from 2D source coordinates to screen coordinates.protected voidgetCurrentTransform3D(net.imglib2.realtransform.AffineTransform3D transform)Can be used by derived classes in thedraw(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).voidsetCanvasSize(int width, int height)This is called, when the screen size of the canvas (the component displaying the image and generating mouse events) changes.voidsetOverlayInfo(PlaceHolderOverlayInfo info)voidsetSourceTransform(net.imglib2.realtransform.AffineTransform3D t)
-
-
-
Field Detail
-
sourceTransform
protected final net.imglib2.realtransform.AffineTransform3D sourceTransform
-
info
protected PlaceHolderOverlayInfo info
-
-
Method Detail
-
setOverlayInfo
public void setOverlayInfo(PlaceHolderOverlayInfo info)
-
setSourceTransform
public void setSourceTransform(net.imglib2.realtransform.AffineTransform3D t)
-
drawOverlays
public void drawOverlays(Graphics g)
Description copied from interface:OverlayRendererRender overlays.- Specified by:
drawOverlaysin interfaceOverlayRenderer
-
getCurrentTransform2D
protected void getCurrentTransform2D(net.imglib2.realtransform.AffineTransform2D transform)
Can be used by derived classes in thedraw(Graphics2D)method to get the current transform from 2D source coordinates to screen coordinates.- Parameters:
transform-
-
getCurrentTransform3D
protected void getCurrentTransform3D(net.imglib2.realtransform.AffineTransform3D transform)
Can be used by derived classes in thedraw(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).- Parameters:
transform-
-
draw
protected abstract void draw(Graphics2D g)
-
setCanvasSize
public void setCanvasSize(int width, int height)Description copied from interface:OverlayRendererThis is called, when the screen size of the canvas (the component displaying the image and generating mouse events) changes. This can be used to determine scale of overlay or screen coordinates relative to the border.- Specified by:
setCanvasSizein interfaceOverlayRenderer- Parameters:
width- the new canvas width.height- the new canvas height.
-
-