Closed tostein closed 6 years ago
Hi Tobias,
How are you loading this image? With the WADO Image Loader we convert any float pixel data to integers and use that for rendering when the image is loaded:
The float pixel data remains, and is kept in the floatPixelData property: https://github.com/cornerstonejs/cornerstoneWADOImageLoader/blob/da4c03933b4b6f634c59614a6aa1a479980f2968/src/imageLoader/createImage.js#L132
So I am a bit surprised that the issues you mention above exist, unless you are using a custom image loader. In that case, it's probably easiest to do the same as what we are doing in the WADO Image Loader.
Thanks for your fast answer. Yes i am using a custom loader. I will considering using the WADO image loader instead.
@NussknackerXXL you could also just add the rescaling code to your custom loader.
Description: I was wondering if there is any support for floating point based image data (like a DICOM parametric map) to use a colormap.
Problem: Usage of colormaps within a image stack for floating point based image data leads to errors within
storedPixelDataToCanvasImageDataColorLUT.js
because index based array access requires integer values.Proposal: If there is no solution yet, one could find for a given floating point value the closest integers from existing lookup-tables and do a linear interpolation between the two colors.
Something like the following would fit into the named ImageDataColorLUT.js:
It must be checked that
typeof pixel.Data == Float32Array
For now i am rounding my values to integers and use the lookup tables. But that should be better shouldn't it?
@pieper