Open bje43 opened 2 years ago
So right now the shaders in VTK.js only support Float32 and UInt8. We are working on enabling the use of Int16 and UInt16 in this PR here: https://github.com/Kitware/vtk-js/pull/2058
That's the main reason why we put these errors. I don't think we actually checked if it would work or not. It's just that we know it's slow to convert formats.
It's possible that if you just remove this if check and just try to use an Int8 ImageData, VTK may convert it to a Float32 before putting it into the shader anyway, but I've never tried.
@swederik how difficult would it be to add support for 8-bit images? Any chance you could help point me in the right direction?
https://github.com/OHIF/react-vtkjs-viewport/blob/0a3cb7932cb06275c2eb1497dfb2ba590860454b/src/lib/getImageData.js#L47