webknossos-libs icon indicating copy to clipboard operation
webknossos-libs copied to clipboard

Auto-detect segmentation layers

Open fm3 opened this issue 4 years ago • 2 comments

When cubing datasets the user has to specify which layers are segmentation layers. It would be helpful to add a heuristic that auto-determines this. E.g. find patches of uniform color/id vs noisy images (which are probably raw data). It may be possible to run this heuristic only on a sampled subset of the data

fm3 avatar Jul 16 '21 09:07 fm3

A very cheap heuristic could be the following:

  • sample N bboxes à 4x4x4 pixel (ignore bounding boxes which are all zero)
  • per bbox, count the unique values
  • compare average unique values per bounding box against a threshold (for segmentation, I would assume the value of unique ids to be <= 2)

philippotto avatar Oct 13 '21 13:10 philippotto

Dataset.from_images currently has a cheap heuristic by checking if segmentation or labels is a substring in the relative path of the layer. A data-driven heuristic would be even better.

jstriebel avatar Nov 28 '22 08:11 jstriebel