TileManager and CycleManager

Both components drive multi-position acquisitions, from different directions. hSI.hTileManager works in space - a set of tiles laid out over the sample - while hSI.hCycleManager works in configurations - a list of iterations, each with its own CFG file, delay and stage position.


hSI.hTileManager

scanimage.components.TileManager. Tiles are scanimage.components.tiles.tile objects; each carries its corner points, its resolution, a sample point and, once acquired, its hRoiData. Tiles live in sample coordinates, so they follow the stage.

Property

Description

hScanTiles

Read-only array of the tiles that will be scanned.

tileScanIndices

Order in which the scan tiles are visited.

scanTileSortFcn

Function that produces that order. Defaults to scanimage.components.tileTools.tileSortingFcns.naiveNearest.

scanFramesPerTile

Frames acquired at each tile.

isFastZ

Traverse tiles at different z with the FastZ actuator rather than the stage.

scanStageSettleTime

Seconds to wait after a stage move before acquiring. Default 0.1.

scanTileRoiGroups

The ROI group generated for each tile.

tilesDone

Live counter of scanned tiles.

tileScanningInProgress, scanAbortFlag, acqDoneFlag, loopedAcquisition

Status flags.

Method

Description

hSI.hTileManager.addScanTile(tiles)

Add tiles to the scan set.

hSI.hTileManager.removeScanTiles(options) / clearScanTiles()

Remove tiles.

tiles = hSI.hTileManager.makeTiles(tileParams)

Build tiles from a parameter struct.

hSI.hTileManager.initTileScanning()

Prepare for a tiled acquisition.

done = hSI.hTileManager.startNextTileScan()

Move to and acquire the next tile. Returns true when the set is finished.

hSI.hTileManager.abortTileScan()

Stop a tiled acquisition.

idxs = hSI.hTileManager.getTileScanPath(startTileIdx,scanTiles)

The visiting order produced by scanTileSortFcn.

idx = hSI.hTileManager.findTileClosestToCurPos(tiles)

Nearest tile to the current stage position.

pct = hSI.hTileManager.getOverlap(newTile,refTile)

Overlap between two tiles, as a percentage.

idxs = hSI.hTileManager.getSameTilesFromAllZ(tile)

The same lateral tile at every configured z.

rg = hSI.hTileManager.generateTileRoiGroups()

Build the ROI groups for the current tiles.

hSI.hTileManager.saveTiles() / loadTiles()

Persist the tile set.

md = hSI.hTileManager.getTileMetaData() / saveTileMetaData()

Tile metadata for the acquisition.

hSI.hTileManager.scanFramesPerTile   = 10;
hSI.hTileManager.scanStageSettleTime = 0.2;
hSI.hTileManager.initTileScanning();

hSI.hCycleManager

scanimage.components.CycleManager. A cycle is an ordered list of iterations; each iteration is a scanimage.components.cycles.CycleData object with

  • cfgName - the CFG file to load for that iteration,

  • motorPosition - the stage position to move to,

  • iterDelay - seconds to wait,

  • active - whether the iteration runs.

The list is held in a scanimage.components.cycles.CycleDataGroup.

Property

Description

cycleDataGroup

The CycleDataGroup holding the iterations. It also carries goHomeAtCycleEndEnabled, autoResetModeEnabled and restoreOriginalCFGEnabled.

totalCycles

Number of times the cycle repeats.

tfCycleWithLoopAcq

Advance the cycle per acquisition within a LOOP, rather than per acquisition mode.

isStageScanning

True when hSI.hScan2D is a stage scanner.

cycleStartFcn

Function run at the start of a cycle.

preMoveFcn, moveFcn, postMoveFcn

Functions run before, during and after the move to the next position. Overriding moveFcn is how stage scanning replaces the default move.

Method

Description

hSI.hCycleManager.start()

Start the cycle. hSI.startCycle() calls this.

hSI.hCycleManager.abort()

Stop it.

hSI.hCycleManager.appendNewIteration()

Append an iteration with the current settings.

hSI.hCycleManager.appendNewIterationByPosition(positions)

Append iterations for a list of positions.

hSI.hCycleManager.removeLastIteration() / removeIterationAt(idx)

Remove iterations.

hSI.hCycleManager.reset() / refresh()

Reset or refresh the cycle definition.

hSI.hCycleManager.resetCyclesCounter(), resetIterationsCounter(), resetCounters()

Reset progress counters.

hSI.hCycleManager.saveCycle(filename)

Save the cycle to file.

hSI.hCycleManager.defaultMoveFcn(hSI)

The default move implementation, useful as a starting point for a custom moveFcn.

hSI.hCycleManager.appendNewIteration();
hSI.hCycleManager.cycleDataGroup.getIterByIdx(1).iterDelay = 5;
hSI.hCycleManager.totalCycles = 3;

hSI.startCycle();

The cycleDataGroupDone user function event fires when the last iteration of a cycle data group completes.