mesoSPIM.src.utils package

Submodules

mesoSPIM.src.utils.acquisitions module

acquisitions.py

Helper classes for mesoSPIM acquisitions

class mesoSPIM.src.utils.acquisitions.Acquisition(*args: Any, **kwargs: Any)[source]

Bases: IndexedOrderedDict

Custom acquisition dictionary. Contains all the information to run a single acquisition.

Parameters:
  • x_pos (float) – X start position in microns

  • y_pos (float) – Y start position in microns

  • z_start (float) – Z start position in microns

  • z_end (float) – Z end position in microns

  • z_step (float) – Z stepsize in microns ,

  • theta_pos (float) – Rotation angle in microns

  • f_pos (float) – Focus position in microns

  • laser (str) – Laser designation

  • intensity (int) – Laser intensity in 0-100

  • filter (str) – Filter designation (has to be in the config)

  • zoom (str) – Zoom designation

  • filename (str) – Filename for the file to be saved

Attributes:

Note

Getting keys: keys = [key for key in acq1.keys()]

Example

Getting keys: keys = [key for key in acq1.keys()]

Todo

Testtodo-Entry

get_acquisition_time(framerate)[source]

Method to return the time the acquisition will take at a certain framerate.

Parameters:

float – framerate of the microscope

Returns:

Acquisition time in seconds

Return type:

float

get_capitalized_keylist()[source]

Here, a list of capitalized keys is returned for usage as a table header

get_delta_dict()[source]

Returns relative movement dict for z-steps and f-steps

get_delta_z_and_delta_f_dict(inverted=False)[source]

Returns relative movement dict for z- and f-steps

get_endpoint()[source]
get_focus_stepsize_generator(f_stage_min_step_um=0.25)[source]

‘ Provides a generator object to correct rounding errors for focus tracking acquisitions.

The focus stage has to travel a shorter distance than the sample z-stage, ideally only a fraction of the z-step size. However, due to the limited minimum step size of the focus stage, rounding errors can accumulate over thousands of steps.

Therefore, the generator tracks the rounding error and applies correcting steps here and there to minimize the error.

This assumes a minimum step size of around 0.25 micron that the focus stage is capable of.

This method contains lots of round functions to keep residual rounding errors at bay.

get_image_count()[source]

Method to return the number of planes in the acquisition

get_keylist()[source]

A list keys is returned for usage as a table header

get_startpoint()[source]

Provides a dictionary with the startpoint coordinates

class mesoSPIM.src.utils.acquisitions.AcquisitionList(*args)[source]

Bases: list

Class for a list of acquisition objects

Examples: “([acq1,acq2,acq3])” is due to the fact that list takes only a single argument acq_list = AcquisitionList([acq1,acq2,acq3]) acq_list.time() > 3600 acq_list.planes() > 18000

acq_list[2](2) >10 acq_list[2][‘y_pos’] >10 acq_list[2][‘y_pos’] = 34

check_filename_extensions()[source]

Returns files that have no extension, so their format is undefined.

check_for_duplicated_filenames()[source]

Returns a list of duplicated filenames

check_for_existing_filenames()[source]

Returns a list of existing filenames

check_for_nonexisting_folders()[source]

Returns a list of nonexisting folders

find_value_index(value: str = '488 nm', key: str = 'laser')[source]

Find the attribute index in the acquisition list. Example: al = AcquisitionList([Acquisition(), Acquisition(), Acquisition(), Acquisition()]) al[0][‘laser’] = ‘488 nm’ # al[1][‘laser’] = ‘488 nm’ # gets removed because non-unique al[2][‘laser’] = ‘561 nm’ # al[3][‘laser’] = ‘637 nm’ # Output: al.find_value_index(‘488 nm’, ‘laser’) # -> 0 al.find_value_index(‘561 nm’, ‘laser’) # -> 1 al.find_value_index(‘637 nm’, ‘laser’) # -> 2

get_acquisition_time(framerate)[source]

Returns total time in seconds of a list of acquisitions

get_all_filenames()[source]

Returns a list of all filenames

get_capitalized_keylist()[source]
get_duplicates_in_list(in_list)[source]
get_image_count()[source]

Returns the total number of planes for a list of acquistions

get_keylist()[source]

Here, a list of capitalized keys is returned for usage as a table header

get_n_angles()[source]

Get the number of unique angles

get_n_lasers()[source]

Get the number of unique laser lines

get_n_shutter_configs()[source]

Get the number of unique shutter configs (1 or 2)

get_n_tiles()[source]

Get the number of tiles as unique (x,y,z_start,rot) combinations

get_startpoint()[source]
get_tile_index(acq)[source]

Get the the tile index for given acquisition

get_unique_attr_list(key: str = 'laser') list[source]

Return ordered list of acquisition attributes.

Parameters:

key: str

One of (‘laser’, ‘shutterconfig’, ‘rot’)

Returns:

List of strings, e.g. (‘488’, ‘561’) for key=’laser’, in the order of acquisition.

mesoSPIM.src.utils.delegates module

class mesoSPIM.src.utils.delegates.ChooseFolderDelegate(*args: Any, **kwargs: Any)[source]

Bases: QItemDelegate

A delegate that has a button, in turn opening a set folder dialog and displaying the folder name.

choose_folder_dialog()[source]
createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.ComboDelegate(*args: Any, **kwargs: Any)[source]

Bases: QItemDelegate

A delegate that places a fully functioning QComboBox in every cell of the column to which it’s applied

TODO: Provide list for entries during __init__

createEditor(parent, option, index)[source]
currentIndexChanged()[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.ETLSpinBoxDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Delegate with Spinbox, very fine steps

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.IntensitySpinBoxDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Delegate with Spinbox for laser intensity

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
class mesoSPIM.src.utils.delegates.MarkFocusPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: MarkPositionDelegate

set_model_data_from_button(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.MarkPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Delegate with a Mark button

Upon hitting the mark button, it should take the current value from e.g. the coordinates and put them into the model set it into

There is only a single delegate per row instantiated.

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]

Sets the data in the model in two ways: * When the Button is pressed, it should use the model position * If the lineEdit has a value change, it should use this

Important: This functionality has to be inheritable

set_model_data_from_button(editor, model, index)[source]
set_model_data_from_focus_change(editor, index)[source]
set_model_data_from_lineedit(editor, model, index)[source]
updateEditorGeometry(editor, option, index)[source]
class mesoSPIM.src.utils.delegates.MarkRotationPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: MarkPositionDelegate

set_model_data_from_button(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.MarkXPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: MarkPositionDelegate

set_model_data_from_button(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.MarkYPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: MarkPositionDelegate

set_model_data_from_button(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.MarkZPositionDelegate(*args: Any, **kwargs: Any)[source]

Bases: MarkPositionDelegate

set_model_data_from_button(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.ProgressBarDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

A progress bar as a delegate

Of course, it does not have an editing function, instead it only serves to display data

TODO: How to set value properly?

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.RotationSpinBoxDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Delegate with Spinbox, very fine steps

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.SliderDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

A slider delegate

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.SliderWithValueDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class mesoSPIM.src.utils.delegates.ZstepSpinBoxDelegate(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Delegate with Spinbox, Minimum value is 0 (no negative step sizes)

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]

mesoSPIM.src.utils.filename_wizard module

Contains Nonlinear Filename Wizard Class: autogenerates Filenames

class mesoSPIM.src.utils.filename_wizard.AbstractSelectionPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

nextId()[source]
validatePage()[source]
class mesoSPIM.src.utils.filename_wizard.FilenameWizard(*args: Any, **kwargs: Any)[source]

Bases: QWizard

bigtiff = 3
done(r)[source]

Reimplementation of the done function

if r == 0: canceled if r == 1: finished properly

finished = 5
generate_filename_list(increment_number=True)[source]

Go through the model, entry for entry and populate the filenames

num_of_pages = 6
raw = 1
single_hdf5 = 4
tiff = 2
update_filenames_in_model()[source]
welcome = 0
class mesoSPIM.src.utils.filename_wizard.FilenameWizardBigTiffSelectionPage(*args: Any, **kwargs: Any)[source]

Bases: AbstractSelectionPage

class mesoSPIM.src.utils.filename_wizard.FilenameWizardCheckResultsPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

cleanupPage()[source]
initializePage()[source]
class mesoSPIM.src.utils.filename_wizard.FilenameWizardRawSelectionPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

nextId()[source]
validatePage()[source]
class mesoSPIM.src.utils.filename_wizard.FilenameWizardSingleHDF5SelectionPage(*args: Any, **kwargs: Any)[source]

Bases: AbstractSelectionPage

validatePage()[source]
class mesoSPIM.src.utils.filename_wizard.FilenameWizardTiffSelectionPage(*args: Any, **kwargs: Any)[source]

Bases: AbstractSelectionPage

class mesoSPIM.src.utils.filename_wizard.FilenameWizardWelcomePage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

nextId()[source]

mesoSPIM.src.utils.focus_tracking_wizard module

Contains Focus Tracking Wizard Class: autogenerates start end end foci from reference / anchor positions

class mesoSPIM.src.utils.focus_tracking_wizard.FocusTrackingWizard(*args: Any, **kwargs: Any)[source]

Bases: QWizard

Wizard to run

The parent is the Window class of the microscope

calculate_f_pos(z_1, z_2, f_1, f_2, z)[source]
convert_string_to_list(inputstring)[source]
done(r)[source]

Reimplementation of the done function

if r == 0: canceled if r == 1: finished properly

update_focus_positions_in_model()[source]
class mesoSPIM.src.utils.focus_tracking_wizard.FocusTrackingWizardCheckResultsPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

initializePage()[source]
class mesoSPIM.src.utils.focus_tracking_wizard.FocusTrackingWizardSetReferencePointsPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

get_first_reference_point()[source]
get_second_reference_point()[source]
validatePage()[source]

Further validation operations can be introduced here

class mesoSPIM.src.utils.focus_tracking_wizard.FocusTrackingWizardWelcomePage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

mesoSPIM.src.utils.image_processing_wizard module

Contains Image Processing Wizard Class: Sets online processing options

class mesoSPIM.src.utils.image_processing_wizard.ImageProcessingWizard(*args: Any, **kwargs: Any)[source]

Bases: QWizard

Wizard to run

The parent is the Window class of the microscope

done(r)[source]

Reimplementation of the done function

if r == 0: canceled if r == 1: finished properly

set_processing_options()[source]
class mesoSPIM.src.utils.image_processing_wizard.ImageProcessingWizardCheckResultsPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

class mesoSPIM.src.utils.image_processing_wizard.ImageProcessingWizardSetOptionsPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

validatePage()[source]

Further validation operations can be introduced here

class mesoSPIM.src.utils.image_processing_wizard.ImageProcessingWizardWelcomePage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

mesoSPIM.src.utils.models module

class mesoSPIM.src.utils.models.AcquisitionModel(*args: Any, **kwargs: Any)[source]

Bases: QAbstractTableModel

Model class containing a AcquisitionList

The headers are derived from the keys of the first acquisition dictionary.

TODO: Typecheck in __init__ for AcquisitionList as table

columnCount(parent=PyQt5.QtCore.QModelIndex)[source]
copyRow(row)[source]

Copies a row

data(index, role=PyQt5.QtCore.Qt.DisplayRole)[source]

Data allows to fetch one item

deleteTable()[source]
dropMimeData(data, action, row, col, parent)[source]

Here, the model needs to deserialize the entries in a QMimeData object

Always move the entire row, and don’t allow column “shifting”

flags(index)[source]

Return Editability for arbitrary elements Drag and drop flags are also set here

getColumnByName(name)[source]
getEndFocusColumn()[source]
getFilename(row)[source]
getFilenameColumn()[source]
getFilter(row)[source]
getImageCount(row)[source]
getLaser(row)[source]
getLaserList()[source]
getNAngles()[source]
getNShutterConfigs()[source]
getName(row)[source]

Here, I assume that the filename is the name of the process

getRotationPosition(row)[source]
getShutterconfig(row)[source]
getStartFocusColumn()[source]
getTileIndex(row)[source]
getTime(row)[source]
getTotalImageCount()[source]

gets the total number of planes from the model

getXPosition(row)[source]
getYPosition(row)[source]
getZEndPosition(row)[source]
getZStartPosition(row)[source]
getZoom(row)[source]
get_acquisition_list(row=None)[source]
headerData(section, orientation, role)[source]

What to display in the table headers

Orientation: Row part or column part Section: Which index

insertRows(position, rows, parent=PyQt5.QtCore.QModelIndex)[source]

Method to add entries to the model

Rows: how many rows are inserted at once.

The views expect a zero-based index

self.beginInsertRows(index, first, last) to send signals

loadModel(filename)[source]
mimeData(indices)[source]

Here, the model needs to provide a serialization of the entries in a QMimeData object

moveRows(source_parent, source_row, count, destination_parent, destination_row)[source]
removeRows(position, rows, parent=PyQt5.QtCore.QModelIndex)[source]
rowCount(parent=PyQt5.QtCore.QModelIndex)[source]

Tells the view how many items this model contains

saveModel(filename)[source]

Allows to serialize a model via pickle

send_data_changed()[source]

Helper method that allows to send a dataChanged Signal for the whole table

setData(index, value, role=PyQt5.QtCore.Qt.EditRole)[source]

Method used to write data

Here, a single table entry is set.

Has to return True when the change was successful

setDataFromState(row, state_parameter)[source]
setShutterconfig(row, shutterconfig)[source]
setTable(table)[source]
updatePlanes(index, index2)[source]

Checks if z_planes need to be updated and updates them

mesoSPIM.src.utils.multicolor_acquisition_builder module

Classes that define acquisition builders:

Take a dict with information and return an acquisition list

class mesoSPIM.src.utils.multicolor_acquisition_builder.AcquisitionListBuilder[source]

Bases: object

Generic Acquisition List Builder as parent class?

TODO: Write this class

class mesoSPIM.src.utils.multicolor_acquisition_builder.MulticolorTilingAcquisitionListBuilder(dict)[source]

Bases: object

TODO: Filename generation

self.dict[‘x_start’] self.dict[‘x_end’] self.dict[‘y_start’] self.dict[‘y_end’] self.dict[‘z_start’] self.dict[‘z_end’] self.dict[‘z_step’] self.dict[‘theta_pos’] self.dict[‘f_pos’] self.dict[‘x_offset’] # Offset always larger than 0 self.dict[‘y_offset’] # Offset always larger than 0 self.dict[‘x_image_count’] self.dict[‘y_image_count’]

get_acquisition_list()[source]
y_end

Reverse direction of the offset if pos_end < pos_start

mesoSPIM.src.utils.multicolor_acquisition_wizard module

Contains Multicolor Acquisition Wizard Classes:

Widgets that take user input and create acquisition lists

class mesoSPIM.src.utils.multicolor_acquisition_wizard.CheckTilingPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

initializePage()[source]

Here, the acquisition list is created for further checking

class mesoSPIM.src.utils.multicolor_acquisition_wizard.DefineBoundingBoxPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

get_edge_position(key)[source]
update_z_step()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.DefineFolderPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

choose_folder()[source]

File dialog for choosing the save folder

class mesoSPIM.src.utils.multicolor_acquisition_wizard.DefineGeneralParametersPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

initializePage()[source]
update_fov_size()

Should be invoked whenever the zoom selection is changed

update_other_acquisition_parameters()[source]

Here, all the Tiling parameters are filled in the parent (TilingWizard) This method should be called when the “Next” Button is pressed

update_page_from_state()[source]
update_shutt_seq()
update_x_and_y_offset()
validatePage()[source]

The done function should update all the parent parameters

class mesoSPIM.src.utils.multicolor_acquisition_wizard.FifthChannelPage(*args: Any, **kwargs: Any)[source]

Bases: GenericChannelPage

nextId()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.FinishedTilingPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

validatePage()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.FirstChannelPage(*args: Any, **kwargs: Any)[source]

Bases: GenericChannelPage

nextId()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.FourthChannelPage(*args: Any, **kwargs: Any)[source]

Bases: GenericChannelPage

nextId()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.GenericChannelPage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

go_to_z_position(z)[source]
initializePage()[source]
update_end_focus_position()[source]
update_page_from_state()[source]
update_start_focus_position()[source]
validatePage()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.MulticolorTilingWizard(*args: Any, **kwargs: Any)[source]

Bases: QWizard

Wizard to run

The parent is the Window class of the microscope

done(r)[source]

Reimplementation of the done function

if r == 0: canceled if r == 1: finished properly

get_dict()[source]
go_back()[source]

Amend previously created channel settings

print_dict()[source]
state

Instance variables

update_acquisition_list()[source]
update_image_counts()[source]
update_model(model, acq_list)[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.SecondChannelPage(*args: Any, **kwargs: Any)[source]

Bases: GenericChannelPage

nextId()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.ThirdChannelPage(*args: Any, **kwargs: Any)[source]

Bases: GenericChannelPage

nextId()[source]
class mesoSPIM.src.utils.multicolor_acquisition_wizard.TilingWelcomePage(*args: Any, **kwargs: Any)[source]

Bases: QWizardPage

mesoSPIM.src.utils.optimization module

Utilities for fast image-based optimization (auto-focus, etc) 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.utils.optimization.fit_gaussian_1d(f_arr, x_arr)[source]

Fit measured values f_arr(x_arr) with a gaussian function. The true gaussian peak must lie withing the x_arr limits, so the measurements must ‘clamp’ the gaussian from left and right.

Parameters:

f_arr: 1d-array

Measured function values.

x_arr: 1d-array

Positions where the function was measured.

Returns:

(xcenter, sigma, f_amp, f_offset): tuple

Parameters of gaussian fit: f = f_offset + f_amp * np.exp(-((x_arr - xcenter)**2) / (2 * sigma ** 2))

mesoSPIM.src.utils.optimization.fit_parabola_1d(f_arr, x_arr)[source]

Fit measured values f_arr(x_arr) with a parabola function f=a(x-x0)**2 + b. The true peak must lie withing the x_arr limits, so the measurements must ‘clamp’ the function from left and right.

Parameters:

f_arr: 1d-array

Measured function values.

x_arr: 1d-array

Positions where the function was measured.

Returns:

(xcenter, f_amp, f_offset): tuple

Parameters of parabola fit: f = f_offset + f_amp(x-xcenter)**2

mesoSPIM.src.utils.optimization.gaussian_1d(x_arr, xo, sigma, amplitude=1, offset=0)[source]

“Return 1D gaussian function as array

mesoSPIM.src.utils.optimization.shannon_dct(img, psf_radius_px=1)[source]

Shannon entropy of discreet cosine transform, for 2D images.

mesoSPIM.src.utils.optimization.sigma2fwhm(sigma)[source]

Convert gaussian std (sigma) to full-width half-maximum (FWHM)

mesoSPIM.src.utils.utility_functions module

Contains a variety of mesoSPIM utility functions

mesoSPIM.src.utils.utility_functions.GetCurrentProcessorNumber()
mesoSPIM.src.utils.utility_functions.convert_seconds_to_string(delta_t)[source]

Converts an input value in seconds into a string in the format hh:mm:ss

Interestingly, a variant using np.divmod is around 4-5x slower in initial tests.

mesoSPIM.src.utils.utility_functions.format_data_size(bytes)[source]

Converts bytes into human-readable format (kb, MB, GB)

mesoSPIM.src.utils.utility_functions.gb_size_of_array_shape(shape)[source]

Given a tuple of array shape, return the size in GB of at uint16 array

mesoSPIM.src.utils.utility_functions.log_cpu_core(logger, msg='')[source]
mesoSPIM.src.utils.utility_functions.replace_with_underscores(string)[source]

Replaces spaces and slashes with underscores

mesoSPIM.src.utils.utility_functions.write_line(file, key='', value='')[source]

Little helper method to write a single line with a key and value for metadata Adds a line break at the end.

mesoSPIM.src.utils.waveforms module

mesoSPIM Module for creating waveforms and analog output signals

Author: Fabian Voigt

#TODO * Usage of amplitude is not consistent (peak-to-peak in single_pulse)

mesoSPIM.src.utils.waveforms.sawtooth(samplerate=100000, sweeptime=0.4, frequency=10, amplitude=0, offset=0, dutycycle=50, phase=1.5707963267948966)[source]

Returns a numpy array with a sawtooth function

Used for creating the galvo signal.

Example: galvosignal = sawtooth(100000, 0.4, 199, 3.67, 0, 50, np.pi)

mesoSPIM.src.utils.waveforms.single_pulse(samplerate=100000, sweeptime=0.4, delay=10, pulsewidth=1, amplitude=0, offset=0)[source]

Returns a numpy array with a single pulse

Used for creating TTL pulses out of analog outputs and laser intensity pulses.

Units: samplerate: Integer sweeptime: Seconds delay: Percent pulsewidth: Percent amplitude: Volts offset: Volts

Examples:

typical_TTL_pulse = single_pulse(samplerate, sweeptime, 10, 1, 5, 0) typical_laser_pulse = single_pulse(samplerate, sweeptime, 10, 80, 1.25, 0)

mesoSPIM.src.utils.waveforms.square(samplerate=100000, sweeptime=0.4, frequency=10, amplitude=0, offset=0, dutycycle=50, phase=3.141592653589793)[source]

Returns a numpy array with a rectangular waveform

mesoSPIM.src.utils.waveforms.tunable_lens_ramp(samplerate=100000, sweeptime=0.4, delay=7.5, rise=85, fall=2.5, amplitude=0, offset=0)[source]

Returns a numpy array with a ETL ramp

The waveform starts at offset and stays there for the delay period, then rises linearly to 2x amplitude (amplitude here refers to 1/2 peak-to-peak) and drops back down to the offset voltage during the fall period.

Switching from a left to right ETL ramp is possible by exchanging the rise and fall periods.

Units of parameters samplerate: Integer sweeptime: Seconds delay: Percent rise: Percent fall: Percent amplitude: Volts offset: Volts

mesoSPIM.src.utils.widgets module

class mesoSPIM.src.utils.widgets.MarkPositionWidget(*args: Any, **kwargs: Any)[source]

Bases: QWidget

Pushbutton plus position indicator

class mesoSPIM.src.utils.widgets.SliderWithValue(*args: Any, **kwargs: Any)[source]

Bases: QWidget

Slider with value to the left

setText(value)[source]
setValue(value)[source]
value()[source]
valueChanged

alias of int

Module contents