Interface SnapLiveManager
public interface SnapLiveManager
Interface for interacting with the Snap/Live display and live mode. You can
access this via Studio.live() or Studio.getSnapLiveManager().
-
Method Summary
Modifier and TypeMethodDescriptionvoiddisplayImage(Image image) Insert the provided image into the Datastore, causing it to be displayed in any open Snap/Live DisplayWindows.Return the DisplayWindow used for snap/live mode.default booleanDeprecated.booleanReturns whether live mode is on.default voidsetLiveMode(boolean on) Deprecated.voidsetLiveModeOn(boolean on) Turns live mode on or off.voidsetSuspended(boolean shouldSuspend) Temporarily halt live mode, or re-start it after a temporary halt.snap(boolean shouldDisplay) Perform a snap and display the results, if desired.
-
Method Details
-
snap
Perform a snap and display the results, if desired. Returns the raw snapped image(s). If live mode is currently on, then instead of performing a snap, the most recent images from live mode will be returned immediately. Otherwise, this method will call AcquisitionManager.snap() to perform the snap.- Parameters:
shouldDisplay- If true, then the snapped images will be added to the Snap/Live display's Datastore and displayed. Note that the displayed images will be run through the current application data processing pipeline (if any) prior to display. Consequently, there is no guarantee that a Snap/Live display window will be open after calling snap(), even if shouldDisplay is set to true. If you want to know when the display is visible, call getDislay().waitUntilVisible() after calling snap().- Returns:
- A list of acquired Images from the snap.
-
isLiveModeOn
boolean isLiveModeOn()Returns whether live mode is on.If live mode is on but suspended, this method returns
true.- Returns:
- true if live mode is on.
-
getIsLiveModeOn
Deprecated. -
setLiveModeOn
void setLiveModeOn(boolean on) Turns live mode on or off. This will post an org.micromanager.events.LiveModeEvent on the global application event bus.- Parameters:
on- If true, then live mode will be activated; otherwise it will be halted.
-
setLiveMode
Deprecated. -
setSuspended
void setSuspended(boolean shouldSuspend) Temporarily halt live mode, or re-start it after a temporary halt. This is useful for actions that cannot be performed while live mode is running (such as changing many camera settings), so that live mode can be re-started once the action is complete. Instead of calling isLiveModeOn(), stopping it if necessary, and then re-starting it if it was on, you can instead blindly do: - setSuspended(true); - do something that can't run when live mode is on; - setSuspended(false); and live mode will only be re-started if it was on to begin with. Note that suspending live mode does not produce LiveModeEvents, as the expectation is that live mode is only suspended for very brief periods.- Parameters:
shouldSuspend- If true, then live mode will be halted if it is running. If false, and live mode was running when setSuspended(true) was called, then live mode will be restarted.
-
displayImage
Insert the provided image into the Datastore, causing it to be displayed in any open Snap/Live DisplayWindows. If no displays are open or if the image dimensions don't match those of the previously-displayed images, then a new display will be created.- Parameters:
image- Image to be displayed
-
getDisplay
DisplayWindow getDisplay()Return the DisplayWindow used for snap/live mode. May be null if that display has been closed. Snap/live mode only "knows about" the display it itself created -- thus, if the user duplicates that display and then closes the original, you will get null when you call this method. Likewise, the snap/live display window that the SnapLiveManager uses is prone to being closed and re-created (e.g. when the parameters of images generated by the Core are changed). Consequently, it is not recommended that you keep references to the result of this method hanging around in memory for long periods, as they may become out-of-date.- Returns:
- DisplayWindow used for snap/live mode
-