Further document use of regionprops function and fix terms.#7518
Further document use of regionprops function and fix terms.#7518jni merged 15 commits intoscikit-image:mainfrom
Conversation
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
skimage/measure/_regionprops.py
Outdated
| The table is "tidy" [1]_; it is a dictionary mapping property names to | ||
| value arrays. See Notes section below for details. |
There was a problem hiding this comment.
I would say:
The return value is a dictionary mapping property names to value arrays. This dictionary can be used as input to
pandas.DataFrameto result in a "tidy" [1]_ table with one region per row and one property per column.
My mistake, $ ack ": ndarray" | wc -l
602
$ ack ": array" | wc -l
254I'll revert my changes from "ndarray" to "array" then! |
Co-authored-by: Juan Nunez-Iglesias <[email protected]>
Co-authored-by: Juan Nunez-Iglesias <[email protected]>
Co-authored-by: Juan Nunez-Iglesias <[email protected]>
| The return value is a dictionary mapping property names to value arrays. | ||
| This dictionary can be used as input to ``pandas.DataFrame`` to result in | ||
| a "tidy" [1]_ table with one region per row and one property per column. |
There was a problem hiding this comment.
This seems a bit redundant with the description in "Returns", no? Since the first line already implies pandas I'd remove this section in favor of highlighting the rest of the docstring.
| The return value is a dictionary mapping property names to value arrays. | |
| This dictionary can be used as input to ``pandas.DataFrame`` to result in | |
| a "tidy" [1]_ table with one region per row and one property per column. |
There was a problem hiding this comment.
I agree it's slightly redundant... Would you mind if I replaced "a pandas-compatible table" by "tabular data" in the first line?
There was a problem hiding this comment.
I'd like the tidy reference to remain somewhere. It's not present in the Return section currently.
There was a problem hiding this comment.
I didn't mean that this is verbatim included in returns. But I thought addressing this aspect in detail would make more sense in the return section where Pandas' DataFrame is already referenced.
| columns; for example, the region centroids of a 3D image end up in three | ||
| different columns, one per dimension. If you need to do complex | ||
| computations with the region properties, using | ||
| :func:`skimage.measure.regionprops` might be more fitting. |
There was a problem hiding this comment.
This could also go into the "Notes" section but since it's very useful context I'm totally fine with keeping it here. :) Nice improvement!
lagru
left a comment
There was a problem hiding this comment.
Lot's of opportunity for bikeshedding here. 😅 Knowing that, I made a few suggestions on a take it or leave it basis.
The added paragraphs are very nice, the rest doesn't seem like a big game changer to me but I'm fine with it. :)
On second thoughts, probably should give Juan time to chime in as well.
Co-authored-by: Lars Grüter <[email protected]>
Co-authored-by: Juan Nunez-Iglesias <[email protected]>
| spacing=None, | ||
| ): | ||
| """Compute image properties and return them as a pandas-compatible table. | ||
| """Compute region properties and return them as a pandas-compatible table. |
There was a problem hiding this comment.
| """Compute region properties and return them as a pandas-compatible table. | |
| """Compute region properties and return them as tabular data. |
* origin/main: Deprecate estimate method in favor of class constructor (scikit-image#7771) Temporary fix for Visual Studio & Clang incompatibility in Windows image (scikit-image#7835) Address deprecations in Pillow 11.3 (scikit-image#7828) Remove unused & obsolete `legacy_datasets`, `legacy_registry` vars (scikit-image#7677) Draft migration guide for skimage2 (scikit-image#7785) Do not report failure in wheels sub-recipe (scikit-image#7806) Use consistent wording in property description. (scikit-image#7804) Add intensity_median to regionprops (scikit-image#7745) CI: Update pypa/gh-action-pypi-publish to v1.12.4 for attestations on PyPI (scikit-image#7793) Document output dtype for transform.resize. (scikit-image#7792) Use `cibuildwheel` to build WASM/Pyodide wheels for `scikit-image`, push nightlies to Anaconda.org (scikit-image#7440) DOC: Include missing gain parameter in adjust_gamma equation (scikit-image#7763) Temporarily pin to `pyodide-build==0.30.0`, and ensure that the correct xbuildenvs are used (scikit-image#7788) Deprecate old names & attributes in RegionProperties (scikit-image#7778) Pin JasonEtco/create-an-issue action to SHA for v2.9.2 (scikit-image#7787) Make doctest-plus work with spin (scikit-image#7786) Report failures on main via issue (scikit-image#7752) Use `workers` instead of alternate parameter names (scikit-image#7302) Fix f-string in otsu plot (scikit-image#7780) Further document use of regionprops function and fix terms. (scikit-image#7518)
Description
The main addition here is b0cbf30 + 7617fbd.
Along the way, I proofread the entire docstring. I'm not entirely sure I should have replaced type
ndarraywitharraybut I have a vague memory along these lines with @grlee77 ...I'm pretty confident about all the other changes. @lagru I updated the imports under Examples.
@stefanv I used the term "label image" consistently and according to the conversation we had on Monday.
I made sure regions were referred to as "regions" or "image regions" throughout the text.
For the record, since I cannot apply a second label: I created this PR during the EuroSciPy 2024 sprint following a discussion with @lagru and @stefanv! 🚀
Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.