public interface NDViewerAPI
NDViewer. The only requirement
is to call newImageArrived(HashMap)
newImageArrived} method each time a new image is available. It may also
be helpful to call setChannelColor(String, Color)
bitDepth} before each image arrives to initialize preferred
contrast controls| Modifier and Type | Method and Description |
|---|---|
void |
addControlPanel(ControlsPanelInterface panel)
Add a custom JPanel containing controls to the JTabbedPane on the right
side of the image.
|
void |
addSetImageHook(Consumer<HashMap<String,Object>> hook)
Add a hook function that runs whenever setImage gets called,
either programatically or by someone moving the scrollbars
|
void |
close()
Forces the viewer to close, automatically aborting any acquisition in the
process.
|
Object |
getAxisPosition(String axis)
Get the position that the scrollbar with the given label is currently at.
|
JPanel |
getCanvasJPanel()
Get reference to the JPanel on which image drawing takes place.
|
Point2D.Double |
getDisplayImageSize()
Get the size of the ge displayed on screen.
|
mmcorej.org.json.JSONObject |
getDisplaySettingsJSON()
Get the JSON represenation of the internal data structure use for saving
display and contrast settings.
|
Point2D.Double |
getFullResSourceDataSize()
Pixel size of the region currently being displayed in full resolution
pixels.
|
double |
getMagnification()
Return ratio between size of pixels on screen and size of full resolution
pixels in the imamge.
|
Point2D.Double |
getViewOffset()
get the offset of the top left displayed pixel to relative to top left of
the full image (in full resolution coordinates).
|
void |
initializeViewerToLoaded(List<String> channelNames,
mmcorej.org.json.JSONObject displaySettings,
HashMap<String,Object> axisMins,
HashMap<String,Object> axisMaxs)
Initialize all controls needed for a dataset loaded from disk
where you're not calling newImageArrived each time.
|
void |
newImageArrived(HashMap<String,Object> axes)
Call this whenever a new image arrives to optionally show it, and also so
that the size of the scrollbars expands.
|
void |
pan(int dx,
int dy)
Change the view offset by the specified amount.
|
void |
redrawOverlay()
trigger redraw of the image overlay.
|
void |
setAxisPosition(String axis,
int pos)
Set the scrollbar with a given axis label to a position.
|
void |
setChannelColor(String chName,
Color c)
Set display settings for channel with the given name.
|
void |
setCustomCanvasMouseListener(CanvasMouseListenerInterface m)
Add a custom object to respond to different types of mouse events on the
canvas.
|
void |
setOverlay(Overlay overlay)
Set a custom overlay object to be displayed on top of the image.
|
void |
setOverlayerPlugin(OverlayerPlugin overlayer)
Set a custom object to provide overlays.
|
void |
setReadTimeMetadataFunction(Function<mmcorej.org.json.JSONObject,Long> fn)
Optional: Pass in a function that tells how to extract elapsed ms from
image metadata, for display purposes.
|
void |
setReadZMetadataFunction(Function<mmcorej.org.json.JSONObject,Double> fn)
Optional: Pass in a function that tells how to extract z position in µm
from image tags, for display purposes.
|
void |
setViewOffset(double newX,
double newY)
set the offset of the top left displayed pixel to relative to top left of
the full image (in full resolution coordinates).
|
void |
setWindowTitle(String string)
Set the text in the windows frame.
|
void |
update()
Redraw current image and any overlay
|
void |
zoom(double factor,
Point location)
multiply zoom by given factor, centered at location.
|
void newImageArrived(HashMap<String,Object> axes)
axes - map of axis labels to integer positions or String labels.void addSetImageHook(Consumer<HashMap<String,Object>> hook)
hook - void setChannelColor(String chName, Color c)
chName - c - void setAxisPosition(String axis, int pos)
axis - pos - Object getAxisPosition(String axis)
axis - void initializeViewerToLoaded(List<String> channelNames, mmcorej.org.json.JSONObject displaySettings, HashMap<String,Object> axisMins, HashMap<String,Object> axisMaxs)
channelNames - names of all channelsaxisMins - map of axis names to miniumum extents (can be negative)axisMaxs - map of axis names to maximum extentsvoid setWindowTitle(String string)
string - void setReadTimeMetadataFunction(Function<mmcorej.org.json.JSONObject,Long> fn)
fn - void setReadZMetadataFunction(Function<mmcorej.org.json.JSONObject,Double> fn)
fn - mmcorej.org.json.JSONObject getDisplaySettingsJSON()
void close()
void update()
Point2D.Double getViewOffset()
Point2D.Double getFullResSourceDataSize()
double getMagnification()
void pan(int dx,
int dy)
dx - dy - void zoom(double factor,
Point location)
factor - location - location in display pixel coordinates, or null to zoom in
on centervoid setViewOffset(double newX,
double newY)
JPanel getCanvasJPanel()
void setCustomCanvasMouseListener(CanvasMouseListenerInterface m)
m - Point2D.Double getDisplayImageSize()
void setOverlay(Overlay overlay)
OverlayerPluginoverlay - void setOverlayerPlugin(OverlayerPlugin overlayer)
overlayer - void redrawOverlay()
void addControlPanel(ControlsPanelInterface panel)
panel - Copyright © 2023. All rights reserved.