cows.gen_catalogue

cows.gen_catalogue(data, periodic=False, sort=True)[source]

Generate a catalogue of filaments

Generates a catalogue of filaments given an array containing a cleaned and separated skeleton.

Parameters:
  • data (ndarray, 3D) – An array containing the separated skeleton. Zeros represent background, ones are endpoints and, twos are regular cells.

  • periodic (bool) – If True, the skeletonization uses periodic boundary conditions for the input array. Input array must be 3D.

  • sort (boolean) – If sort=True, the filaments are sorted by filament length in descending order and reassigned IDs such that the longest filament has an ID of zero.

Returns:

  • result (ndarray, 3D) – An array with data.shape containing the sets of connected cells with their respective ID.

  • catalogue (ndarray, 2D) – A catalogue containing, for each cell, a row of filament ID, filament length, X-, Y-, Z-position, X-, Y-, Z-direction.

Notes

The function assumes that values larger than zero are part of the skeleton.

Filament length is defined here as the number of member cells.