cornerstonejs / cornerstone

JavaScript library to display interactive medical images including but not limited to DICOM
https://docs.cornerstonejs.org/
MIT License
2.04k stars 598 forks source link

Update generateLut.js #573

Closed tapin13 closed 2 years ago

tapin13 commented 2 years ago

After issue on bug described in issue https://github.com/cornerstonejs/cornerstone/issues/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.ceil fix this problem.