|
6 | 6 | import org.micromanager.lightsheetmanager.LightSheetManager; |
7 | 7 | import org.micromanager.lightsheetmanager.api.data.AcquisitionMode; |
8 | 8 | import org.micromanager.lightsheetmanager.api.data.CameraMode; |
9 | | -import org.micromanager.lightsheetmanager.api.data.GeometryType; |
10 | 9 | import org.micromanager.lightsheetmanager.api.data.ChannelMode; |
11 | 10 | import org.micromanager.lightsheetmanager.api.internal.ScapeAcquisitionSettings; |
12 | 11 | import org.micromanager.lightsheetmanager.model.acquisitions.AcquisitionEngineScape; |
13 | 12 | import org.micromanager.lightsheetmanager.model.acquisitions.CameraTriggers; |
14 | 13 | import org.micromanager.lightsheetmanager.model.channels.ChannelSpec; |
15 | | -import org.micromanager.lightsheetmanager.model.devices.cameras.CameraBase; |
16 | 14 | import org.micromanager.lightsheetmanager.model.devices.vendor.ASIPLogic; |
17 | 15 | import org.micromanager.lightsheetmanager.model.devices.vendor.ASIPiezo; |
18 | 16 | import org.micromanager.lightsheetmanager.model.devices.vendor.ASIScanner; |
|
22 | 20 | import org.micromanager.lightsheetmanager.model.utils.GeometryUtils; |
23 | 21 | import org.micromanager.lightsheetmanager.model.utils.NumberUtils; |
24 | 22 |
|
25 | | -import java.awt.Rectangle; |
26 | 23 | import java.awt.geom.Point2D; |
27 | 24 | import java.util.Objects; |
28 | 25 |
|
@@ -627,23 +624,7 @@ public boolean prepareControllerForAcquisitionSide( |
627 | 624 | // set interleaved sides flag low unless we are doing interleaved stage scan |
628 | 625 | scanner_.setSPIMInterleaveSides(isInterleaved); |
629 | 626 |
|
630 | | - // send sheet width/offset |
631 | | - double sheetWidth = getSheetWidth(acqSettings_.cameraMode(), view); |
632 | | - double sheetOffset = getSheetOffset(acqSettings_.cameraMode(), view); |
633 | | - if (cameraMode == CameraMode.VIRTUAL_SLIT) { |
634 | | - // adjust sheet width and offset to account for settle time where scan is going but we aren't imaging yet |
635 | | - // FIXME: !!! |
636 | | - //final float settleTime = props_.getPropValueFloat(Devices.Keys.PLUGIN, Properties.Keys.PLUGIN_LS_SCAN_SETTLE); |
637 | | - // infer the main scan time (during imaging) from the laser duration |
638 | | -// final float readoutTime = settings.timingSettings().laserTriggerDurationMs() - 0.25; // -0.25 is for scanLaserBufferTime |
639 | | -// // offset should be decreased by half of the distance traveled during settle time (instead of re-extracting slope use existing sheetWidth/readoutTime) |
640 | | -// sheetOffset -= (sheetWidth * settleTime/readoutTime)/2; |
641 | | -// // width should be increased by ratio (1 + settle_fraction) |
642 | | -// sheetWidth += (sheetWidth * settleTime/readoutTime); |
643 | | - } |
644 | | - // SCOPE should not modify the x-axis of the galvo |
645 | | - // scanner_.sa().setAmplitudeX(sheetWidth); |
646 | | - // scanner_.sa().setOffsetX(sheetOffset); |
| 627 | + // SCAPE leaves the galvo's x axis alone, so no sheet width or offset is sent |
647 | 628 | } |
648 | 629 | return true; |
649 | 630 | } |
@@ -932,98 +913,6 @@ private boolean doesPLogicChannelIncludeLaser(final int laserNum, final ChannelS |
932 | 913 | } |
933 | 914 | } |
934 | 915 |
|
935 | | - // TODO: need sheet width settings in AcquisitionSettings |
936 | | - /** |
937 | | - * gets the sheet width for the specified settings in units of degrees |
938 | | - * @param cameraMode |
939 | | - * @param view |
940 | | - * @return 0 if camera isn't assigned |
941 | | - */ |
942 | | - public double getSheetWidth(CameraMode cameraMode, int view) { |
943 | | - double sheetWidth; |
944 | | - //final String cameraName = devices_.getMMDevice(cameraDevice); |
945 | | - String deviceName = "ImagingCamera" + view; // diSPIM |
946 | | - if (model_.devices().adapter().geometry() == GeometryType.SCAPE) { |
947 | | - deviceName = "ImagingCamera"; |
948 | | - if (model_.devices().adapter().numSimultaneousCameras() > 1 ) { |
949 | | - deviceName += String.valueOf(view); |
950 | | - } |
951 | | - } |
952 | | - CameraBase camera = devices_.device(deviceName); // TODO: find a way of adapting to different cameras |
953 | | - String cameraName = camera.getDeviceName(); // TODO: put this on LSM camera? |
954 | | - |
955 | | -// // start by assuming the base value, then modify below if needed |
956 | | -// final Properties.Keys widthProp = (side == Devices.Sides.A) ? |
957 | | -// Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_A : Properties.Keys.PLUGIN_SHEET_WIDTH_EDGE_B; |
958 | | -// sheetWidth = props_.getPropValueFloat(Devices.Keys.PLUGIN, widthProp); |
959 | | - sheetWidth = model_.acquisitions().settings().sheetCalibration().sheetWidth(); |
960 | | - |
961 | | - if (cameraName == null || cameraName.isEmpty()) { |
962 | | - studio_.logs().logDebugMessage("Could not get sheet width for invalid device " + cameraName); |
963 | | - return sheetWidth; |
964 | | - } |
965 | | - |
966 | | - if (cameraMode == CameraMode.VIRTUAL_SLIT) { |
967 | | - // TODO: this! |
968 | | -// final float sheetSlope = prefs_.getFloat( |
969 | | -// MyStrings.PanelNames.SETUP.toString() + side.toString(), |
970 | | -// Properties.Keys.PLUGIN_LIGHTSHEET_SLOPE, 2000); |
971 | | -// Rectangle roi = cameras_.getCameraROI(cameraDevice); // get binning-adjusted ROI so value can stay the same regardless of binning |
972 | | -// if (roi == null || roi.height == 0) { |
973 | | -// studio_.logs().logDebugMessage("Could not get camera ROI for light sheet mode"); |
974 | | -// } |
975 | | -// final float slopePolarity = (side == Devices.Sides.B) ? -1 : 1; |
976 | | -// sheetWidth = roi.height * sheetSlope * slopePolarity / 1e6; // in microdegrees per pixel, convert to degrees |
977 | | - } else { |
978 | | - final boolean autoSheet = model_.acquisitions().settings().sheetCalibration().autoSheetWidthEnabled(); |
979 | | - if (autoSheet) { |
980 | | - // unbinned, so the sheet width stays the same regardless of binning |
981 | | - Rectangle roi = camera.getUnbinnedROI(); |
982 | | - if (roi == null || roi.height == 0) { |
983 | | - studio_.logs().logDebugMessage("Could not get camera ROI for auto sheet mode"); |
984 | | - } |
985 | | - final double sheetSlope = model_.acquisitions().settings().sheetCalibration().autoSheetWidthPerPixel(); |
986 | | - sheetWidth = roi.height * sheetSlope / 1000.0; // in millidegrees per pixel, convert to degrees |
987 | | - sheetWidth *= 1.1; // 10% extra width just to be sure |
988 | | - } |
989 | | -// final boolean autoSheet = prefs_.getBoolean( |
990 | | -// MyStrings.PanelNames.SETUP.toString() + side.toString(), |
991 | | -// Properties.Keys.PREFS_AUTO_SHEET_WIDTH, false); |
992 | | -// if (autoSheet) { |
993 | | -// Rectangle roi = cameras_.getCameraROI(cameraDevice); // get binning-adjusted ROI so value can stay the same regardless of binning |
994 | | -// if (roi == null || roi.height == 0) { |
995 | | -// studio_.logs().logDebugMessage("Could not get camera ROI for auto sheet mode"); |
996 | | -// } |
997 | | -// final float sheetSlope = prefs_.getFloat(MyStrings.PanelNames.SETUP.toString() + side.toString(), |
998 | | -// Properties.Keys.PLUGIN_SLOPE_SHEET_WIDTH.toString(), 2); |
999 | | -// sheetWidth = roi.height * sheetSlope / 1000; // in millidegrees per pixel, convert to degrees |
1000 | | -// // TODO add extra width to compensate for filter depending on sweep rate and filter freq |
1001 | | -// // TODO calculation should account for sample exposure to make sure 0.25ms edges get appropriately compensated for |
1002 | | -// sheetWidth *= 1.1; // 10% extra width just to be sure |
1003 | | -// } |
1004 | | - } |
1005 | | - return sheetWidth; |
1006 | | - } |
1007 | | - |
1008 | | - // TODO: needs properties |
1009 | | - public double getSheetOffset(CameraMode cameraMode, int view) { |
1010 | | - double sheetOffset; |
1011 | | - if (cameraMode == CameraMode.VIRTUAL_SLIT) { |
1012 | | - // in millidegrees, convert to degrees |
1013 | | - // TODO: is this correct? |
1014 | | - sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset() / 1000.0; |
1015 | | - //sheetOffset = prefs_.getFloat( |
1016 | | - //MyStrings.PanelNames.SETUP.toString() + side.toString(), |
1017 | | - //Properties.Keys.PLUGIN_LIGHTSHEET_OFFSET, 0) / 1000; // in millidegrees, convert to degrees |
1018 | | - } else { |
1019 | | - sheetOffset = model_.acquisitions().settings().sheetCalibration().sheetOffset(); |
1020 | | - //final Properties.Keys offsetProp = (side == Devices.Sides.A) ? |
1021 | | - // Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_A : Properties.Keys.PLUGIN_SHEET_OFFSET_EDGE_B; |
1022 | | - // sheetOffset = props_.getPropValueFloat(Devices.Keys.PLUGIN, offsetProp); |
1023 | | - } |
1024 | | - return sheetOffset; |
1025 | | - } |
1026 | | - |
1027 | 916 | /** |
1028 | 917 | * Gets the actual step size for stage scanning acquisitions. |
1029 | 918 | * Only valid after call to prepareControllerForAcquisition(). |
|
0 commit comments