- 
                Notifications
    
You must be signed in to change notification settings  - Fork 55
 
Closed
Description
hi, i want to read a dicom with data compressed as jpeg. i find the daikon.js, and use it to get uncompress dicom image, but then, how to use itk-js to read the image, because i use vtk.js too, i know vtk.js depend on itk.js to read such as image, dicom etc.
main code logic is below:
import itkreadImageDICOMFileSeries from 'itk/readImageDICOMFileSeries';
import vtkHttpDataAccessHelper from 'vtk.js/Sources/IO/Core/DataAccessHelper/HttpDataAccessHelper';
vtkHttpDataAccessHelper.fetchBinary(url).then((arrayBuffer) => {
    const image = daikon.Series.parseImage(new DataView(arrayBuffer));
    if (image === null) {
        console.error(daikon.Series.parserError);
    }
    const rawData = image.getRawData(); // ArrayBuffer
    const filename = `test.dcm`;
    const file = new File([rawData], filename);
    itkreadImageDICOMFileSeries(null, [file])
        .then(({ image: itkImage, webWorker }) => {
            // code not exec here
            // get a Error: Could not read file: /work/test.dcm
        })
})update:
because the raw image data have got, i think i have to create a Image instance, but need a correct ImageType.
but i don't know how to determine the componentType componets and other input args of constructor ImageType.
thanks for your suggestions!
awwabi and subdavis
Metadata
Metadata
Assignees
Labels
No labels