Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: memory access out of bounds #1312

Open
jinjilynn opened this issue Jan 24, 2025 · 4 comments
Open

RuntimeError: memory access out of bounds #1312

jinjilynn opened this issue Jan 24, 2025 · 4 comments

Comments

@jinjilynn
Copy link

Image

those dicoms might be too large?

@thewtex
Copy link
Member

thewtex commented Jan 24, 2025

It is possible that this may be a memory usage issue. More information is required.

@jinjilynn
Copy link
Author

jinjilynn commented Jan 25, 2025

It is possible that this may be a memory usage issue. More information is required.

Image Image Image
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?

@jadh4v
Copy link
Member

jadh4v commented Jan 25, 2025

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.

@jinjilynn
Copy link
Author

jinjilynn commented Jan 26, 2025

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants