pystack3d.resampling module

Functions related to the resampling processing

pystack3d.resampling.init_args(params, shape)

Initialize arguments related to the current processing (‘resampling’)

Parameters:
  • params (dict) – Dictionary related to the current process. See the related documentation for more details.

  • shape (tuple of 3 int) – Shape of the stack to process

Returns:

stats_out – Statistics related to outputs (resampled frames)

Return type:

numpy.ndarray((len(zpos_out), 2, 3))

pystack3d.resampling.resampling(fnames=None, inds_partition=None, queue_incr=None, policy=None, zpos_in=None, zpos_out=None, output_dirname=None)

Function for image resampling in z (slices) direction

Parameters:
  • fnames (list of pathlib.Path, optional) – List of ‘.tif’ filenames to process

  • inds_partition (list of ints, optional) – List of indexes to be considered by the global var SHARED_ARRAY when working in multiprocessing

  • queue_incr (multiprocessing.Queue, optional) – Queue passed to the function to interact with the progress bar

  • policy (str, optional) – Policy to consider for .tif images with {slice_nb} and {z_coord} format parameters. Example : policy = ‘slice_{slice_nb}_z={z_coord}um.tif’

  • zpos_in (np.array(n), optional) – Original slice positions in z-direction

  • zpos_out (np.array(m), optional) – Slice positions of the final interpolated resampled image

  • output_dirname (str, optional) – Directory pathname for process results saving

pystack3d.resampling.plot(output_dirname)

Plot the specific data related to the current process

pystack3d.resampling.extract_z_from_filenames(fnames, policy, verbosity=False)

Return z coordinates from the filenames parsing

Parameters:
  • fnames (list of str) – List of images filenames to handle

  • policy (str) – Policy to consider for .tif images with {slice_nb} and {z_coord} format parameters. Example : policy = ‘slice_{slice_nb}_z={z_coord}um.tif’ parameters

  • verbosity (bool, optional) – Activation key for verbosity

Returns:

z_coords – List of z coordinates

Return type:

list of floats