InsightSoftwareConsortium / InsightSoftwareConsortium/ITK-Wasm

STATUS_ACCESS_VIOLATION: multiple call to readImageFile with the same webWorker

Open
#459 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
235
Forks
61
Avg merge
4d 19h
Merged PRs (30d)
4

Description

Hi everyone,

I try to read Dicom Series file by file in purpose to upload decoded pixels. I use the release 14.1.1 of itk-js (I don't use itk-wasm yet).

For this I tested different methods:
1. sequentially using a for loop and new webWorker at each call to readImageFile
2. sequentially using a for loop and using the same webWorker

The version 1 always works but is very slow (around 200s for a series of 853 slices).
The version 2 works is much faster (around 16s for a series of 853 slices) but for some series there is a crash of the browser (Chrome): STATUS_ACCESS_VIOLATION

```javascript
// Version 1
async function upload_for_loop_new_worker(slices_files, urls) {
console.log(urls);
let slice_number = 0;
for (const slice of slices_files) {
let image_result = await readImageFile(null, slice);
image_result.webWorker.terminate();
console.log('slice_number', slice_number)
slice_number += 1;
}
}

// Version 2
async function upload_for_loop(slices_files, urls) {
console.log(urls);
let slice_number = 0;
let webWorker = null;
for (const slice of slices_files) {
let image_result = await readImageFile(webWorker, slice);
webWorker = image_result.webWorker;
console.log('slice_number', slice_number)
slice_number += 1;
}
if (webWorker !== null) {
webWoker.terminate();
}
}
```

I don't understand why there is such an error for the second version for some kind of Series.
I suppose it's the pixelData encoding that change? Both series comes from GE CT scans.
The problematic one has Bits Stored and Bits Allocated to 32 bits meanwhile the other series has 16 bits (I'm not sure if I'm clear enough...)

Does anyone have seen this kind of issue?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.