Detect DICOM series inside client's folder from vtk.js running on browser

Hi Everyone,
I’m trying to develop a browser side js that can read a folder (chosen by the user) and detect/regroup all the dicom series in it. Is it possible in vtk.js? I know that in standard vtk library this could be achieved using vtkDICOMDirectory, while this function is missing in vtk.js.

Thanks in advance, any help would be appreciated.

Hi, you can use itk.js to read in the DICOM into vtk.js. Check out the itk.js documentation to get more info on what you want to achieve.

1 Like

Thank you!
Do you also know if using itk.js/vtk.js i could achieve anonymization/deidentification?

You could have a look at this project:

1 Like

Though your question is different, but if you want to load and perse dicom images

async function handleFile(event) {
    const files = event.target.files;
    const { image, webWorker } = await window.itk.readImageDICOMFileSeries(files, false);
    webWorker.terminate();
    const vtkImage = vtkITKHelper.convertItkToVtkImage(image);
}

const dicomFileInput = document.getElementById('dicomFileInput');
dicomFileInput.addEventListener('change', handleFile);

make sure to import ITKHelper as below and also itk-wasm
import vtkITKHelper from '@kitware/vtk.js/Common/DataModel/ITKHelper';