mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.52k stars 35.37k forks source link

Dicom image loader and extend function in nrrdloader #24481

Open LinkunGao opened 2 years ago

LinkunGao commented 2 years ago

Is your feature request related to a problem? Please describe.

I want to use threejs to load Dicom images. Yes, we can use some software to convert Dicom images into a NRRD image (like Itk) and use threejs nrrd loader to load it. But this way is not convenient.

And different software may export different data formats. e,g. ITK exports nrrd image format is 16-bits array.

Describe the solution you'd like

As for the Dicom loader, here is a dicom-parser, the (7FE0,0010) | OB or OW | Pixel Data stores dicom pixel data. Also, here describes all dicom tags info.

Describe alternatives you've considered

Additional context

  1. Using threejs to load a 2d dynamic image, like I use nrrd loader. the slice position can be modified by user or we can get one position all volume data, then we may use dataarraytexture to render it.
  2. A Dicom image loader.
Mugen87 commented 2 years ago

It's problematic to put to two feature requests into the same issue. I suggest we use this one to track the addition of DICOMLoader.

If someone wants to start with this task, it would be good if you could share an example image/data so it's possible to have something to test with.

LinkunGao commented 2 years ago

Thanks so much!

Here are some Dicom images (It's a Cardiac image, position z, I haven't provided the breast image, because that is a nrrd image. I will create a new issue with that one). They are 2d Dicom images. Every single image here is one different slice (it same as NRRD loader z position's index). It would be nice if can provide a parameter urls, so users can load all files at the same time. something like this:

  const urls = ["image1.dcm","image2.dcm","image3.dcm","image4.dcm",...]
  dicomloader.load(urls,...)

Dicom image is quite different to the NRRD image, one NRRD image contains three positions all slices of data information. However, a Dicom image contains only one slice of data for one position.

Also, it would be perfect after load Dicom images:

  1. if users can get each position all volume data
  2. or can redesign the slice position Then we can make the animation with these images. e,g. at different times render different slices, but they are in one position. Or they can share with one planegeometry, just change the render volume data depending on slice index.