I would argue that the most common use case for regionprops is to measure the properties of a sequentially labelled image, starting from 0 (if there's a background) or 1 (if not). Currently, in both of these cases, regionprops returns a list where result[i] contains the region properties for label i+1.
In the case of nonsequential labels, this is even more confusing, because result[i] contains the region properties for the ith nonzero label, which could be anything.
I suggest one of the following:
- change the API to return a dictionary of label: regionprops.
- add a keyword argument to the API to return said dictionary.
- add a regionprops_dict function to the API to return this.
Any opinions on this?
I would argue that the most common use case for regionprops is to measure the properties of a sequentially labelled image, starting from 0 (if there's a background) or 1 (if not). Currently, in both of these cases, regionprops returns a list where result[i] contains the region properties for label i+1.
In the case of nonsequential labels, this is even more confusing, because result[i] contains the region properties for the ith nonzero label, which could be anything.
I suggest one of the following:
Any opinions on this?