Read different series of dicom

Hi everyone,
I’ve got an issue when loading some dicom files using itk-wasm, in the past I load the uploaded files through readImageDICOMFileSeries, it worked fine when there is just a single serie.
But some of the dicoms are mixed with different series, e.g. one series is a summary of 256 * 256 * 1 sized image with component 3 and othes have size of 800 * 800 * 1 with component 1, and the 256 * 256 one might be the first, the last or some other order to be imported. Here are some results for different imports and setups:
1. The image of 3 components is the first file to be imported, in this situation the error ReadImageDICOMFileSeries.umd.js:9 Only one pixel component is currently supported. Image pixel components: 3 will always show not matter singleSortedSeries param is true or false.
2. The image of 3 components is not the first and singleSortedSeries is set to false, in this situation the correct ct data will not be read, result will be only the 3 component one.
3. The image of 3 components is not the first and singleSortedSeries is set to true, in this situation the correct ct data can be read.

I can read the single file information with readImageFile, but since it’s not ordered, if I read it one by one, the error WebAssembly.instantiate(): Out of memory will show if files are big enough.

How should I handle this correctly to get the different series info? The source files are from different scan machines so the names of the files and the order can not be changed.


I’ve made a mistake that I didn’t pass the worker to next readImageFile call, when it is passed the out of memory situation will not present, the readImageFile can work properly.

Hi @Xoz ,

Welcome to the ITK community! :sun_with_face:

A note – the updated DICOM package is now at @itk-wasm/dicom.

The readDicomTags function can be used to help identify the different series.