public class NDViewer extends Object implements ViewerInterface
| Modifier and Type | Field and Description |
|---|---|
protected DataSourceInterface |
dataSource_ |
protected DataViewCoords |
viewCoords_ |
| Constructor and Description |
|---|
NDViewer(DataSourceInterface cache,
ViewerAcquisitionInterface acq,
mmcorej.org.json.JSONObject summaryMD,
double pixelSize,
boolean rgb) |
NDViewer(DataSourceInterface cache,
ViewerAcquisitionInterface acq,
mmcorej.org.json.JSONObject summaryMD,
double pixelSize,
boolean rgb,
String preferencesKey) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortAcquisition() |
void |
addControlPanel(ControlsPanelInterface panel)
Add a custom JPanel containing controls to the JTabbedPane on the right
side of the image.
|
void |
channelSetActive(String channelName,
boolean selected) |
void |
close()
Forces the viewer to close, automatically aborting any acquisition in the
process.
|
int |
getAxisPosition(String axis)
Get the position that the scrollbar with the given label is currently at.
|
ViewerCanvas |
getCanvas() |
JPanel |
getCanvasJPanel()
Get reference to the JPanel on which image drawing takes place.
|
Integer |
getChannelIndex(String channel) |
String |
getChannelName(int position) |
Iterable<String> |
getChannels() |
String |
getCurrentT() |
String |
getCurrentZPosition() |
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.
|
DisplaySettings |
getDisplaySettingsObject() |
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.
|
double |
getPixelSize() |
Preferences |
getPreferences() |
mmcorej.org.json.JSONObject |
getSummaryMD() |
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 dispSettings,
HashMap<String,Integer> axisMins,
HashMap<String,Integer> axisMaxs)
Initialize all controls needed for a dataset loaded from disk
where you're not calling newImageArrived each time.
|
boolean |
isAcquisitionPaused() |
boolean |
isCompositMode() |
boolean |
isImageXYBounded() |
void |
newImageArrived(HashMap<String,Integer> axesPositions,
String channelName)
Signal to viewer that a new image is available.
|
void |
onAnimationToggle(AxisScroller scoller,
boolean animate) |
void |
onCanvasResize(int w,
int h) |
void |
onContrastUpdated() |
void |
onScollersAdded() |
void |
onScollPositionChanged(AxisScroller scroller,
int value) |
void |
pan(int dx,
int dy)
Change the view offset by the specified amount.
|
void |
redrawOverlay()
trigger redraw of the image overlay.
|
void |
requestToClose()
Called when window is x-ed out by user.
|
void |
setAnimateFPS(double doubleValue) |
void |
setAxisPosition(String axis,
int position)
Set the scrollbar with a given axis label to a position.
|
void |
setChannelColor(String channel,
Color c) |
void |
setChannelDisplaySettings(String channel,
Color c,
int bitDepth)
Set display settings for channel with the given name.
|
void |
setCompositeMode(boolean selected) |
void |
setCustomCanvasMouseListener(CanvasMouseListenerInterface m)
Add a custom object to respond to different types of mouse events on the
canvas.
|
void |
setImageEvent(HashMap<String,Integer> axes,
boolean fromHuman)
Called when scrollbars move
|
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 s)
Set the text in the windows frame.
|
void |
showFolder() |
void |
showScaleBar(boolean selected) |
void |
showTimeLabel(boolean selected) |
void |
showZPositionLabel(boolean selected) |
void |
superlockAllScrollers() |
void |
togglePauseAcquisition() |
void |
unlockAllScroller() |
void |
update()
Redraw current image and any overlay
|
void |
zoom(double factor,
Point mouseLocation)
multiply zoom by given factor, centered at location.
|
protected DataSourceInterface dataSource_
protected DataViewCoords viewCoords_
public NDViewer(DataSourceInterface cache, ViewerAcquisitionInterface acq, mmcorej.org.json.JSONObject summaryMD, double pixelSize, boolean rgb)
public NDViewer(DataSourceInterface cache, ViewerAcquisitionInterface acq, mmcorej.org.json.JSONObject summaryMD, double pixelSize, boolean rgb, String preferencesKey)
public void setReadTimeMetadataFunction(Function<mmcorej.org.json.JSONObject,Long> fn)
ViewerInterfacesetReadTimeMetadataFunction in interface ViewerInterfacepublic void setReadZMetadataFunction(Function<mmcorej.org.json.JSONObject,Double> fn)
ViewerInterfacesetReadZMetadataFunction in interface ViewerInterfacepublic void setChannelDisplaySettings(String channel, Color c, int bitDepth)
ViewerInterfacesetChannelDisplaySettings in interface ViewerInterfacepublic boolean isImageXYBounded()
public mmcorej.org.json.JSONObject getDisplaySettingsJSON()
ViewerInterfacegetDisplaySettingsJSON in interface ViewerInterfacepublic Preferences getPreferences()
public void pan(int dx,
int dy)
ViewerInterfacepan in interface ViewerInterfacepublic void onScollersAdded()
public void onScollPositionChanged(AxisScroller scroller, int value)
public void zoom(double factor,
Point mouseLocation)
ViewerInterfacezoom in interface ViewerInterfacemouseLocation - location in display pixel coordinates, or null to zoom in
on centerpublic void onCanvasResize(int w,
int h)
public void initializeViewerToLoaded(List<String> channelNames, mmcorej.org.json.JSONObject dispSettings, HashMap<String,Integer> axisMins, HashMap<String,Integer> axisMaxs)
ViewerInterfaceinitializeViewerToLoaded in interface ViewerInterfacechannelNames - names of all channelsaxisMins - map of axis names to miniumum extents (can be negative)axisMaxs - map of axis names to maximum extentspublic void channelSetActive(String channelName, boolean selected)
public void setWindowTitle(String s)
ViewerInterfacesetWindowTitle in interface ViewerInterfacepublic void newImageArrived(HashMap<String,Integer> axesPositions, String channelName)
newImageArrived in interface ViewerInterfaceaxesPositions - Hashmap of axis labels to positionschannelName - public void setAxisPosition(String axis, int position)
ViewerInterfacesetAxisPosition in interface ViewerInterfacepublic void setImageEvent(HashMap<String,Integer> axes, boolean fromHuman)
public void onContrastUpdated()
public void onAnimationToggle(AxisScroller scoller, boolean animate)
public void update()
ViewerInterfaceupdate in interface ViewerInterfacepublic ViewerCanvas getCanvas()
public void superlockAllScrollers()
public void unlockAllScroller()
public void showFolder()
public void setAnimateFPS(double doubleValue)
public void abortAcquisition()
public void togglePauseAcquisition()
public boolean isAcquisitionPaused()
public void setOverlay(Overlay overlay)
ViewerInterfaceOverlayerPluginsetOverlay in interface ViewerInterfacepublic void redrawOverlay()
ViewerInterfaceredrawOverlay in interface ViewerInterfacepublic double getMagnification()
ViewerInterfacegetMagnification in interface ViewerInterfacepublic double getPixelSize()
public void showScaleBar(boolean selected)
public void setCompositeMode(boolean selected)
public boolean isCompositMode()
public DisplaySettings getDisplaySettingsObject()
public JPanel getCanvasJPanel()
ViewerInterfacegetCanvasJPanel in interface ViewerInterfacepublic int getAxisPosition(String axis)
ViewerInterfacegetAxisPosition in interface ViewerInterfacepublic Point2D.Double getViewOffset()
ViewerInterfacegetViewOffset in interface ViewerInterfacepublic Point2D.Double getFullResSourceDataSize()
ViewerInterfacegetFullResSourceDataSize in interface ViewerInterfacepublic void setViewOffset(double newX,
double newY)
ViewerInterfacesetViewOffset in interface ViewerInterfacepublic String getChannelName(int position)
public void showTimeLabel(boolean selected)
public void showZPositionLabel(boolean selected)
public String getCurrentT()
public String getCurrentZPosition()
public void setCustomCanvasMouseListener(CanvasMouseListenerInterface m)
ViewerInterfacesetCustomCanvasMouseListener in interface ViewerInterfacepublic Point2D.Double getDisplayImageSize()
ViewerInterfacegetDisplayImageSize in interface ViewerInterfacepublic void setOverlayerPlugin(OverlayerPlugin overlayer)
ViewerInterfacesetOverlayerPlugin in interface ViewerInterfacepublic void addControlPanel(ControlsPanelInterface panel)
ViewerInterfaceaddControlPanel in interface ViewerInterfacepublic void requestToClose()
public void close()
ViewerInterfaceclose in interface ViewerInterfacepublic mmcorej.org.json.JSONObject getSummaryMD()
Copyright © 2022. All rights reserved.