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

ROI threshold should be rescaled regardless of sign #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonclayden
Copy link

When creating an ROI by masking an image, the user is prompted for upper and lower thresholds. If either of these are negative, the code rescales them to match the image data. However:

  • The rescaling looks incorrect to me. If the image has a value range of -5 to 5 and the user specifies bounds of -5 and 0, taking the absolute value (as performed currently) will result in rescaled bounds of [1,0.5], rather than [0,0.5].
  • It seems to me that the rescaling needs to be performed regardless of sign. Otherwise bounds of 2 and 5 will not be rescaled, while the image is mapped from [-5,5] to [0,1], resulting in nothing.

This small PR fixes both of those issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant