From 1f15d04c99daf0f01d953d83e1c7ea035d57c511 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 11:43:08 -0700 Subject: [PATCH 1/8] use Math.toRadians() in GeometryUtils --- .../lightsheetmanager/model/utils/GeometryUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java b/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java index f45ac55f..394b978c 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java @@ -20,7 +20,7 @@ public static double getStageGeometricShiftFactor(double angle, final boolean pa if (!pathA) { angle = 90.0 - angle; } - return Math.tan(angle/180.0*Math.PI); + return Math.tan(Math.toRadians(angle)); } /*** @@ -34,7 +34,7 @@ public static double getStageTopViewCompressFactor(double angle, final boolean p if (!pathA) { angle = 90.0 - angle; } - return Math.cos(angle/180.0*Math.PI); + return Math.cos(Math.toRadians(angle)); } /*** From fc0efe609683ddaa6f04c94552acfd42178d788f Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 11:48:54 -0700 Subject: [PATCH 2/8] fix comments in the scape engine --- .../model/acquisitions/AcquisitionEngineScape.java | 7 +++---- 1 file changed, 3 insertions(+), 4 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 02a2d2c9..0cc86618 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -848,7 +848,6 @@ private void submitEvents(final ScapeAcquisitionSettings settings, final String[ // TODO: execute any start-acquisition runnables - // Loop 1: XY positions PositionList pl = positionList_; // never in separate mode: without a controller the hardware flag is not recomputed, so @@ -1835,9 +1834,9 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // 3. camera reset time // 4. start scan 0.25ms before camera global exposure and shifted up in time to account for delay introduced by Bessel filter // 5. turn on laser as soon as camera global exposure, leave laser on for desired light exposure time - // 7. end camera exposure in final 0.25ms, post-filter scan waveform also ends now + // 6. end camera exposure in final 0.25ms, post-filter scan waveform also ends now - CameraBase camera = model_.devices().firstImagingCamera(); //.getDevice("ImagingCamera"); + CameraBase camera = model_.devices().firstImagingCamera(); if (camera == null) { // just a dummy to test demo mode return DefaultTimingSettings.builder(); @@ -1901,7 +1900,7 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // figure out desired time for camera to be exposing (including reset time) // because both camera trigger and laser on occur on 0.25ms intervals (i.e. we may not - // trigger the laser until 0.24ms after global exposure) use cameraReset_max + // trigger the laser until 0.24ms after global exposure) use cameraResetMax // special adjustment for Photometrics cameras that possibly has extra clear time which is counted in reset time // but not in the camera exposure time // TODO: skipped PVCAM case, this should already be handled by camera.getResetTime(camMode); but there may be differences From e52c30ebca607451534fdad262d11c471129c468 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:02:54 -0700 Subject: [PATCH 3/8] fix units and a typo in comments --- .../gui/tabs/navigation/NavigationPanel.java | 2 +- .../lightsheetmanager/model/devices/cameras/PcoCamera.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java index 194a32e2..f02cc673 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java @@ -120,7 +120,7 @@ private void createUserInterface() { model_, propertyName, deviceName, deviceType, ControlPanel.Axis.X, ControlPanel.Units.DEGREES); ControlPanel controlPanelY = new ControlPanel( model_, propertyName, deviceName, deviceType, ControlPanel.Axis.Y, ControlPanel.Units.DEGREES); - // TODO: check for ASI hardware when settings units + // TODO: check for ASI hardware when setting units illumProperties.get(pathNum - 1).add(controlPanelX); illumProperties.get(pathNum - 1).add(controlPanelY); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java index 02b7f490..dfb9143e 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java @@ -74,8 +74,8 @@ public double getRowReadoutTime() { return Double.parseDouble(getProperty(Properties.LINE_TIME))/1000.0; } else { if (isPanda()) { - // documentation not clear but suggests line time < 13ms - // empirically observed 12.5us + 0.0056us*ROI height (centered), e.g. 24ms at full frame in one set of measurements + // documentation not clear but suggests line time < 13us + // empirically observed 12.5us + 0.0056us*ROI height (centered), e.g. 24us at full frame in one set of measurements // another set of measurements it seemed approximately linear in log(height) // for now just use pessimistic but safe 24us // TODO get more accurate value From fef85752f31b967f6f8be7ceb349ff621ba578e1 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:04:17 -0700 Subject: [PATCH 4/8] name the device and the cause when a property limit cannot be read --- .../lightsheetmanager/model/devices/DeviceBase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java index 2c3b6887..5a804598 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java @@ -114,7 +114,8 @@ public double getPropertyUpperLimit(final String propertyName) { return core_.getPropertyUpperLimit(deviceName_, propertyName); } } catch (Exception e) { - studio_.logs().logDebugMessage("Property " + propertyName + " has no upper limit or is non-numeric."); + studio_.logs().logDebugMessage("Could not get the upper limit of the \"" + propertyName + + "\" property of " + deviceName_ + ": " + e.getMessage()); } return Double.MAX_VALUE; } @@ -125,7 +126,8 @@ public double getPropertyLowerLimit(final String propertyName) { return core_.getPropertyLowerLimit(deviceName_, propertyName); } } catch (Exception e) { - studio_.logs().logDebugMessage("Property " + propertyName + " has no lower limit or is non-numeric."); + studio_.logs().logDebugMessage("Could not get the lower limit of the \"" + propertyName + + "\" property of " + deviceName_ + ": " + e.getMessage()); } return -Double.MAX_VALUE; // Double.MIN_VALUE is a value close to 0 so use -Double.MAX_VALUE } From db049d4a873343e621385f7b365d764539c25c83 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:05:23 -0700 Subject: [PATCH 5/8] name the cause when the device library or the loaded devices cannot be read --- .../lightsheetmanager/model/DeviceManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java index 813ab0ff..d5a66074 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java @@ -413,7 +413,8 @@ public String getDeviceLibrary(final String deviceName) { try { result = core_.getDeviceLibrary(deviceName); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("could not get the device library of " + deviceName + ": " + + e.getMessage()); } return result; } @@ -431,7 +432,7 @@ public String[] getLoadedDevices() { try { loadedDevices = core_.getLoadedDevices(); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("could not get the loaded devices: " + e.getMessage()); } return loadedDevices.toArray(); } @@ -461,7 +462,7 @@ public boolean hasDeviceAdapter() { } } catch (Exception e) { studio_.logs().logError("could not get the device " + - "library for the device \"" + device + "\"."); + "library for the device \"" + device + "\": " + e.getMessage()); } } // no device adapters found From d1a735bebf5a230056f4ec56ad07268d98a8347a Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:06:49 -0700 Subject: [PATCH 6/8] name the cause when the shutter cannot be set to the laser plogic --- .../org/micromanager/lightsheetmanager/model/PLogicScape.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java index f80edca3..7bcc97e6 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java @@ -157,7 +157,8 @@ public boolean prepareControllerForAcquisition( try { core_.setShutterDevice(plcLaser_.getDeviceName()); } catch (Exception e) { - model_.logging().reportError("could not set shutter to " + plcLaser_.getDeviceName()); + model_.logging().reportError("could not set shutter to " + plcLaser_.getDeviceName() + + ": " + e.getMessage()); } if (!acqSettings_.stageScan().enabled()) { From 07f8fdf8ddabd5804ebb2405f2bdcbf83fff3846 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:35:47 -0700 Subject: [PATCH 7/8] name the camera and the cause when core-camera cannot be set or restored --- .../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 0cc86618..3c2315c4 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -205,7 +205,8 @@ boolean setup() { try { core_.setCameraDevice(cameraName); } catch (Exception e) { - model_.logging().reportError("Could not set \"Core-Camera\" to the first logical camera device."); + model_.logging().reportError("Could not set \"Core-Camera\" to the first logical camera device " + + cameraName + ": " + e.getMessage()); return false; } @@ -1354,7 +1355,8 @@ void finish() { try { core_.setCameraDevice(originalCoreCamera_); } catch (Exception e) { - studio_.logs().logError("Could not restore Core-Camera to " + originalCoreCamera_); + studio_.logs().logError("Could not restore Core-Camera to " + originalCoreCamera_ + + ": " + e.getMessage()); } finally { originalCoreCamera_ = null; } From d9ae6973c74c015ac7571fbc741badb0c64c85f4 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 27 Oct 2026 12:42:49 -0700 Subject: [PATCH 8/8] name the cause when the save directory cannot be opened --- .../lightsheetmanager/gui/tabs/acquisition/SavePanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java index 5237fcab..c74cae54 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java @@ -304,7 +304,7 @@ private void openDirectory(final String path) { try { desktop.open(directory); } catch (IOException e) { - model_.studio().logs().showError( + model_.studio().logs().showError(e, "Could not open the save directory:\n\n" + path); } } else {