From 2bd2984a1d52a00f46b71dc5cb8576df54232378 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 13 Oct 2023 16:20:45 -0700 Subject: [PATCH] slicesPerVolume should be slicesPerView --- .../lightsheetmanager/api/VolumeSettings.java | 2 +- .../api/internal/DefaultVolumeSettings.java | 2 +- .../tabs/acquisition/VolumeSettingsPanel.java | 2 +- .../lightsheetmanager/model/XYZGrid.java | 2 +- .../acquisitions/AcquisitionEngineSCAPE.java | 25 +++++++++++++++---- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/api/VolumeSettings.java b/src/main/java/org/micromanager/lightsheetmanager/api/VolumeSettings.java index 6546a0d..93b6e2b 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/api/VolumeSettings.java +++ b/src/main/java/org/micromanager/lightsheetmanager/api/VolumeSettings.java @@ -30,7 +30,7 @@ interface Builder { */ Builder delayBeforeView(final double viewDelayMs); - Builder slicesPerVolume(final int n); + Builder slicesPerView(final int n); Builder sliceStepSize(final double um); diff --git a/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultVolumeSettings.java b/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultVolumeSettings.java index cd89970..dca890c 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultVolumeSettings.java +++ b/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultVolumeSettings.java @@ -68,7 +68,7 @@ public VolumeSettings.Builder delayBeforeView(final double viewDelayMs) { } @Override - public VolumeSettings.Builder slicesPerVolume(final int n) { + public VolumeSettings.Builder slicesPerView(final int n) { slicesPerView_ = n; return this; } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/VolumeSettingsPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/VolumeSettingsPanel.java index 782f947..29d11ec 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/VolumeSettingsPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/VolumeSettingsPanel.java @@ -118,7 +118,7 @@ private void createEventHandlers() { spnNumSlices_.registerListener(e -> { model_.acquisitions().settingsBuilder().volumeSettingsBuilder() - .slicesPerVolume(spnNumSlices_.getInt()); + .slicesPerView(spnNumSlices_.getInt()); }); spnSliceStepSize_.registerListener(e -> { diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/XYZGrid.java b/src/main/java/org/micromanager/lightsheetmanager/model/XYZGrid.java index 20019e2..033c4eb 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/XYZGrid.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/XYZGrid.java @@ -106,7 +106,7 @@ public void computeGrid() { // TODO: update GUI with values, aliases for asb and vsb? final double speedFactor = GeometryUtils.DISPIM.getStageGeometricSpeedFactor(true); model_.acquisitions().settingsBuilder().volumeSettingsBuilder().sliceStepSize(Math.abs(deltaX_)/speedFactor); - model_.acquisitions().settingsBuilder().volumeSettingsBuilder().slicesPerVolume(numX); + model_.acquisitions().settingsBuilder().volumeSettingsBuilder().slicesPerView(numX); // move to X center if we aren't generating a position list with it if (!useY_ && !useZ_) { xyStage.setXYPosition(centerX, xyStage.getXYPosition().y); // TODO: make convenience method? 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 1ebb7d0..65a0b19 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java @@ -16,7 +16,6 @@ import org.micromanager.data.internal.DefaultSummaryMetadata; import org.micromanager.data.internal.ndtiff.NDTiffAdapter; import org.micromanager.internal.MMStudio; -import org.micromanager.lightsheetmanager.api.data.AcquisitionMode; import org.micromanager.lightsheetmanager.api.data.CameraMode; import org.micromanager.lightsheetmanager.api.data.GeometryType; import org.micromanager.lightsheetmanager.api.data.MultiChannelMode; @@ -653,16 +652,32 @@ private boolean doHardwareCalculations(PLogicSCAPE plc) { && (timepointIntervalMs < timepointDuration*1.2)) { //acqSettings_.setHardwareTimesPoints(false); asb_.useHardwareTimePoints(false); - // TODO: WARNING + // TODO: uncomment when working +// studio_.logs().showError("Time point interval may not be sufficient " +// + "depending on actual time required to change positions. " +// + "Proceed at your own risk."); } } - // TODO: make sure position updater is turned off! +// if (acqSettings_.isUsingHardwareTimePoints()) { +// final int numTimePoints = acqSettings_.numTimePoints(); +// final int numChannels = acqSettings_.numChannels(); +// final int slicePerView = acqSettings_.volumeSettings().slicesPerView(); +// // in hardwareTimepoints case we trigger controller once for all timepoints => need to +// // adjust number of frames we expect back from the camera during MM's SequenceAcquisition +// if (acqSettings_.cameraMode() == CameraMode.OVERLAP) { +// // For overlap mode we are send one extra trigger per channel per side for volume-switching (both PLogic and not) +// // This holds for all multichannel modes, just the order in which the extra trigger comes varies +// // Very last trigger won't ever return a frame so subtract 1. +// final int hardwareSlicesPerView = (slicePerView + 1) * numChannels * numTimePoints; +// asb_.volumeSettingsBuilder().slicesPerView(hardwareSlicesPerView - 1); +// } else { +// asb_.volumeSettingsBuilder().slicesPerView(slicePerView * numTimePoints); +// } +// } - // FIXME: what is happening here? getting timing error double sliceDuration = asb_.timingSettingsBuilder().sliceDuration(); if (exposureTime + cameraReadoutTime > sliceDuration) { - //System.out.println(sliceDuration); // should only possible to mess this up using advanced timing settings // or if there are errors in our own calculations studio_.logs().showError("Exposure time of " + exposureTime +