zetastitcher.align.filematrix module

Parse input file names, compute tile coordinates.

class zetastitcher.align.filematrix.FileMatrix(input_path=None, ascending_tiles_x=True, ascending_tiles_y=True, recursive=False, equal_shape=False)

Bases: object

Data structures for a matrix of input files.

Attributes
Nx
Ny
full_height
full_thickness
full_width
tiles_along_X

Groups of tiles to be stitched along X.

tiles_along_Y

Groups of tiles to be stitched along Y.

tiles_along_dir

Groups of tiles to be stitched along a given direction.

Methods

load_dir([dir, recursive])

Look for files in dir recursively and populate data structures.

slices()

A slice is a group of tiles that share at least a z frame.

clear_absolute_positions

compute_end_pos

compute_nominal_positions

get_json

load_yaml

parse_and_append

process_data_frame

save_to_yaml

property Nx
property Ny
clear_absolute_positions()
compute_end_pos()
compute_nominal_positions(px_size_z, px_size_xy)
data_frame

A pandas.DataFrame object. Contains the following columns: X, Y, Z, Z_end, xsize, ysize, nfrms, filename.

property full_height
property full_thickness
property full_width
get_json()
load_dir(dir=None, recursive=False)

Look for files in dir recursively and populate data structures.

Parameters
dirpath
load_yaml(fname)
parse_and_append(name, flist, shape=None)
process_data_frame()
save_to_yaml(filename, mode)
slices()

A slice is a group of tiles that share at least a z frame.

Returns
compgenerator

A generator of graphs, one for each connected component of G, where G is the graph of tiles connected by at least a z frame.

property tiles_along_X

Groups of tiles to be stitched along X.

Equivalent to tiles_along_dir having sent the following tuple: (['Z', 'X', 'Y'], 'Y')

Yields
pandas.DataFrame

A group of tiles

property tiles_along_Y

Groups of tiles to be stitched along Y.

Equivalent to tiles_along_dir having sent the following tuple: (['Z', 'Y', 'X'], 'X')

Yields
pandas.DataFrame

A group of tiles

property tiles_along_dir

Groups of tiles to be stitched along a given direction.

You need to send to this generator a tuple containing:
  • a list for sorting the pandas.DataFrame, such as ['Z', 'Y', 'X']

  • an axis for grouping, such as 'Y'

Yields
pandas.DataFrame

A group of tiles

zetastitcher.align.filematrix.parse_file_name(file_name)

Parse fields (stage coordinates) contained in file_name.

Parameters
file_namestr

The string to be parsed

Returns
x, y, zint

The parsed stage coordinates.