fractal-analytics-platform / fractal-tasks-core

Main tasks for the Fractal analytics platform
https://fractal-analytics-platform.github.io/fractal-tasks-core/
BSD 3-Clause "New" or "Revised" License
14 stars 6 forks source link

[napari-workflows] Fix regionprops warning #183

Open tcompa opened 1 year ago

tcompa commented 1 year ago

While running tests within #167 (see for instance https://github.com/fractal-analytics-platform/fractal-tasks-core/actions/runs/3394321877/jobs/5642784994), we have warnings like

tests/test_workflows_napari_workflows.py::test_relabeling[wf_relab_3-labeling_and_measurement.yaml-input_specs0-output_specs0-False]
  /home/tommaso/miniconda3/envs/fractal/lib/python3.8/site-packages/skimage/measure/_regionprops.py:395: UserWarning: Failed to get convex hull image. Returning empty image, see error message below:
  QH6013 qhull input error: input is less than 3-dimensional since all points have the same x coordinate    0

  While executing:  | qhull i Qt
  Options selected for Qhull 2019.1.r 2019/06/21:
    run-id 52955235  incidence  Qtriangulate  _pre-merge  _zero-centrum
    _max-width 13  Error-roundoff 1.8e-14  _one-merge 1.3e-13
    _near-inside 6.3e-13  Visible-distance 3.6e-14  U-max-coplanar 3.6e-14
    Width-outside 7.2e-14  _wide-facet 2.2e-13  _maxoutside 1.4e-13

    return convex_hull_image(self.image)
jluethi commented 1 year ago

Hmm, do you have the resulting dataframe output? I'd expect such warnings will result in some NaN measurements (which is the typical behavior of the measurement libraries when a measurement fails for some objects).

Would be nice if there is a way that the user can look at such warnings, but it's not critical information we need to highlight or something that should make us fail a workflow. If a user defines a workflow that results in many NaNs, then they may want to change their workflow (=> check relevant logs to understand what happened or just test their workflow better) or they may just choose to ignore measurements with many NaNs.