@@ -350,6 +350,9 @@ public String toString() {
350350
351351 /* GUI */
352352 protected SNTUI ui ;
353+ // Whether this session is running in stream mode ("SNT Stream"), i.e., without access to a full
354+ // in-core materialized image (see BigDataLoaderCmd)
355+ private boolean bigDataMode ;
353356 protected volatile boolean tracingHalted = false ; // Tracing functions paused?
354357 protected volatile boolean rubberBandTracing = false ; // Rubber band (live preview) tracing mode
355358
@@ -981,6 +984,7 @@ public void startUI(final boolean bigDataMode) {
981984 }
982985
983986 private void startUIOnEDT (final boolean bigDataMode ) {
987+ setBigDataMode (bigDataMode );
984988 GuiUtils .setLookAndFeel ();
985989 final SNT thisPlugin = this ;
986990 ui = new SNTUI (thisPlugin , bigDataMode );
@@ -3559,7 +3563,7 @@ public void enableSecondaryLayerTracing(final boolean enable) {
35593563 // NB: enableSecondaryLayerTracing() is reached from several off-EDT callers but showSecondaryData()
35603564 // does BVV/BDV Swing/OpenGL setup that. Calling it directly from a worker thread is a silent EDT/GL
35613565 // threading violation (no exception, just a hang), hence the explicit invokeLater() below
3562- if (getUI () != null && getUI (). isStreamMode () ) {
3566+ if (isStreamMode () && getUI () != null ) {
35633567 final var viewer = getUI ().getActiveBigViewer ();
35643568 if (viewer != null ) {
35653569 SwingUtilities .invokeLater (() -> {
@@ -3598,7 +3602,7 @@ public void flushSecondaryData() {
35983602 // Bdv/Bvv viewer (see enableSecondaryLayerTracing()'s showSecondaryData() hook); flushing it
35993603 // here should remove that source toot. Same invokeLater() rationale as that hook:
36003604 // hideSecondaryData() touches Swing/OpenGL state and may be reached from off-EDT callers.
3601- if (getUI (). isStreamMode ()) {
3605+ if (isStreamMode ()) {
36023606 final var viewer = getUI ().getActiveBigViewer ();
36033607 if (viewer != null ) {
36043608 SwingUtilities .invokeLater (() -> {
@@ -4441,7 +4445,7 @@ public void closeAndResetAllPanes() {
44414445 // Dispose xz/zy images unless the user stored some annotations (ROIs)
44424446 // on the image overlay or modified them somehow.
44434447 removeMIPOverlayAllPanes ();
4444- final boolean bvvMode = getUI () != null && getUI (). isStreamMode ();
4448+ final boolean bvvMode = isStreamMode ();
44454449 if (!single_pane ) {
44464450 final ImagePlus [] impPanes = { xz , zy };
44474451 for (final ImagePlus imp : impPanes ) {
@@ -4516,6 +4520,29 @@ public SNTUI getUI() {
45164520 return ui ;
45174521 }
45184522
4523+ /**
4524+ * Returns whether this session is running in stream mode ("SNT Stream"), i.e., without access to
4525+ * a full in-core materialized image but rather a lazily-loaded BDV/BVV-backed source (typically
4526+ * an OME-Zarr/N5 dataset; see {@link sc.fiji.snt.gui.cmds.BigDataLoaderCmd}).
4527+ *
4528+ * @return true if in stream mode
4529+ */
4530+ public boolean isStreamMode () {
4531+ return bigDataMode ;
4532+ }
4533+
4534+ /**
4535+ * Sets the stream-mode flag returned by {@link #isStreamMode()}. Package-private: the only
4536+ * legitimate callers are {@link #startUIOnEDT(boolean)} (before constructing {@link SNTUI}) and
4537+ * {@link SNTUI}'s own constructor (covering direct {@code new SNTUI(plugin, bigDataMode)}
4538+ * construction that bypasses {@link #startUI(boolean)}).
4539+ *
4540+ * @param bigDataMode the new stream-mode flag
4541+ */
4542+ void setBigDataMode (final boolean bigDataMode ) {
4543+ this .bigDataMode = bigDataMode ;
4544+ }
4545+
45194546 /* (non-Javadoc)
45204547 * @see MultiDThreePanes#showStatus(int, int, java.lang.String)
45214548 */
0 commit comments