Check for Cycles

Check for cycles within a skeletonized image.


returns debugging cycle image

  • Parameters:
  • Context:
    • Identifies cycles in a skeleton image.
  • Output data stored: Data ('num_cycles') automatically gets stored to the Outputs class when this function is ran. These data can always get accessed during a workflow (example below). For more detail about data output see Summary of Output Observations

Reference Image


from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), 
# or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# The cycle_img created for debugging purposes allows for line thickness 
# adjustments with the global line thickness parameter. Try setting 
# pcv.params.line_thickness = 8 for thicker lines (default 5)
cycle_img = pcv.morphology.check_cycles(skel_img=skeleton)

# Access data stored out from check_cycles
num_cycles = pcv.outputs.observations['num_cycles']['value']