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

Allow parametric images from tables with BG measurements #66

Closed zoccoler closed 1 year ago

zoccoler commented 1 year ago

Insert 0 to measurements only if background measurements are absent in tables.

This should fix #65

zoccoler commented 1 year ago

One of the tests if failing now, I am checking it.

haesleinhuepf commented 1 year ago

Hi Marcelo,

if we're sure that it works again, I'm happy to merge it. Afterwards, we should work on the next step, replacing our mapping-method as discussed in #48 . I would love to hear your opinion about how to do it exactly. My only concern is backwards-compatibility. Quite some other plugins use the functions we have here. Thus, we cannot modify behaviour. We can only extend it and deprecate old stuff.

Thanks!

Best, Robert

zoccoler commented 1 year ago

Hi Robert @haesleinhuepf ,

Totally agree. This should work now. I am still using numpy.take and not putting 0 if there is already a label 0 in the table with some value.

About replacing it by map_array, I will give it a quick try and do some benchmarking, but it looks pretty similar to me. Is the only benefit of that having the possibility of non-sequential labels? Also, should we keep cle.replace_intensities?

zoccoler commented 1 year ago

Tests are working locally, not sure why yet they are failing here.

zoccoler commented 1 year ago

I found the problem. In the timelapse tests, the label images have label values up to 4, but numpy.take works with indices. So, since we have 4 measurements from these 4 labels (max index is 3), this throws an error. It surprises me that this error did not show up before.

zoccoler commented 1 year ago

This won't merge, please refer for #67 for an extension of this.