PYME.Acquire.Utils.tiler module

class PYME.Acquire.Utils.tiler.MultiwellCircularTiler(well_scan_radius, x_spacing, y_spacing, n_x, n_y, scope, tile_dir, tile_spacing=None, dwelltime=1, background=0, evtLog=False, trigger=False, base_tile_size=256, laser_state=None)

Bases: object

Creates a circular tiler for each well at a given spacing. For now create a separate tilepyramid for each well.

Creates a new pyramid for each well due to performance constraints.

Parameters
well_scan_radius: float

radius to scan within each well [um]

x_well_spacing: float

center-to-center spacing of each well along x [um]

y_well_spacing: float

center-to-center spacing of each well along y [um]

n_x: int

number of rows along x to tile

n_y: int

number of columns along y to tile

scope: PYME.Acquire.microscope
tile_dir: str

directory to store all pyramids

tile_spacing: float

distance between tile ‘pixels’, i.e. center-to-center distance between the individual tiles.

dwelltime
background
evtLog
trigger
base_tile_size
laser_state: dict

state lasers should be in at the start of each well - lasers are blanked between wells. Should be compatible with PYME.Acquire.microscope.StateManager.setItems

set_well_positions()

Establish x,y center positions of each well to scan. Making the current microscope position the center of the (0, 0) well, which is also the min x, min y well.

start()
start_next(*args, **kwargs)

Creates and starts the tiler for the next well until we’re finished.

Parameters
args
kwargs:

necessary as dispatch calls will include a signal keyword argument

stop()
class PYME.Acquire.Utils.tiler.TileAcquisition(scope: Microscope, tile_dir: str, n_tiles=10, tile_spacing=None, dwelltime=1, background=0, evtLog=None, trigger='auto', base_tile_size=256, return_to_start=True, save_raw=False, backend='file', backend_kwargs={})

Bases: AcquisitionBase

Parameters

return_to_start – bool Flag to toggle returning home at the end of the scan. False leaves scope position as-is on scan completion.

FILE_EXTENSION = '.tiles'
classmethod from_spool_settings(scope, settings, backend, backend_kwargs={}, series_name=None, spool_controller=None)

Create an Acquisition object from settings and a backend.

classmethod get_frozen_settings(scope, spool_controller=None)

Return a dictionary of settings for the acquisition

Used to “freeze” the state of the spool_controller and/or other settings objects when queueing acquisitions for subsequent execution via the ActionManager

classmethod get_tiled_area(scope, settings)
md()

Return acqusition metadata (a PYME.IO.MetaDataHandler object)

generally just a short wrapper around the backend metadata

#TODO - rename this to .mdh, or remove entirely and standardise backend access?

on_frame(frameData, **kwargs)

Frame source handler

This method should be connected to the frame source signal (i.e. scope.frameWrangler.onFrame) and be responsible for handling incoming frames, passing them off to storage and performing anything that needs to be done (e.g. hardware movements or protocol task handling) before the next frame. NOTE - this method is called when the frame is retrieved by the frame wrangler - if the camera is running in continuous mode, this may be several frames after the camera has actually acquired the frame.

start()

Start the acquisition

This will usually record any metadata, connect self.on_frame to a frame source (i.e. scope.frameWrangler.onFrame), and initialise the backend. It should not block, with the bulk of the acquisition logic taking place in frame source handler.

stop()

Stop the acquisition

This should disconnect from the frame souce, flush any remaining buffers, return hardware to starting state (if modified), do any cleanup, and finalise the backend.

It is desirable to send a final on_progress signal so that the GUI reflects the actual number of frames spooled etc… .

Once everything is complete, the on_stop signal should be emitted and the spool_complete flag set.

PYME.Acquire.Utils.tiler.Tiler(*args, **kwargs)