Skip to content

ROI threshold should be rescaled regardless of sign#280

Open
jonclayden wants to merge 1 commit intovistalab:masterfrom
jonclayden:roi-threshold-rescale
Open

ROI threshold should be rescaled regardless of sign#280
jonclayden wants to merge 1 commit intovistalab:masterfrom
jonclayden:roi-threshold-rescale

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