Skip to content

Conversation

tapin13
Copy link

@tapin13 tapin13 commented Dec 20, 2021

After issue on bug described in issue #559

On Ipad, Mac (Chrome, FF)
After function vlutfn(mlutfn(storedValue)) we got result like 0.99609375 or 1.9921875. Result must be int (variable lut is Uint8ClampedArray). Most of time we got round 0.99609375 to 1 and 1.9921875 to 2. But sometimes we got 0.99609375 to 0 and 1.9921875 to 1.
Math.round fix this problem.

On Ipad, Mac (Chrome, FF)
After function vlutfn(mlutfn(storedValue)) we got result like 0.99609375 or 1.9921875. Result must be int (variable lut is Uint8ClampedArray). Most of time we got round 0.99609375 to 1 and 1.9921875 to 2. But sometimes we got 0.99609375 to 0 and 1.9921875 to 1.
Math.round fix this problem.
@swederik
Copy link
Member

My issue with this is that generateLUT is called very often (every time window/level is changed, for example), and so if this rounding operation is not necessary it may hurt performance.

What kind of VOI LUTs are you using that is causing this issue? Can you post the VOI LUT and Modality LUTs that are causing this?

@tapin13
Copy link
Author

tapin13 commented Dec 21, 2021

VOI LUT and Modality LUTs I send undefined.
So it use function generateLinearVOILUT.

About performance, anyway function return float. So js engine make implicit cast to int.

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.

2 participants