Skip to content

Remove preserve_range kwarg (always preserve range by default)#6319

Draft
grlee77 wants to merge 19 commits intoscikit-image:mainfrom
grlee77:preserve_range-part1
Draft

Remove preserve_range kwarg (always preserve range by default)#6319
grlee77 wants to merge 19 commits intoscikit-image:mainfrom
grlee77:preserve_range-part1

Conversation

@grlee77
Copy link
Copy Markdown
Contributor

@grlee77 grlee77 commented Apr 5, 2022

Description

NOTE: the first commit here is #6318, so this will be easier to review after that one is merged

A subset of functions have a preserve_range keyword argument that controls whether or not images with integer dtypes get rescaled to a normalized range ([0, 1] for unsigned, [-1, 1] for signed). We have discussed removing this keyword for skimage2 and defaulting to not rescaling inputs except where necessary (see #5281 (comment), #5439). Another older discussion about defaulting to preserve_range=True: #1616 (comment)

In addition this PR removes internal rescaling via rescale_to_float in many places where it currently exists. This includes all of skimage.filters, skimage.restoration and skimage.transforms. However, there are a number of remaining cases still to address in follow-up PRs (primarily some of the cases in skimage.feature, skimage.color, skimage.exposure and skimage.segmentation as discussed in #3373 (comment)).

Checklist

  • Docstrings for all functions
  • Gallery example in ./doc/examples (new features only)
  • Benchmark in ./benchmarks, if your changes aren't covered by an
    existing benchmark
  • Unit tests
  • Clean style in the spirit of PEP8
  • Descriptive commit messages (see below)

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.
  • There is a bot to help automate backporting a PR to an older branch. For
    example, to backport to v0.19.x after merging, add the following in a PR
    comment: @meeseeksdev backport to v0.19.x
  • To run benchmarks on a PR, add the run-benchmark label. To rerun, the label
    can be removed and then added again. The benchmark output can be checked in
    the "Actions" tab.

grlee77 added 18 commits April 5, 2022 13:28
update docs and gallery to use rescale_to_*
now there is no rescaling of the data range for any of these functions

remove preserve_range option from non_local_means (always preserve
range)
remove rescale_as_float internal to difference_of_guassians

update use of gaussian in gallery examples

fix use of gaussian in binary_blobs

fix use of gaussian in skimage.feature

fix use of gaussian in active_contour_model
remove rescale_as_float from all edge filters
…cale_input utilities

keep default of normalization in a number of places where output is dependent on scale
specifically: corner_fast, structure_tensor, ORB, CENSURE
required applying normalization within the visualization code
this function is insensitive to absolute scale
@grlee77 grlee77 added the 📜 type: API Involves API change(s) label Apr 5, 2022
@grlee77 grlee77 added this to the skimage2 milestone Apr 5, 2022
@github-actions
Copy link
Copy Markdown

Hey, there hasn't been any activity on this pull request for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! Otherwise, we would be thankful for a short update, for example if you would like to continue or if you are okay with someone else doing so. In any case, thank you for your contributions so far!

@github-actions github-actions bot added the 😴 Dormant No recent activity label Dec 14, 2022
@stefanv stefanv added this to skimage2 Mar 1, 2025
@stefanv stefanv moved this to To Do in skimage2 Mar 1, 2025
@stefanv stefanv moved this from To Do to To Review in skimage2 Mar 1, 2025
@stefanv stefanv moved this from To Review to To Triage in skimage2 Mar 1, 2025
@lagru lagru removed this from skimage2 Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✋ Wait for skimage2 📜 type: API Involves API change(s) 😴 Dormant No recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants