linumpy.reconstruction#

“Quick reconstruction and processing methods for the S-OCT data.

Attributes#

Functions#

getLargestCC(segmentation)

Get the largest connected component in a binary image.

get_tiles_ids(directory[, z])

Analyzes a directory and detects all the tiles in contains.

get_tiles_ids_from_list(tiles_list[, file_pattern])

get_mosaic_info(directory, z[, overlap_fraction, ...])

quick_stitch(directory, z[, overlap_fraction, n_rot, ...])

detect_mosaic(directory, z[, img, margin, display, ...])

Detect the tissue in the mosaic and compute the limits of the tissue.

save_quickstitch(img, quickstitch_file)

Module Contents#

linumpy.reconstruction.getLargestCC(segmentation)[source]#

Get the largest connected component in a binary image.

Parameters.#

segmentationnp.ndarray

The binary image to process.

returns:

The largest connected component.

rtype:

np.ndarray

Parameters:

segmentation (numpy.ndarray)

Return type:

numpy.ndarray

linumpy.reconstruction.DEFAULT_TILE_FILE_PATTERN = 'tile_x(?P<x>\\d+)_y(?P<y>\\d+)_z(?P<z>\\d+)'[source]#
linumpy.reconstruction.get_tiles_ids(directory, z=None)[source]#

Analyzes a directory and detects all the tiles in contains.

Parameters:

z (int | None)

linumpy.reconstruction.get_tiles_ids_from_list(tiles_list, file_pattern=DEFAULT_TILE_FILE_PATTERN)[source]#
linumpy.reconstruction.get_mosaic_info(directory, z, overlap_fraction=0.2, use_stage_positions=False)[source]#
Parameters:
  • z (int)

  • overlap_fraction (float)

  • use_stage_positions (bool)

linumpy.reconstruction.quick_stitch(directory, z, overlap_fraction=0.2, n_rot=3, zmin=0, zmax=-1, use_log=False, use_stage_positions=False, flip_ud=True, flip_lr=False, galvo_shift=None, galvo_shift_first_tile=(0, 0))[source]#
Parameters:
linumpy.reconstruction.detect_mosaic(directory, z, img=None, margin=0.5, display=False, image_file=None, roi_file=None, keep_largest_island=False, stitching_settings=None)[source]#

Detect the tissue in the mosaic and compute the limits of the tissue.

Parameters.#

directorystr

The directory containing the tiles.

zint

The z slices to process

marginfloat

The margin to add to the tissue limits (in mm).

displaybool

Display the result in a matplotlib window.

image_filestr

The filename to save the quickstitch image.

roi_filestr

The filename to save the ROI image.

keep_largest_islandbool

Keep the largest connected component in the mask.

Parameters:
linumpy.reconstruction.save_quickstitch(img, quickstitch_file)[source]#
Return type:

None