skan.pipe:: Pipeline functions for skeleton analysis#

skan.pipe.process_images(filenames, image_format, threshold_radius, smooth_radius, brightness_offset, scale_metadata_path, crop_radius=0, smooth_method='Gaussian', num_threads=4)[source]#

Full pipeline from images to skeleton stats with local median threshold.

Parameters:
  • filenames (list of string) – The list of input filenames.

  • image_format (string) – The format of the files. β€˜auto’ is automatically determined by the imageio library. See imageio documentation for valid image formats.

  • threshold_radius (float) – The radius for median thresholding,

  • smooth_radius (float in [0, 1]) – The value of sigma with which to Gaussian-smooth the image, relative to `threshold_radius`.

  • brightness_offset (float) – The standard brightness value with which to threshold is the local median, m(x, y). Use this value to offset from there: the threshold used will be m(x, y) + brightness_offset.

  • scale_metadata_path (string) – The path in the image dictionary to find the metadata on pixel scale, separated by forward slashes (β€˜/’).

  • crop_radius (int, optional) – Crop crop_radius pixels from each margin of the image before processing.

  • smooth_method ({'Gaussian', 'TV', 'NL'}, optional) – Which method to use for smoothing.

  • num_threads (int, optional) – How many threads to use for computation. This should generally be set to the number of CPU cores available to you.

Returns:

results – The pipeline yields individual image results in the form of a tuple of (filename, image, thresholded_image, skeleton, data_frame). Finally, after all the images have been processed, the pipeline yields a DataFrame containing all the collated branch-level results.

Return type:

generator