dystrack.pipelines.minimal_example#

A minimal example of a DySTrack image analysis pipeline that simply tracks the center of mass of intensity in the image. This is intended as a didactic example or as a starting point for customization; for actual center-of-mass tracking, we recommend using the more full-featured center-of-mass tracking pipeline.

dystrack.pipelines.minimal_example.analyze_image(target_path, channel=None, await_write=2, warn_8bit=True, verbose=False)#

A minimal example of a DySTrack image analysis pipeline function. Simply tracks the center of mass of intensity in the input image. This is intended as a didactic example or as a starting point for customization; for actual center-of-mass tracking, use dystrack.pipelines.center_of_mass, which provides more options.

Parameters:
  • target_path (path-like) – Path to the image file that is to be analyzed.

  • channel (int, optional, default None) – Index of channel to use for masking in case of multi-channel images. If not specified, a single-channel image is assumed.

  • await_write (int, optional, default 2) – Seconds to wait between each check of the target file size to determine if the file is still being written to. Reducing this will shave off latency but increases the risk of race conditions.

  • warn_8bit (bool, optional, default True) – Whether to emit a warning when a non-8bit image was found and was down- converted to 8bit using min-max rescaling.

  • verbose (bool, optional, default False) – If True, more information is printed.

Returns:

  • z_pos, y_pos, x_pos (floats) – New coordinates for the next acquisition. For 2D inputs, z_pos is 0.0.

  • img_msg (“OK”) – A string output message; required by DySTrack but here unused and just set to “OK”.

  • img_cache ({}) – A dictionary to be passed as keyword arguments to future calls to the pipeline; required by DySTrack but here unused and just set to {}.