Skip to content

Commit ee18b90

Browse files
authored
Merge pull request #1418 from ruanwenfeng/patch-inputs-order
fix(dicom): image reading error when singleSortedSeries is true
2 parents 83b5a82 + 55baabe commit ee18b90

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/dicom/typescript/src/read-image-dicom-file-series.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,17 @@ async function readImageDicomFileSeries(
2727
workerPool = new WorkerPool(numberOfWorkers, readImageDicomFileSeriesWorkerFunction)
2828
}
2929

30-
const inputs: Array<BinaryFile> = [
31-
]
3230
if(options.inputImages.length < 1) {
3331
throw new Error('"input-images" option must have a length > 1')
3432
}
3533

36-
await Promise.all(options.inputImages.map(async (value) => {
34+
const inputs: Array<BinaryFile> = await Promise.all(options.inputImages.map(async (value) => {
3735
let valueFile = value
3836
if (value instanceof File) {
3937
const valueBuffer = await value.arrayBuffer()
4038
valueFile = { path: value.name, data: new Uint8Array(valueBuffer) }
4139
}
42-
inputs.push(valueFile as BinaryFile)
40+
return valueFile as BinaryFile
4341
}))
4442

4543
if (options.singleSortedSeries) {

0 commit comments

Comments
 (0)