Skip to content

nabu.stitching.stitcher.single_axis

source module nabu.stitching.stitcher.single_axis

Classes

source class SingleAxisStitcher(configuration, *args, **kwargs)

Bases : _StitcherBase

Any single-axis base class

Attributes

  • serie_label : str return serie name for logs

  • reading_orders as scan can be take on one direction or the order (rotation goes from X to Y then from Y to X) we might need to read data from one direction or another

  • stitching_axis_in_frame_space : stitching is operated in 2D (frame) space. So the axis in frame space is different than the one in 3D ebs-tomo space (https //tomo.gitlab-pages.esrf.fr/bliss-tomo/master/modelization.html)

Methods

  • stitch

  • get_n_slices_to_stitch Return the number of slice to be stitched

  • get_final_axis_positions_in_px compute the final position (in pixel) from the initial position of the first object and the final relative shift computed (1) (1): the final relative shift is obtained from the initial shift (from motor position of provided by the user) + the refinement shift from cross correlation algorithm :return: dict with tomo object identifier (str) as key and a tuple of position in pixel (axis_0_pos, axis_1_pos, axis_2_pos)

  • settle_flips User can provide some information on existing flips at frame level. The goal of this step is to get one flip_lr and on flip_ud value per scan or volume

  • rescale_frames rescale_frames if requested by the configuration

  • normalize_frame_by_sample normalize frame from a sample picked on the left or the right

  • stitch_frames shift frames according to provided shifts (as y, x tuples) then stitch all the shifted frames together and save them to output_dataset.

source property SingleAxisStitcher.axis: int

source property SingleAxisStitcher.dumper

source property SingleAxisStitcher.stitching_axis_in_frame_space

//tomo.gitlab-pages.esrf.fr/bliss-tomo/master/modelization.html)

source method SingleAxisStitcher.stitch(store_composition: bool = True)BaseIdentifier

source property SingleAxisStitcher.serie_label: str

return serie name for logs

source method SingleAxisStitcher.get_n_slices_to_stitch()

Return the number of slice to be stitched

Raises

  • RuntimeError

source method SingleAxisStitcher.get_final_axis_positions_in_px()dict

compute the final position (in pixel) from the initial position of the first object and the final relative shift computed (1) (1): the final relative shift is obtained from the initial shift (from motor position of provided by the user) + the refinement shift from cross correlation algorithm :return: dict with tomo object identifier (str) as key and a tuple of position in pixel (axis_0_pos, axis_1_pos, axis_2_pos)

source method SingleAxisStitcher.settle_flips()

User can provide some information on existing flips at frame level. The goal of this step is to get one flip_lr and on flip_ud value per scan or volume

Raises

  • ValueError

  • TypeError

source property SingleAxisStitcher.series: Series

source property SingleAxisStitcher.configuration: SingleAxisStitchingConfiguration

source property SingleAxisStitcher.progress

source method SingleAxisStitcher.rescale_frames(frames: tuple)

rescale_frames if requested by the configuration

source method SingleAxisStitcher.normalize_frame_by_sample(frames: tuple)

normalize frame from a sample picked on the left or the right

source staticmethod SingleAxisStitcher.stitch_frames(frames: tuple | numpy.ndarray, axis, x_relative_shifts: tuple, y_relative_shifts: tuple, output_dtype: numpy.ndarray, stitching_axis: int, overlap_kernels: tuple, dumper: DumperBase = None, check_inputs=True, shift_mode='nearest', i_frame=None, return_composition_cls=False, alignment='center', pad_mode='constant', new_width: int | None = None)numpy.ndarray

shift frames according to provided shifts (as y, x tuples) then stitch all the shifted frames together and save them to output_dataset.

:param tuple frames: element must be a DataUrl or a 2D numpy array :param stitching_regions_hdf5_dataset:

Raises

  • ValueError

  • NotImplementedError

  • TypeError