Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean setup() {
// load settings
userSettings_.load();

// TODO: put this somewhere better, need to put this value into LSMAcquisitionEvents for now
// TODO: put this somewhere better, need to put this value into LightSheetEventAdapter for now
LightSheetEventAdapter.isUsingMultipleCameras =
deviceManager_.adapter().numSimultaneousCameras() > 1;

Expand Down Expand Up @@ -120,35 +120,19 @@ public void pluginSettings(final PluginSettings pluginSettings) {
pluginSettings_ = Objects.requireNonNull(pluginSettings);
}

public CMMCore getCore() {
return core_;
}

public CMMCore core() {
return core_;
}

public Studio getStudio() {
return studio_;
}

public Studio studio() {
return studio_;
}

public AcquisitionEngine getAcquisitionEngine() {
return acqEngine_;
}

@Override
public AcquisitionEngine acquisitions() {
return acqEngine_;
}

public DeviceManager getDeviceManager() {
return deviceManager_;
}

@Override
public DeviceManager devices() {
return deviceManager_;
Expand Down
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-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.6.4";
public static final String version = "0.6.5";

private Studio studio_;
private LightSheetManager model_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public class CameraPanel extends Panel implements SettingsListener {
private final LightSheetManager model_;

public CameraPanel(final LightSheetManager model) {
super("Simultaneous Cameras");
super((model.devices().adapter().numSimultaneousCameras() > 1) ?
"Simultaneous Cameras" : "Camera Settings");
model_ = Objects.requireNonNull(model);
createUserInterface();
createEventHandlers();
Expand Down Expand Up @@ -100,8 +101,10 @@ private void createUserInterface() {
pnlCameraSelectionRow.add(radPrimaryCamera_, "");
pnlCameraSelectionRow.add(pnlCheckboxes, "gaptop 2px");

add(pnlCameraSelectionRow, "wrap");
add(new JLabel("Camera Trigger Mode:"), "wrap");
if (model_.devices().adapter().numSimultaneousCameras() > 1) {
add(pnlCameraSelectionRow, "wrap");
}
add(new JLabel("Trigger Mode:"), "split 2");
add(cmbCameraMode_, "wrap");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ private void createEventHandlers() {
scanner.js().inputX(Joystick.Input.LEFT_WHEEL);
break;
case "Light Sheet Tilt":
//final ASIZStage stage = model_.devices().device("SampleZ");
//stage.js().input(Joystick.Input.LEFT_WHEEL);
final ASIZStage stage = model_.devices().device("IllumAngle");
stage.js().input(Joystick.Input.LEFT_WHEEL);
break;
case "Sample Height":
final ASIZStage zStage = model_.devices().device("SampleZ");
Expand All @@ -175,8 +175,8 @@ private void createEventHandlers() {
scanner.js().inputX(Joystick.Input.RIGHT_WHEEL);
break;
case "Light Sheet Tilt":
//final ASIZStage stage = model_.devices().device("SampleZ");
//stage.js().input(Joystick.Input.RIGHT_WHEEL);
final ASIZStage stage = model_.devices().device("IllumAngle");
stage.js().input(Joystick.Input.RIGHT_WHEEL);
break;
case "Sample Height":
final ASIZStage zStage = model_.devices().device("SampleZ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ public double getSheetWidth(CameraMode cameraMode, int view) {
// final Properties.Keys widthProp = (side == Devices.Sides.A) ?
// Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_A : Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_B;
// sheetWidth = props_.getPropValueFloat(Devices.Keys.PLUGIN, widthProp);
sheetWidth = model_.getAcquisitionEngine().settings().sheetCalibration().sheetWidth();
sheetWidth = model_.acquisitions().settings().sheetCalibration().sheetWidth();

if (cameraName == null || cameraName.isEmpty()) {
studio_.logs().logDebugMessage("Could not get sheet width for invalid device " + cameraName);
Expand All @@ -1039,13 +1039,13 @@ public double getSheetWidth(CameraMode cameraMode, int view) {
// final float slopePolarity = (side == Devices.Sides.B) ? -1 : 1;
// sheetWidth = roi.height * sheetSlope * slopePolarity / 1e6; // in microdegrees per pixel, convert to degrees
} else {
final boolean autoSheet = model_.getAcquisitionEngine().settings().sheetCalibration().autoSheetWidthEnabled();
final boolean autoSheet = model_.acquisitions().settings().sheetCalibration().autoSheetWidthEnabled();
if (autoSheet) {
Rectangle roi = camera.getROI();
if (roi == null || roi.height == 0) {
studio_.logs().logDebugMessage("Could not get camera ROI for auto sheet mode");
}
final double sheetSlope = model_.getAcquisitionEngine().settings().sheetCalibration().autoSheetWidthPerPixel();
final double sheetSlope = model_.acquisitions().settings().sheetCalibration().autoSheetWidthPerPixel();
sheetWidth = roi.height * sheetSlope / 1000.0; // in millidegrees per pixel, convert to degrees
sheetWidth *= 1.1; // 10% extra width just to be sure
}
Expand Down Expand Up @@ -1074,12 +1074,12 @@ public double getSheetOffset(CameraMode cameraMode, int view) {
if (cameraMode == CameraMode.VIRTUAL_SLIT) {
// in millidegrees, convert to degrees
// TODO: is this correct?
sheetOffset = model_.getAcquisitionEngine().settings().sheetCalibration().sheetOffset() / 1000.0;
sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset() / 1000.0;
//sheetOffset = prefs_.getFloat(
//MyStrings.PanelNames.SETUP.toString() + side.toString(),
//Properties.Keys.PLUGIN_LIGHTSHEET_OFFSET, 0) / 1000; // in millidegrees, convert to degrees
} else {
sheetOffset = model_.getAcquisitionEngine().settings().sheetCalibration().sheetOffset();
sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset();
//final Properties.Keys offsetProp = (side == Devices.Sides.A) ?
// Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_A : Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_B;
// sheetOffset = props_.getPropValueFloat(Devices.Keys.PLUGIN, offsetProp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ public double getSheetWidth(CameraMode cameraMode, int view) {
// final Properties.Keys widthProp = (side == Devices.Sides.A) ?
// Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_A : Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_B;
// sheetWidth = props_.getPropValueFloat(Devices.Keys.PLUGIN, widthProp);
sheetWidth = model_.getAcquisitionEngine().settings().sheetCalibration().sheetWidth();
sheetWidth = model_.acquisitions().settings().sheetCalibration().sheetWidth();

if (cameraName == null || cameraName.isEmpty()) {
studio_.logs().logDebugMessage("Could not get sheet width for invalid device " + cameraName);
Expand All @@ -920,13 +920,13 @@ public double getSheetWidth(CameraMode cameraMode, int view) {
// final float slopePolarity = (side == Devices.Sides.B) ? -1 : 1;
// sheetWidth = roi.height * sheetSlope * slopePolarity / 1e6; // in microdegrees per pixel, convert to degrees
} else {
final boolean autoSheet = model_.getAcquisitionEngine().settings().sheetCalibration().autoSheetWidthEnabled();
final boolean autoSheet = model_.acquisitions().settings().sheetCalibration().autoSheetWidthEnabled();
if (autoSheet) {
Rectangle roi = camera.getROI();
if (roi == null || roi.height == 0) {
studio_.logs().logDebugMessage("Could not get camera ROI for auto sheet mode");
}
final double sheetSlope = model_.getAcquisitionEngine().settings().sheetCalibration().autoSheetWidthPerPixel();
final double sheetSlope = model_.acquisitions().settings().sheetCalibration().autoSheetWidthPerPixel();
sheetWidth = roi.height * sheetSlope / 1000.0; // in millidegrees per pixel, convert to degrees
sheetWidth *= 1.1; // 10% extra width just to be sure
}
Expand Down Expand Up @@ -955,12 +955,12 @@ public double getSheetOffset(CameraMode cameraMode, int view) {
if (cameraMode == CameraMode.VIRTUAL_SLIT) {
// in millidegrees, convert to degrees
// TODO: is this correct?
sheetOffset = model_.getAcquisitionEngine().settings().sheetCalibration().sheetOffset() / 1000.0;
sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset() / 1000.0;
//sheetOffset = prefs_.getFloat(
//MyStrings.PanelNames.SETUP.toString() + side.toString(),
//Properties.Keys.PLUGIN_LIGHTSHEET_OFFSET, 0) / 1000; // in millidegrees, convert to degrees
} else {
sheetOffset = model_.getAcquisitionEngine().settings().sheetCalibration().sheetOffset();
sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset();
//final Properties.Keys offsetProp = (side == Devices.Sides.A) ?
// Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_A : Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_B;
// sheetOffset = props_.getPropValueFloat(Devices.Keys.PLUGIN, offsetProp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class UserSettings {
public UserSettings(final LightSheetManager model) {
model_ = Objects.requireNonNull(model);
// setup user profile
final UserProfile profile = model_.getStudio().getUserProfile();
final UserProfile profile = model_.studio().getUserProfile();
settings_ = profile.getSettings(UserSettings.class);
userName_ = profile.getProfileName();
}
Expand Down
Loading