How to use the cornerstone-wado-image-loader.wadors function in cornerstone-wado-image-loader

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

github OHIF / Viewers / platform / core / src / utils / updateMetaDataManager.js View on Github external
series.instances.forEach(instance => {
    const metaData = getWadoRsInstanceMetaData(study, series, instance);
    const numberOfFrames = instance.numberOfFrames || 1;

    // We can share the same metaData with all frames because it doesn't have
    // any frame specific data, such as frameNumber, pixelData, offset, etc.
    // WADO-RS frame number is 1-based
    for (let frameNumber = 0; frameNumber < numberOfFrames; frameNumber++) {
      const imageId = getWADORSImageId(instance, frameNumber);

      // TODO Make a metadata manager which uses study/series/instance UIDS instead of imageIds
      cornerstoneWADOImageLoader.wadors.metaDataManager.add(imageId, metaData);
    }
  });
}
github OHIF / ohif-core / src / utils / updateMetaDataManager.js View on Github external
instance.thumbnailRendering !== 'wadors'
      ) {
        return;
      }

      const metaData = getWadoRsInstanceMetaData(study, series, instance);
      const numberOfFrames = instance.numberOfFrames || 1;

      // We can share the same metaData with all frames because it doesn't have
      // any frame specific data, such as frameNumber, pixelData, offset, etc.
      // WADO-RS frame number is 1-based
      for (let frameNumber = 0; frameNumber < numberOfFrames; frameNumber++) {
        const imageId = getWADORSImageId(instance, frameNumber);

        // TODO Drop dependency on this
        cornerstoneWADOImageLoader.wadors.metaDataManager.add(
          imageId,
          metaData
        );
      }
    });
  });
github OHIF / react-vtkjs-viewport / examples / VTKVolumeRenderingExample.js View on Github external
const imageIds = instances.map(metaData => {
        const imageId =
          `wadors:` +
          baseUrl +
          '/studies/' +
          studyInstanceUID +
          '/series/' +
          metaData[SERIES_INSTANCE_UID].Value[0] +
          '/instances/' +
          metaData[SOP_INSTANCE_UID].Value[0] +
          '/frames/1';

        cornerstoneWADOImageLoader.wadors.metaDataManager.add(
          imageId,
          metaData
        );

        return imageId;
      });
github OHIF / react-vtkjs-viewport / examples / VTKFusionExample.js View on Github external
const imageIds = instances.map(instanceMetaData => {
    const seriesInstanceUID = instanceMetaData[SERIES_INSTANCE_UID].Value[0];
    const sopInstanceUID = instanceMetaData[SOP_INSTANCE_UID].Value[0];

    const imageId =
      `wadors:` +
      baseUrl +
      '/studies/' +
      studyInstanceUID +
      '/series/' +
      seriesInstanceUID +
      '/instances/' +
      sopInstanceUID +
      '/frames/1';

    cornerstoneWADOImageLoader.wadors.metaDataManager.add(
      imageId,
      instanceMetaData
    );

    if (
      seriesInstanceUID === ctSeriesInstanceUID ||
      seriesInstanceUID === petSeriesInstanceUID
    ) {
      instancesToRetrieve.push({
        studyInstanceUID,
        seriesInstanceUID,
        sopInstanceUID,
      });
    }

    return imageId;
github cornerstonejs / react-cornerstone-viewport / src / metadataProvider.js View on Github external
import cornerstone from 'cornerstone-core';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import dicomParser from 'dicom-parser';

const { getNumberValue, getValue } = cornerstoneWADOImageLoader.wadors.metaData;

function wadoRsMetaDataProvider(type, imageId) {
  const metaData = cornerstoneWADOImageLoader.wadors.metaDataManager.get(
    imageId
  );

  if (!metaData) {
    return;
  }

  if (
    metaData[type] !== undefined &&
    metaData[type].Value !== undefined &&
    metaData[type].Value.length
  ) {
    return metaData[type].Value[0];
github cornerstonejs / react-cornerstone-viewport / src / metadataProvider.js View on Github external
function wadoRsMetaDataProvider(type, imageId) {
  const metaData = cornerstoneWADOImageLoader.wadors.metaDataManager.get(
    imageId
  );

  if (!metaData) {
    return;
  }

  if (
    metaData[type] !== undefined &&
    metaData[type].Value !== undefined &&
    metaData[type].Value.length
  ) {
    return metaData[type].Value[0];
  }

  const typeCleaned = type.replace('x', '');

cornerstone-wado-image-loader

Cornerstone Image Loader for DICOM WADO-URI and WADO-RS

MIT
Latest version published 2 months ago

Package Health Score

81 / 100
Full package analysis