How to use the itk/readImageDICOMFileSeries function in itk

To help you get started, we’ve selected a few itk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github InsightSoftwareConsortium / itk-js / examples / Dicom / src / index.js View on Github external
setupDicomForm(patientDict, async (files) => {
    outputTextArea.textContent = "Loading..."

    // Read DICOM serie
    const { image, webWorker } = await readImageDICOMFileSeries(null, files)
    webWorker.terminate()

    // Display
    function replacer (key, value) {
      if (!!value && value.byteLength !== undefined) {
        return String(value.slice(0, 6)) + '...'
      }
      return value
    }
    outputTextArea.textContent = JSON.stringify(image, replacer, 4)
  })
})
github Kitware / paraview-glance / externals / ITKReader / ITKDicomImageReader.js View on Github external
publicAPI.readFileSeries = (files) => {
    if (!files || !files.length || files === model.files) {
      return Promise.resolve();
    }

    model.files = files;

    return readImageDICOMFileSeries(null, files)
      .then(({ webWorker, image }) => {
        webWorker.terminate();
        return image;
      })
      .then((itkImage) => {
        const imageData = convertItkToVtkImage(itkImage, {
          scalarArrayName: model.arrayName || getArrayName(model.fileName),
        });
        model.output[0] = imageData;

        publicAPI.modified();
      });
  };