From 7c4e24668ea29ffb1030b05e1a0113df39721436 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 13 Aug 2026 09:56:45 -0700 Subject: [PATCH 1/5] bump the version to 0.8.3 --- pom.xml | 2 +- .../micromanager/lightsheetmanager/LightSheetManagerPlugin.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d8b08c5..352169d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.micro-manager.lightsheetmanager LightSheetManager - 0.2.2 + 0.8.3 jar LightSheetManager plugin Java-based Micro-Manager plugin for controlling light sheet microscopes diff --git a/src/main/java/org/micromanager/lightsheetmanager/LightSheetManagerPlugin.java b/src/main/java/org/micromanager/lightsheetmanager/LightSheetManagerPlugin.java index e918010..c605fa1 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/LightSheetManagerPlugin.java +++ b/src/main/java/org/micromanager/lightsheetmanager/LightSheetManagerPlugin.java @@ -15,7 +15,7 @@ public class LightSheetManagerPlugin implements MenuPlugin, SciJavaPlugin { public static final String copyright = "Applied Scientific Instrumentation (ASI), 2022-2026"; public static final String description = "A plugin to control various types of light sheet microscopes."; public static final String menuName = "Light Sheet Manager"; - public static final String version = "0.8.0"; + public static final String version = "0.8.3"; private Studio studio_; From 41d33e0906af20bdc9dbf037c5f31bccd70eccf6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 14 Aug 2026 01:26:43 -0700 Subject: [PATCH 2/5] use null as a sentinel value for xyPosUm --- .../model/acquisitions/AcquisitionEngineScape.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java index e5307b6..9576200 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -83,7 +83,9 @@ boolean setup() { // including the refusals, and restores these unconditionally. Initialized further down they // are still at their field defaults on those paths, so finish() writes 0.0. The stage rejects // that for speed but ACCEPTS it for acceleration, leaving it unable to move properly. - xyPosUm_ = new Point2D.Double(); + // null means this run never captured a position, so finish() leaves the stage alone. + // (0,0) cannot say that because it is a position the stage can actually be at. + xyPosUm_ = null; origSpeedX_ = 1.0; // don't want 0 in case something goes wrong origAccelX_ = 1.0; // don't want 0 in case something goes wrong @@ -809,7 +811,8 @@ void finish() { xyStage.setSpeedX(origSpeedX_); xyStage.setAccelerationX(origAccelX_); - if (returnToOriginalPosition) { + // xyPosUm_ is null when setup() returned before it captured a position + if (returnToOriginalPosition && xyPosUm_ != null) { xyStage.setXYPosition(xyPosUm_.x, xyPosUm_.y); } } From e730ff33b95beb7f8d548caab48de2afde71710f Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 14 Aug 2026 02:23:45 -0700 Subject: [PATCH 3/5] add null check to xyStage and returnToOriginalPosition check --- .../acquisitions/AcquisitionEngineScape.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java index 9576200..a1da2c6 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -802,18 +802,23 @@ void finish() { // if we did stage scanning restore the original position and speed if (acqSettings_.stageScan().enabled()) { final ASIXYStage xyStage = model_.devices().device("SampleXY"); - final boolean returnToOriginalPosition = - acqSettings_.stageScan().returnToStart(); - - // make sure stage scanning state machine is stopped, - // otherwise setting speed/position won't take - xyStage.setScanState(ASIXYStage.ScanState.IDLE); - xyStage.setSpeedX(origSpeedX_); - xyStage.setAccelerationX(origAccelX_); - - // xyPosUm_ is null when setup() returned before it captured a position - if (returnToOriginalPosition && xyPosUm_ != null) { - xyStage.setXYPosition(xyPosUm_.x, xyPosUm_.y); + if (xyStage == null) { + // setup() can return before its own stage checks, such as a save location refusal + studio_.logs().logError("Could not restore the stage: no SampleXY device"); + } else { + final boolean returnToOriginalPosition = + acqSettings_.stageScan().returnToStart(); + + // make sure stage scanning state machine is stopped, + // otherwise setting speed/position won't take + xyStage.setScanState(ASIXYStage.ScanState.IDLE); + xyStage.setSpeedX(origSpeedX_); + xyStage.setAccelerationX(origAccelX_); + + // xyPosUm_ is null when setup() returned before it captured a position + if (returnToOriginalPosition && xyPosUm_ != null) { + xyStage.setXYPosition(xyPosUm_.x, xyPosUm_.y); + } } } From 1c3f050b5d9cfeb137f1ce77eb205c20057703a7 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 14 Aug 2026 02:34:45 -0700 Subject: [PATCH 4/5] clarify what setting the preferred save mode does --- .../model/acquisitions/AcquisitionEngineScape.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java index a1da2c6..965fe25 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -280,8 +280,10 @@ boolean run() { } } - // This sets the preferred save mode for DefaultDatastore, this value - // is used in the MMAcquisition constructor to set the Storage object. + // Sets MM's persisted preferred save mode. Inert today: MMAcquisition reads it only when + // SequenceSettings has save() and root() set, and we set neither, so our datastore is + // always StorageRAM and finish() passes the mode to save() explicitly. Kept because it is + // the only channel MMAcquisition offers if direct to disk is re-enabled. if (acqSettings_.saveMode() == SaveMode.ND_TIFF) { DefaultDatastore.setPreferredSaveMode(studio_, Datastore.SaveMode.ND_TIFF); } else if (acqSettings_.saveMode() == SaveMode.MULTIPAGE_TIFF) { From 79dce78d5934686661f5a2d83683a700b09f14eb Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 14 Aug 2026 02:39:31 -0700 Subject: [PATCH 5/5] rever pom.xml change for now --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 352169d..d8b08c5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.micro-manager.lightsheetmanager LightSheetManager - 0.8.3 + 0.2.2 jar LightSheetManager plugin Java-based Micro-Manager plugin for controlling light sheet microscopes