RuntimeError: memory access out of bounds
those dicoms might be too large?
It is possible that this may be a memory usage issue. More information is required.
It is possible that this may be a memory usage issue. More information is required.
async function renderDicomFileSeries(files) {
const { outputImage, webWorkerPool, sortedFilenames } =
await readImageDicomFileSeries({
webWorkerPool: null,
inputImages: files,
singleSortedSeries: false,
});
console.log(outputImage);
webWorkerPool.terminateWorkers();
const vtkImage = vtkITKHelper.convertItkToVtkImage(outputImage);
console.log(vtkImage);
mapper.setInputData(vtkImage);
renderer.addVolume(actor);
renderer.resetCamera();
renderWindow.render();
}
My DICOM files total 1,963 images, each with a size of 529KB. I tested it, and if I select more than 746 images from these DICOM files, no errors occur. So, does this mean that itk-wasm can handle up to a round maximum of 1GB of DICOM files?
What are the dimensions of the image x, y, z that you are trying to read? You might be exceeding the max length limit for a JS TypedArray.
As I remember, a single javascript TypedArray or ArrayBuffer cannot be larger than around 2^31.
What are the dimensions of the image x, y, z that you are trying to read? You might be exceeding the max length limit for a JS
TypedArray. As I remember, a single javascript TypedArray or ArrayBuffer cannot be larger than around2^31.
you are supposed to be right, i have tried, when TypedArray got length of more than 2^27 + 61603840 , it would crash. The maximum length of an ArrayBuffer is limited by a 32-bit integer index
I encountered this issue, too. Any solutions?
I found another possible cause: if the file names are long, the error is more likely to occur.
In my test case, I loaded 1,840 DICOM files in VolView, each with a filename 40 characters long (something like "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.dcm"), and the error occurred:
However, with the same files, if I shorten the filenames to something like "file-1.dcm", "file-2.dcm", etc., they load without issue.