Skip to content

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

Draft
grlee77 wants to merge 19 commits into
scikit-image:pre-megamove-integrationfrom
grlee77:preserve_range-part1
Draft

grlee77 wants to merge 19 commits into
scikit-image:pre-megamove-integrationfrom
grlee77:preserve_range-part1

Conversation

@grlee77

@grlee77 grlee77 commented Apr 5, 2022 •

Copy link
Copy Markdown
Contributor

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
@matthew-brett
matthew-brett changed the base branch from main to pre-megamove-integration June 19, 2026 15:23
@matthew-brett

Copy link
Copy Markdown
Contributor

We have changed the base branch for this PR from the main branch to the pre-megamove-integration branch.

Summary - what this means for your PR

You can continue to work on your PR, now based on pre-megamove-integration. You should update your branch to the current state of pre-megamove-integration (this is what the Github "Update branch" button does). Please do not merge the scikit-image main branch into your PR branch.

Once we've merged your PR into the pre-megamove-integration branch, we'll update your changes for Megamove, and merge into the main branch.

In addition - our automated script detected that your branch had merge conflicts with the pre-Megamove branch. Please make sure to merge in the pre-megamove-integration branch, and resolve the merge conflicts in the way that you want.

Read on for the Megamove rationale, and more detailed instructions.

Details

Rationale

We've changed the base branch to make it easier and smoother to continue to work on your PR, while we work through a rather large change in the directory structure of the repository - a change that we have called Megamove.

See the Megamove explanation issue for more detail.

Changing the base branch means you do not see merge conflicts related to the Megamove change, and can continue to work with the repository in its original state, without worrying about porting those changes across to the new post-Megamove structure.

As you'll see in the linked issue, you can continue to work on your PR as before, and you can continue to use the Github GUI to "Update branch" - this updates from the new pre-megamove-integration branch. However, there is one caveat: please, do not try and merge the scikit-image main branch into this one, but instead, keep track of the pre-megamove-integration branch. The issue explains more.

To emphasize again, do not try and merge the scikit-image main branch. You will get Megamove related merge conflicts that are rather tricky to resolve correctly.

When we've approved your PR, we'll merge into the pre-megamove-integration branch, and then process it so we can merge it into the main branch. We'll let you know when we've merged your PR changes into main.

Any questions, please reply here.

@stefanv stefanv added 🥾 Path to skimage2 A step towards the new "API 2.0" and removed ✋ Wait for skimage2 labels Nov 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🥾 Path to skimage2 A step towards the new "API 2.0" 📜 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