api.imcontrol
- class api.imcontrol
These functions are available in the api.imcontrol object.
- getDetectorNames() List[str]
Returns the device names of all detectors. These device names can be passed to other detector-related functions.
- getLaserNames() List[str]
Returns the device names of all lasers. These device names can be passed to other laser-related functions.
- getPositionerNames() List[str]
Returns the device names of all positioners. These device names can be passed to other positioner-related functions.
- getPositionerPositions() Dict[str, Dict[str, float]]
Returns the positions of all positioners.
- loadScanParamsFromFile(filePath: str) None
Loads scanning parameters from the specified file.
- movePositioner(positionerName: str, axis: str, dist: float) None
Moves the specified positioner axis by the specified number of micrometers.
- runScan() None
Runs a scan with the set scanning parameters.
- saveScanParamsToFile(filePath: str) None
Saves the set scanning parameters to the specified file.
- setDetectorBinning(detectorName: str, binning: int) None
Sets binning value for the specified detector.
- setDetectorParameter(detectorName: str, parameterName: str, value: Any) None
Sets the specified detector-specific parameter to the specified value.
- setDetectorROI(detectorName: str, frameStart: Tuple[int, int], shape: Tuple[int, int]) None
Sets the ROI for the specified detector. frameStart is a tuple (x0, y0) and shape is a tuple (width, height).
- setDetectorToRecord(detectorName: Union[List[str], str, int], multiDetectorSingleFile: bool = False) None
Sets which detectors to record. One can also pass -1 as the argument to record the current detector, or -2 to record all detectors.
- setLaserActive(laserName: str, active: bool) None
Sets whether the specified laser is powered on.
- setLaserValue(laserName: str, value: Union[int, float]) None
Sets the value of the specified laser, in the units that the laser uses.
- setLiveViewActive(active: bool) None
Sets whether the LiveView is active and updating.
- setLiveViewCrosshairVisible(visible: bool) None
Sets whether the LiveView crosshair is visible.
- setLiveViewGridVisible(visible: bool) None
Sets whether the LiveView grid is visible.
- setPositioner(positionerName: str, axis: str, position: float) None
Moves the specified positioner axis to the specified position.
- setPositionerStepSize(positionerName: str, stepSize: float) None
Sets the step size of the specified positioner to the specified number of micrometers.
- setRecFilename(filename: Optional[str]) None
Sets the name of the file to record to. This only sets the name of the file, not the full path. One can also pass None as the argument to use a default time-based filename.
- setRecFolder(folderPath: str) None
Sets the folder to save recordings into.
- setRecModeScanOnce() None
Sets the recording mode to record a single scan.
- setRecModeScanTimelapse(lapsesToRec: int, freqSeconds: float, timelapseSingleFile: bool = False) None
Sets the recording mode to record a timelapse of scans.
- setRecModeSpecFrames(numFrames: int) None
Sets the recording mode to record a specific number of frames.
- setRecModeSpecTime(secondsToRec: Union[int, float]) None
Sets the recording mode to record for a specific amount of time.
- setRecModeUntilStop() None
Sets the recording mode to record until recording is manually stopped.
- signals() Mapping[str, imswitch.imcommon.framework.qt.Signal]
Returns signals that can be used with e.g. the getWaitForSignal action. Currently available signals are:
acquisitionStarted
acquisitionStopped
recordingStarted
recordingEnded
scanEnded
They can be accessed like this: api.imcontrol.signals().scanEnded
- snapImage() None
Take a snap and save it to a .tiff file at the set file path.
- startRecording() None
Starts recording with the set settings to the set file path.
- stepPositionerDown(positionerName: str, axis: str) None
Moves the specified positioner axis in negative direction by its set step size.
- stepPositionerUp(positionerName: str, axis: str) None
Moves the specified positioner axis in positive direction by its set step size.
- stopRecording() None
Stops recording.