apply_over_frames

sitelle.parallel.apply_over_frames(func2d, cube, *args, **kwargs)

Iterates over the z dimension of a cube to apply a function on each frame (i.e. 2D images)

Parameters:
  • func2d (callable) – This function should accept 2-D arrays. It is applied to 2-D slices (frames) of cube.
  • cube (3-D ndarray) – The data cube. Dimensions should be [x,y,z]. func2d will be applied along the z dimension
  • args – Additional arguments to be passed to func2d
  • kwargs – Additional keywords arguments to be passed to func2d
Returns:

out – The output array. The first 2 dimensions are identical to cube. the rest depends on what func2d returns; it it returns a vector, out will be 3-D.

Return type:

ndarray