Projection along Z — epitools.analysis.projection#

This module contains functions to project 4D (TZYX) and 3D (ZYX) images along the z-dimension.

epitools.analysis.projection.calculate_projection(input_image, smoothing_radius, surface_smoothness, cut_off_distance, input_image_2=None)#

Z projection using image interpolation.

Perform an iterative projection of 3D points along the z axis.

An initial projection is performed to obtain the ‘first estimated surface’. Points furtherthan cut_off_distance from the first estimated surface will be ignored in the second projection step. This reduces noise from point that are far from the projected plane.

Parameters
  • input_image (numpy.ndarray[Any, numpy.dtype[numpy.float64]]) – Numpy ndarray representation of 4D or 3D image stack. input_image is assumed to have dimensions that correspond to TZYX or ZYX if it is 4D or 3D, respectively.

  • smoothing_radius (float) – Kernel radius for gaussian blur to apply before estimating the surface.

  • surface_smoothness (list[int]) – Surface smoothness for 1st and 2nd griddata estimation. Larger values will produce greater smoothing.

  • cut_off_distance (int) – Cutoff distance in z-planes from the first estimated surface.

  • input_image_2 (Optional[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]) – if a second image is passed as argument the function will project a 2 channel image based on a reference channel (assumed to be the first image) Numpy ndarray representation of 4D or 3D image stack. input_image is assumed to have dimensions that correspond to TZYX or ZYX if it is 4D or 3D, respectively.

Returns

np.NDArray

Timeseries of the image stack projected onto a single plane in z. The returned data will always be 4D - if the original data was 3D then there will be a single time slice and a single z slice.

Return type

tuple[numpy.ndarray[Any, numpy.dtype[numpy.float64]], Optional[numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]