Skip to content

Commit

Permalink
cache scanDistance_
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon committed Apr 18, 2024
1 parent 296a098 commit 8bf8b32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LightSheetManagerPlugin implements MenuPlugin, SciJavaPlugin {
public static final String copyright = "Applied Scientific Instrumentation (ASI), 2022-2024";
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.4.0";
public static final String version = "0.4.1";

private Studio studio_;
private LightSheetManagerFrame frame_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,10 @@ public boolean prepareStageScanForAcquisition(final double x, final double y, De
double xStartUm;
double xStopUm;
if (scanFromCurrent) {
xStartUm = x;
if (scanNegative) {
xStartUm = x;
xStopUm = x - scanDistance_;
} else {
xStartUm = x;
xStopUm = x + scanDistance_;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ public boolean prepareControllerForAcquisition(
return false;
}

// cache how far we scan each pass for later use
final double speedFactor = GeometryUtils.getStageGeometricSpeedFactor(
settings.scanSettings().scanAngleFirstView(),true);
actualStepSizeUm_ = settings.volumeSettings().sliceStepSize() * (actualMotorSpeed / requestedMotorSpeed);
scanDistance_ = settings.volumeSettings().slicesPerView() * actualStepSizeUm_ * speedFactor;

if (!settings.isUsingMultiplePositions()) {
// use current position as center position for stage scanning
// multi-position situation is handled in position-switching code instead
Expand Down

0 comments on commit 8bf8b32

Please sign in to comment.