linumpy.mosaic.quick_stitch#
Quick reconstruction and processing methods for the S-OCT data.
Attributes#
Functions#
|
Get the largest connected component in a binary image. |
|
Analyze a directory and detect all the tiles it contains. |
|
Return tile (x, y, z) IDs parsed from a list of tile paths. |
|
Return mosaic geometry and tile metadata for a given z-slice. |
|
Stitch all tiles in a directory for a given z-slice into a mosaic. |
|
Detect the tissue in the mosaic and compute the limits of the tissue. |
|
Save the quickstitch mosaic to a file, normalizing intensity. |
Module Contents#
- linumpy.mosaic.quick_stitch.get_largest_cc(segmentation)[source]#
Get the largest connected component in a binary image.
- Parameters:
segmentation (np.ndarray) – The binary image to process.
- Returns:
The largest connected component.
- Return type:
np.ndarray
- linumpy.mosaic.quick_stitch.DEFAULT_TILE_FILE_PATTERN = 'tile_x(?P<x>\\d+)_y(?P<y>\\d+)_z(?P<z>\\d+)'[source]#
- linumpy.mosaic.quick_stitch.get_tiles_ids(directory, z=None)[source]#
Analyze a directory and detect all the tiles it contains.
- Parameters:
directory (pathlib.Path)
z (int | None)
- Return type:
- linumpy.mosaic.quick_stitch.get_tiles_ids_from_list(tiles_list, file_pattern=DEFAULT_TILE_FILE_PATTERN)[source]#
Return tile (x, y, z) IDs parsed from a list of tile paths.
- linumpy.mosaic.quick_stitch.get_mosaic_info(directory, z, overlap_fraction=0.2, use_stage_positions=False)[source]#
Return mosaic geometry and tile metadata for a given z-slice.
- Parameters:
directory (pathlib.Path)
z (int)
overlap_fraction (float)
use_stage_positions (bool)
- Return type:
- linumpy.mosaic.quick_stitch.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]#
Stitch all tiles in a directory for a given z-slice into a mosaic.
- linumpy.mosaic.quick_stitch.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:
directory (str) – The directory containing the tiles.
z (int) – The z slices to process
img (np.ndarray or None) – Optional pre-computed mosaic image.
stitching_settings (dict or None) – Optional stitching settings override.
margin (float) – The margin to add to the tissue limits (in mm).
display (bool) – Display the result in a matplotlib window.
image_file (str) – The filename to save the quickstitch image.
roi_file (str) – The filename to save the ROI image.
keep_largest_island (bool) – Keep the largest connected component in the mask.
- Return type:
- linumpy.mosaic.quick_stitch.save_quickstitch(img, quickstitch_file)[source]#
Save the quickstitch mosaic to a file, normalizing intensity.
- Parameters:
img (numpy.ndarray)
quickstitch_file (pathlib.Path)
- Return type:
None