InsightSoftwareConsortium / ITK-Wasm

High performance spatial analysis in a web browser and across programming languages and hardware architectures
https://wasm.itk.org
Apache License 2.0
195 stars 48 forks source link

get canvas imageData after reading the file using ITK.js #240

Open truongleit opened 5 years ago

truongleit commented 5 years ago

Hi, I am using ITK.js to read input DICOM slices. The main reason why I am using ITK is itkImage contains some useful information of slice for my next visualizing steps, such as origin, spacing, etc., instead of using other JavaScript libaries to get these tags, so it's kind of time-consuming. Is it possible to convert itkImage to original canvas imageData after taking all the necessary tags into an array? Since I need the original imageData for my next steps.

thewtex commented 5 years ago

It is possible to convert to a canvas imageData by using itkImage.data, with caveats:

So, it helps to use vtk.js, for example, for rendering to help with these issues.