Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: add optional channel_names argument to regionprops #5321

Open
VolkerH opened this issue Apr 7, 2021 · 3 comments
Open

proposal: add optional channel_names argument to regionprops #5321

VolkerH opened this issue Apr 7, 2021 · 3 comments

Comments

@VolkerH
Copy link
Contributor

VolkerH commented Apr 7, 2021

Description

I noticed that as of #5037 regionprops can measure intensity properties for multichannel images.
The resulting intensity properties are named with an appended -0 ,.... -n for a n+1 channel
image, e.g. mean_intensity-0, mean_intensity-1.

In practical applications the channel may have meaningful names, e.g. DAPI or GFP for fluorescence microscopy images.
My proposal is to add an optional argument channel_names to regionprops and regionprops_table.
If channel_names is None the behaviour should be unchanged, i.e. add an integer channel number.
If channel names is a Tuple or List of [str] of the same length as the number of channels, e.g. ("DAPI", "GFP") the appendices to the property name should be taken from that list, that is mean_intensity-DAPI, mean_intensity-GFP in the given example.

This would potentially have side effects for #5213

@VolkerH
Copy link
Contributor Author

VolkerH commented Apr 7, 2021

Oops ... after following the link to #5037 I realize that this isn't that trivia as I thoughtl because the numbering comes from the way that vector-valued features in regionprops are unrolled into regionprops_table.

@grlee77
Copy link
Contributor

grlee77 commented Apr 7, 2021

Thanks @VolkerH. I haven't inspected the implementation in terms of what refactoring may be required, but the idea seems reasonable to me.

@VolkerH
Copy link
Contributor Author

VolkerH commented Apr 8, 2021

looking into this a bit more, the new optional channel_names in regionprops and regionprops_table could be passed to _props_to_dict which would be the function in which the new functionality is added. A channel_names are then the default None would also flag that these are multidimensional intensity measurements.

@scikit-image scikit-image locked and limited conversation to collaborators Oct 18, 2021
@grlee77 grlee77 reopened this Feb 20, 2022
@scikit-image scikit-image unlocked this conversation Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants