mesoSPIM.src package
Subpackages
- mesoSPIM.src.devices package
- mesoSPIM.src.utils package
- Submodules
- mesoSPIM.src.utils.acquisitions module
- acquisitions.py
AcquisitionAcquisitionListAcquisitionList.check_filename_extensions()AcquisitionList.check_for_duplicated_filenames()AcquisitionList.check_for_existing_filenames()AcquisitionList.check_for_nonexisting_folders()AcquisitionList.find_value_index()AcquisitionList.get_acquisition_time()AcquisitionList.get_all_filenames()AcquisitionList.get_capitalized_keylist()AcquisitionList.get_duplicates_in_list()AcquisitionList.get_image_count()AcquisitionList.get_keylist()AcquisitionList.get_n_angles()AcquisitionList.get_n_lasers()AcquisitionList.get_n_shutter_configs()AcquisitionList.get_n_tiles()AcquisitionList.get_startpoint()AcquisitionList.get_tile_index()AcquisitionList.get_unique_attr_list()
- mesoSPIM.src.utils.delegates module
ChooseFolderDelegateComboDelegateETLSpinBoxDelegateIntensitySpinBoxDelegateMarkFocusPositionDelegateMarkPositionDelegateMarkPositionDelegate.createEditor()MarkPositionDelegate.setEditorData()MarkPositionDelegate.setModelData()MarkPositionDelegate.set_model_data_from_button()MarkPositionDelegate.set_model_data_from_focus_change()MarkPositionDelegate.set_model_data_from_lineedit()MarkPositionDelegate.updateEditorGeometry()
MarkRotationPositionDelegateMarkXPositionDelegateMarkYPositionDelegateMarkZPositionDelegateProgressBarDelegateRotationSpinBoxDelegateSliderDelegateSliderWithValueDelegateZstepSpinBoxDelegate
- mesoSPIM.src.utils.filename_wizard module
- mesoSPIM.src.utils.focus_tracking_wizard module
- mesoSPIM.src.utils.image_processing_wizard module
- mesoSPIM.src.utils.models module
AcquisitionModelAcquisitionModel.columnCount()AcquisitionModel.copyRow()AcquisitionModel.data()AcquisitionModel.deleteTable()AcquisitionModel.dropMimeData()AcquisitionModel.flags()AcquisitionModel.getColumnByName()AcquisitionModel.getEndFocusColumn()AcquisitionModel.getFilename()AcquisitionModel.getFilenameColumn()AcquisitionModel.getFilter()AcquisitionModel.getImageCount()AcquisitionModel.getLaser()AcquisitionModel.getLaserList()AcquisitionModel.getNAngles()AcquisitionModel.getNShutterConfigs()AcquisitionModel.getName()AcquisitionModel.getRotationPosition()AcquisitionModel.getShutterconfig()AcquisitionModel.getStartFocusColumn()AcquisitionModel.getTileIndex()AcquisitionModel.getTime()AcquisitionModel.getTotalImageCount()AcquisitionModel.getXPosition()AcquisitionModel.getYPosition()AcquisitionModel.getZEndPosition()AcquisitionModel.getZStartPosition()AcquisitionModel.getZoom()AcquisitionModel.get_acquisition_list()AcquisitionModel.headerData()AcquisitionModel.insertRows()AcquisitionModel.loadModel()AcquisitionModel.mimeData()AcquisitionModel.moveRows()AcquisitionModel.removeRows()AcquisitionModel.rowCount()AcquisitionModel.saveModel()AcquisitionModel.send_data_changed()AcquisitionModel.setData()AcquisitionModel.setDataFromState()AcquisitionModel.setShutterconfig()AcquisitionModel.setTable()AcquisitionModel.updatePlanes()
- mesoSPIM.src.utils.multicolor_acquisition_builder module
- mesoSPIM.src.utils.multicolor_acquisition_wizard module
CheckTilingPageDefineBoundingBoxPageDefineFolderPageDefineGeneralParametersPageDefineGeneralParametersPage.initializePage()DefineGeneralParametersPage.update_fov_size()DefineGeneralParametersPage.update_other_acquisition_parameters()DefineGeneralParametersPage.update_page_from_state()DefineGeneralParametersPage.update_shutt_seq()DefineGeneralParametersPage.update_x_and_y_offset()DefineGeneralParametersPage.validatePage()
FifthChannelPageFinishedTilingPageFirstChannelPageFourthChannelPageGenericChannelPageMulticolorTilingWizardSecondChannelPageThirdChannelPageTilingWelcomePage
- mesoSPIM.src.utils.optimization module
- mesoSPIM.src.utils.utility_functions module
- mesoSPIM.src.utils.waveforms module
- mesoSPIM.src.utils.widgets module
- Module contents
Submodules
mesoSPIM.src.WebcamWindow module
Simple webcam display widget, can be used stand-alone author: Nikita Vladimirov, @nvladimus, 2022 License: GPL-3
mesoSPIM.src.mesoSPIM_AcquisitionManagerWindow module
mesoSPIM Acquisition Manager Window
- class mesoSPIM.src.mesoSPIM_AcquisitionManagerWindow.MyStyle(*args: Any, **kwargs: Any)[source]
Bases:
QProxyStyle
- class mesoSPIM.src.mesoSPIM_AcquisitionManagerWindow.mesoSPIM_AcquisitionManagerWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidget- delete_all_rows()[source]
Displays a warning that this will delete the entire table and then proceeds to delete if the user clicks ‘Yes’
- display_status_message(string, time=0)[source]
Displays a message in the status bar for a time in ms
If time=0, the message will stay.
- get_first_selected_row()[source]
Little helper method to provide the first row out of a selection range
- model_changed
alias of
AcquisitionModel
- set_item_delegates()[source]
Several columns should have certain delegates
If I decide to move colums, the delegates should move with them
Here, I need the configuration to provide the options for the delegates.
- start_selected()[source]
Get the selected row and run this (single) row only
Indices is a list of selected QModelIndex objects, we’re only interested in the first.
- statusBar
Setting the model up
mesoSPIM.src.mesoSPIM_Camera module
mesoSPIM Camera class, intended to run in its own thread
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_Camera(*args: Any, **kwargs: Any)[source]
Bases:
QObjectTop-level class for all cameras
- add_images_to_series(acq, acq_list)
- end_image_series(acq, acq_list)
- end_live()
- get_live_image()
- prepare_image_series(acq, acq_list)
Row is a row in a AcquisitionList
- prepare_live()
- set_camera_exposure_time(time)[source]
Sets the exposure time in seconds
- Parameters:
time (float) – exposure time to set
- set_camera_line_interval(time)[source]
Sets the line interval in seconds
- Parameters:
time (float) – interval time to set
- sig_write_images
alias of
Acquisition
- snap_image(write_flag=True)
“Snap an image and display it
- state_request_handler(dict)
The request handling is done with exec() to write fewer lines of code.
- stop()
Stops acquisition
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_DemoCamera(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_GenericCamera
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_GenericCamera(*args: Any, **kwargs: Any)[source]
Bases:
QObjectGeneric mesoSPIM camera class meant for subclassing.
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_HamamatsuCamera(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_GenericCamera
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_PCOCamera(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_GenericCamera
- class mesoSPIM.src.mesoSPIM_Camera.mesoSPIM_PhotometricsCamera(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_GenericCamera- initialize_image_series()[source]
The Photometrics cameras expect integer exposure times, otherwise they default to the minimum value
mesoSPIM.src.mesoSPIM_CameraWindow module
mesoSPIM CameraWindow
mesoSPIM.src.mesoSPIM_ContrastWindow module
mesoSPIM.src.mesoSPIM_Core module
Core for the mesoSPIM project
- mesoSPIM.src.mesoSPIM_Core.logger = <Logger mesoSPIM.src.mesoSPIM_Core (WARNING)>
PyQt5 Imports
- class mesoSPIM.src.mesoSPIM_Core.mesoSPIM_Core(*args: Any, **kwargs: Any)[source]
Bases:
QObjectThis class is the pacemaker of a mesoSPIM
- append_timing_info_to_metadata(acq)[source]
Appends a metadata.txt file Path contains the file to be written
- check_motion_limits(acq_list)[source]
Check if the motion limits of the stage are violated for each acquisition in the given list.
- close_shutters()
If shutterswitch = True in the config: Assumes that the shutter_left line is the general shutter and the shutter_right line is the left/right switch (Right==True)
- execute_galil_program()[source]
Little helper method to execute the program loaded onto the Galil stage: allows hand controller to operate
- execute_script(script)
- frame_queue_display
The signal-slot switchboard
- get_free_disk_space(acq_list)[source]
Take the disk location of the first file and compute the free disk space
- get_required_disk_space(acq_list)[source]
“Compute total image data size from the acquisition list, in bytes
- lightsheet_alignment_mode()[source]
Switches shutters after each image to allow coalignment of both lightsheets
- move_absolute(sdict, wait_until_done=False, use_internal_position=True)
- move_relative(dict, wait_until_done=False)
- open_shutters()
Here the left/right mode is hacked in If shutterswitch = True in the config: Assumes that the shutter_left line is the general shutter and the shutter_right line is the left/right switch (Right==True)
- pause(boolean)
- read_config_parameter(key, dictionary)[source]
Helper method to check if key exists in the dictionary and read its value, or throw a meaningful error
- run_time_lapse(tpoints=1, time_interval_sec=60)[source]
A quick and dirty implementation of time lapse via recursive function.
- send_progress(cur_acq, tot_acqs, cur_image, images_in_acq, total_image_count, image_counter, time_passed_string, remaining_time_string)[source]
- send_status_message_to_gui(string)
- set_camera_exposure_time(time)
- set_camera_line_interval(time)
- set_filter(filter, wait_until_done=False)
- set_intensity(intensity, wait_until_done=False)
- set_laser(laser, wait_until_done=False, update_etl=True)
- set_shutterconfig(shutterconfig)
- set_zoom(zoom, wait_until_done=True, update_etl=True)
- sig_add_images_to_image_series
alias of
Acquisition
- sig_end_image_series
alias of
Acquisition
- sig_end_live
Movement-related signals:
- sig_polling_stage_position_start
ETL-related signals
- sig_polling_stage_position_stop
ETL-related signals
- sig_prepare_image_series
alias of
Acquisition
- sig_write_metadata
alias of
Acquisition
- snap_image(laser_blanking=True)[source]
Snaps a single image after updating the waveforms.
Can be used in acquisitions where changing waveforms are required, but there is additional overhead due to the need to write the waveforms into the buffers of the NI cards.
- snap_image_in_series(laser_blanking=True)[source]
Snaps and image from a series without waveform update
- state_request_handler(dict)
- stop_movement()
- unzero_axes(list)
- zero_axes(list)
mesoSPIM.src.mesoSPIM_ImageWriter module
mesoSPIM Image Writer class, intended to run in the Camera Thread and handle file I/O
- class mesoSPIM.src.mesoSPIM_ImageWriter.mesoSPIM_ImageWriter(*args: Any, **kwargs: Any)[source]
Bases:
QObject- abort_writing()
Terminate writing and close all files if STOP button is pressed
- end_acquisition(acq, acq_list)
- write_images(acq, acq_list)
Write available images to disk. The actual images are passed via self.frame_queue from the Camera thread, NOT via the signal/slot mechanism as before, starting from v.1.10.0. This is to avoid the overhead of signal/slot mechanism and to improve performance.
- write_metadata(acq, acq_list)
mesoSPIM.src.mesoSPIM_MainWindow module
- class mesoSPIM.src.mesoSPIM_MainWindow.mesoSPIM_MainWindow(*args: Any, **kwargs: Any)[source]
Bases:
QMainWindowMain application window which instantiates worker objects and moves them to a thread.
- check_config_file()[source]
Checks missing blocks in config file and gives suggestions. Todo: all new config options
- check_instances(widget)[source]
Method to check whether a widget belongs to one of the Qt Classes specified.
- Parameters:
widget (QtWidgets.QWidget) – Widget to check
- Returns:
True if widget is in the list, False if not.
- Return type:
return_value (bool)
- connect_combobox_to_state_parameter(combobox, option_list, state_parameter, int_conversion=False)[source]
Helper method to connect and initialize a combobox from the config
- connect_spinbox_to_state_parameter(spinbox, state_parameter, conversion_factor=1)[source]
Helper method to connect and initialize a spinbox from the config
- Parameters:
spinbox (QtWidgets.QSpinBox or QtWidgets.QDoubleSpinbox) – Spinbox in the GUI to be connected
state_parameter (str) – State parameter (has to exist in the config)
conversion_factor (float) – Conversion factor. If the config is in seconds, the spinbox displays ms: conversion_factor = 1000. If the config is in seconds and the spinbox displays microseconds: conversion_factor = 1000000
- connect_widget_to_state_parameter(widget, state_parameter, conversion_factor)[source]
Helper method to (currently) connect spinboxes
- create_widget_list(list, widget_list)[source]
Helper method to recursively loop through all the widgets in a list and their children. :param list: List of QtWidgets.QWidget objects :type list: list
- display_status_message(string)
Displays a message in the status bar for a time in ms
- execute_script(script)
- launch_contrast_window()
- launch_optimizer(ini_dict=None)
- move_relative(pos_dict)
- run_timepoint(timepoint)
- scale_galvo_amp_w_zoom()
- set_laser_intensity(value)
- set_progressbars_to_busy()[source]
If min and max of a progress bar are 0, it shows a “busy” indicator
- update_GUI_by_shutter_state()
Disables controls for the opposite ETL to avoid overriding parameters
- update_gui_from_state()
- update_position_indicators(dict)
- update_progressbars(dict)
mesoSPIM.src.mesoSPIM_Optimizer module
Frontend of the optimizer which allows to use auto-focus or optimization of other microscope parameters Auto-focus is based on Autopilot paper (Royer at al, Nat Biotechnol. 2016 Dec;34(12):1267-1278. doi: 10.1038/nbt.3708.) author: Nikita Vladimirov, @nvladimus, 2021 License: GPL-3
mesoSPIM.src.mesoSPIM_ScriptWindow module
mesoSPIM_ScriptWindow.py
- class mesoSPIM.src.mesoSPIM_ScriptWindow.PythonHighlighter(*args: Any, **kwargs: Any)[source]
Bases:
QSyntaxHighlighterSyntax highlighter for the Python language.
- braces = ['\\{', '\\}', '\\(', '\\)', '\\[', '\\]']
- keywords = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'yield', 'None', 'True', 'False']
- match_multiline(text, delimiter, in_state, style)[source]
Do highlighting of multi-line strings.
delimitershould be aQRegExpfor triple-single-quotes or triple-double-quotes, andin_stateshould be a unique integer to represent the corresponding state changes when inside those strings. Returns True if we’re still inside a multi-line string when this function is finished.
- operators = ['=', '==', '!=', '<', '<=', '>', '>=', '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*', '\\+=', '-=', '\\*=', '/=', '\\%=', '\\^', '\\|', '\\&', '\\~', '>>', '<<']
- mesoSPIM.src.mesoSPIM_ScriptWindow.format(color, style='')[source]
Return a QTextCharFormat with the given attributes.
- class mesoSPIM.src.mesoSPIM_ScriptWindow.mesoSPIM_ScriptWindow(*args: Any, **kwargs: Any)[source]
Bases:
QWidgetAt some point: Change this into a Factory class for creating script windows
- highlight
Connect parent signals
mesoSPIM.src.mesoSPIM_Serial module
Serial thread for the mesoSPIM project
This thread handles all connections with serial devices such as stages, filter wheels, zoom systems etc.
- class mesoSPIM.src.mesoSPIM_Serial.mesoSPIM_Serial(*args: Any, **kwargs: Any)[source]
Bases:
QObjectThis class handles mesoSPIM serial connections
- enable_ttl_motion(boolean)
- go_to_rotation_position(wait_until_done=False)
- move_absolute(sdict, wait_until_done=False, use_internal_position=True)
- move_relative(sdict, wait_until_done=False)
- pause(boolean)
- report_position(sdict)
- send_status_message(string)
- set_filter(sfilter, wait_until_done=False)
- set_zoom(zoom, wait_until_done=True)
Here, the state parameters are set before sending the value to the zoom – this is to avoid laggy update loops with the GUI.
- stage_limits_OK(sdict, safety_margin_n_moves=3)[source]
Safety margin is added to deal with delays in position reporting.
- stage_limits_warning
Attaching the filterwheel
- state_request_handler(sdict, wait_until_done=False)
mesoSPIM.src.mesoSPIM_Stages module
mesoSPIM Stage classes
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_ASI_MS2000_Stage(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_Stage- It is expected that the parent class has the following signals:
sig_move_relative = pyqtSignal(dict) sig_move_relative_and_wait_until_done = pyqtSignal(dict) sig_move_absolute = pyqtSignal(dict) sig_move_absolute_and_wait_until_done = pyqtSignal(dict) sig_zero = pyqtSignal(list) sig_unzero = pyqtSignal(list) sig_stop_movement = pyqtSignal()
Also contains a QTimer that regularily sends position updates, e.g during the execution of movements.
This implements an ASI MS2000 controller for a setup with the following configuration * ASI X Stage is equivalent to the mesoSPIM z-stage (moved during stacks direction) * ASI Y Stage is equivalent to the mesoSPIM y-stage * ASI Z-Stage is equivalent to the mesoSPIM f-stage (focus)
- log_slice(dictionary)
- move_absolute(dict, wait_until_done=False, use_internal_position=True)[source]
ASI move absolute method
Lots of implementation details in here, should be replaced by a facade
- move_relative(sdict, wait_until_done=False)[source]
ASI move relative method
Lots of implementation details in here, should be replaced by a facade
- pause(boolean)
- state
ASI-specific code
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_ASI_Tiger_Stage(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_Stage- It is expected that the parent class has the following signals:
sig_move_relative = pyqtSignal(dict) sig_move_relative_and_wait_until_done = pyqtSignal(dict) sig_move_absolute = pyqtSignal(dict) sig_move_absolute_and_wait_until_done = pyqtSignal(dict) sig_zero = pyqtSignal(list) sig_unzero = pyqtSignal(list) sig_stop_movement = pyqtSignal()
Also contains a QTimer that regularily sends position updates, e.g during the execution of movements.
- log_slice(dictionary)
- move_absolute(dict, wait_until_done=False, use_internal_position=True)[source]
ASI move absolute method
Lots of implementation details in here, should be replaced by a facade
- move_relative(sdict, wait_until_done=False)[source]
ASI move relative method Lots of implementation details in here, should be replaced by a facade
- pause(boolean)
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_DemoStage(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_Stage
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_PI_1toN(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_StageConfiguration with 1 controller connected to N stages, (e.g. C-884, default mesoSPIM V5 setup).
Note: configs as declared in mesoSPIM_config.py:
- stage_parameters = {‘stage_type’‘PI_1controllerNstages’,
… }
- pi_parameters = {‘controllername’‘C-884’,
‘stages’ : (‘L-509.20DG10’,’L-509.40DG10’,’L-509.20DG10’,’M-060.DG’,’M-406.4PD’,’NOSTAGE’), ‘refmode’ : (‘FRF’,), ‘serialnum’ : (‘118075764’), }
- block_till_controller_is_ready()[source]
Blocks further execution (especially during referencing moves) till the PI controller returns ready
- move_absolute(sdict, wait_until_done=False, use_internal_position=True)
Lots of implementation details in here, should be replaced by a facade
TODO: Also lots of repeating code. TODO: DRY principle violated
- move_relative(sdict, wait_until_done=False)
PI move relative method
Lots of implementation details in here, should be replaced by a facade
- pitools
Setting up the PI stages
- stop()
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_PI_NtoN(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_Stage- Expects following microscope configuration:
Sample XYZ movement: Physik Instrumente stage with three L-509-type stepper motor stages and individual C-663 controller. F movement: Physik Instrumente C-663 controller and custom stage with stepper motor Rotation: not implemented
All stage controller are of same type and the sample stages work with reference setting. Focus stage has reference mode set to off.
Note
configs as declared in mesoSPIM_config.py: stage_parameters = {‘stage_type’ : ‘PI_NcontrollersNstages’,
… }
- pi_parameters = {‘axes_names’: (‘x’, ‘y’, ‘z’, ‘theta’, ‘f’),
‘stages’: (‘L-509.20SD00’, ‘L-509.40SD00’, ‘L-509.20SD00’, None, ‘MESOSPIM_FOCUS’), ‘controllername’: (‘C-663’, ‘C-663’, ‘C-663’, None, ‘C-663’), ‘serialnum’: (’******’, ‘******’, ‘******’, None, ‘******’), ‘refmode’: (‘FRF’, ‘FRF’, ‘FRF’, None, ‘RON’) }
make sure that reference points are not in conflict with general microscope setup and will not hurt optics under referencing at startup
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_PI_rotz_and_Galil_xyf_Stages(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_StageDeprecated? Expects following microscope configuration:
Sample XYF movement: Galil controller with 3 axes Z-Movement and Rotation: PI C-884 mercury controller
- block_till_controller_is_ready()[source]
Blocks further execution (especially during referencing moves) till the PI controller returns ready
- f_encodercounts_per_um
XYZ
- Type:
Setting up the Galil stages
- move_absolute(dict, wait_until_done=False, use_internal_position=True)[source]
Galil move absolute method
Lots of implementation details in here, should be replaced by a facade
- move_relative(sdict, wait_until_done=False)[source]
Galil move relative method
Lots of implementation details in here, should be replaced by a facade
- pitools
Setting up the PI stages
- xyf_stage
PI-specific code
- class mesoSPIM.src.mesoSPIM_Stages.mesoSPIM_Stage(*args: Any, **kwargs: Any)[source]
Bases:
QObjectDemoStage for a mesoSPIM microscope
- It is expected that the parent class has the following signals:
sig_move_relative = pyqtSignal(dict) sig_move_relative_and_wait_until_done = pyqtSignal(dict) sig_move_absolute = pyqtSignal(dict) sig_move_absolute_and_wait_until_done = pyqtSignal(dict) sig_zero = pyqtSignal(list) sig_unzero = pyqtSignal(list) sig_stop_movement = pyqtSignal()
Also contains a QTimer that regularily sends position updates, e.g during the execution of movements.
- int_theta_pos
Create offsets
It should be:
int_x_pos = x_pos + int_x_pos_offset self.int_x_pos = self.x_pos + self.int_x_pos_offset
OR
x_pos = int_x_pos - int_x_pos_offset self.x_pos = self.int_x_pos - self.int_x_pos_offset
- int_theta_pos_offset
currently hardcoded
Open question: Should these be in mm or microns? Answer: Microns for now….
- Type:
Setting movement limits
- move_absolute(dict, wait_until_done=False, use_internal_position=True)
- move_relative(sdict, wait_until_done=False)
- report_position()
- state
The movement signals are emitted by the mesoSPIM_Core, which in turn instantiates the mesoSPIM_Serial object, both (must be) running in the same Core thread.
Therefore, the signals are emitted by the parent of the parent, which is slightly confusing and dirty.
- stop()
- theta_pos
Internal (software) positions
mesoSPIM.src.mesoSPIM_State module
mesoSPIM State class. Only nominally a singleton class, but actually inherited by classes from their parent class.
- class mesoSPIM.src.mesoSPIM_State.mesoSPIM_StateSingleton(*args, **kwargs)[source]
Bases:
QObjectSingleton object containing the whole mesoSPIM state.
Only classes which control.
Access to attributes is mutex-locked to allow access from multiple threads.
If more than one state parameter should be set at the same time, the set_parameter
- get_parameter_dict(list)[source]
For a list of keys, get a state dict with the current values back.
All the values are read out under a QMutexLocker so that the state cannot be updated at the same time.
- get_parameter_list(list)[source]
For a list of keys, get a state list with the current values back.
This is especially useful for unpacking.
All the values are read out under a QMutexLocker so that the state cannot be updated at the same time.
- instance = None
mesoSPIM.src.mesoSPIM_TileViewWindow module
mesoSPIM TileViewWindows
mesoSPIM.src.mesoSPIM_WaveFormGenerator module
mesoSPIM Waveform Generator - Creates and allows control of waveform generation.
- mesoSPIM.src.mesoSPIM_WaveFormGenerator.logger = <Logger mesoSPIM.src.mesoSPIM_WaveFormGenerator (WARNING)>
National Instruments Imports
- class mesoSPIM.src.mesoSPIM_WaveFormGenerator.mesoSPIM_DemoWaveFormGenerator(*args: Any, **kwargs: Any)[source]
Bases:
mesoSPIM_WaveFormGeneratorDemo subclass of mesoSPIM_WaveFormGenerator class
- class mesoSPIM.src.mesoSPIM_WaveFormGenerator.mesoSPIM_WaveFormGenerator(*args: Any, **kwargs: Any)[source]
Bases:
QObjectThis class contains the microscope state
Any access to this global state should only be done via signals sent by the responsible class for actually causing that state change in hardware.
- bundle_galvo_and_etl_waveforms()[source]
Stacks the Galvo and ETL waveforms into a numpy array adequate for the NI cards.
In here, the assignment of output channels of the Galvo / ETL card to the corresponding output channel is hardcoded: This could be improved.
- close_tasks()[source]
Closes the tasks for triggering, analog and counter outputs. Tasks should only be closed are they are stopped.
- create_tasks()[source]
Creates a tasks for the mesoSPIM:
These are: - the master trigger task, a digital out task that only provides a trigger pulse for the others - the camera trigger task, a counter task that triggers the camera in lightsheet mode - the stage trigger task, a counter task that provides a TTL trigger for stages that allow triggered movement (e.g. ASI stages) - the galvo and ETL task (analog out) that controls the left & right galvos for creation of
the light-sheet and shadow avoidance
the aser task (analog out) that controls all the laser intensities (Laser should only be on when the camera is acquiring) and the left/right ETL waveforms. This task is bundled with galvo-ETL task if a single DAQmx card is used, because multifunction DAQmx devices can only run only 1 AO hardware-timed task at a time (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KWYSA2&l=en-CH)
- run_tasks()[source]
Runs the tasks for triggering, analog and counter outputs
Firstly, the master trigger triggers all other task via a shared trigger line (PFI line as given in the config file).
For this to work, all analog output and counter tasks have to be started so that they are waiting for the trigger signal.
Warning: master_trigger_task does not have explicit sample rate, because some cards like NI-6733 do not support this for DO lines. So the master pulse duration varies depening on the device. Can be as short as small as 1 micro-second!
- save_etl_parameters_to_csv()
Saves the current ETL left/right offsets and amplitudes from the values to the ETL csv files
The .csv file needs to contain the following columns:
Wavelength Zoom ETL-Left-Offset ETL-Left-Amp ETL-Right-Offset ETL-Right-Amp
Creates a temporary cfg file with the ending _tmp
- start_tasks()[source]
Starts the tasks for camera triggering and analog outputs
If the tasks are configured to be triggered, they won’t output any signals until run_tasks() is called.
- state_request_handler(dict)
- update_etl_parameters_from_csv(cfg_path, laser, zoom)[source]
Updates the internal ETL left/right offsets and amplitudes from the values in the ETL csv files
The .csv file needs to contain the follwing columns:
Wavelength Zoom ETL-Left-Offset ETL-Left-Amp ETL-Right-Offset ETL-Right-Amp
- update_etl_parameters_from_laser(laser)[source]
Little helper method: Because laser changes need an ETL parameter update
mesoSPIM.src.mesoSPIM_Zoom module
mesoSPIM Module for controlling a discrete zoom changer
Authors: Fabian Voigt, Nikita Vladimirov