haesleinhuepf / napari-skimage-regionprops

Feature extraction for labeled objects in images using regionprops from scikit-image
BSD 3-Clause "New" or "Revised" License
47 stars 13 forks source link

Taking layer scale into account for regionprops #83

Open K-Meech opened 9 months ago

K-Meech commented 9 months ago

Currently, the scale of Napari layers doesn't seem to be taken into account during the regionprops calculations. This means that e.g. areas aren't scaled by the given pixel size, and are just given in pixel units.

regionprops_table has a 'spacing' parameter which the layer .scale could be passed into: https://scikit-image.org/docs/stable/api/skimage.measure.html#skimage.measure.regionprops_table , which currently isn't used: https://github.com/haesleinhuepf/napari-skimage-regionprops/blob/e38cc72c25e1fe1c31cf31829c3e9cd53a839778/napari_skimage_regionprops/_regionprops.py#L116

Would it be possible to add this? Thanks!