How to use dicomweb-client - 10 common examples

To help you get started, we’ve selected a few dicomweb-client 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 OHIF / ohif-core / src / studies / services / wado / retrieveMetadata.js View on Github external
const numLutEntries = lutDescriptor[0];
  const bits = lutDescriptor[2];

  let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server);

  // TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
  // incorrect bulk data URIs
  if (server.wadoRoot.indexOf('https') === 0 && !uri.includes('https')) {
    uri = uri.replace('http', 'https');
  }

  const config = {
    url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
    headers: DICOMWeb.getAuthorizationHeader(server),
  };
  const dicomWeb = new api.DICOMwebClient(config);
  const options = {
    BulkDataURI: uri,
  };

  const readUInt16 = (byteArray, position) => {
    return byteArray[position] + byteArray[position + 1] * 256;
  };

  const arrayBufferToPaletteColorLUT = result => {
    const arraybuffer = result[0]
    const byteArray = new Uint8Array(arraybuffer)
    const lut = []

    for (let i = 0; i < numLutEntries; i++) {
      if (bits === 16) {
        lut[i] = readUInt16(byteArray, i * 2);
github OHIF / Viewers / src / googleCloud / api / DicomUploadService.js View on Github external
getClient(url) {
    const headers = this.retrieveAuthHeaderFunc();

    // TODO: a bit weird we are creating a new dicomweb client instance for every upload
    return new api.DICOMwebClient({
      url,
      headers
    });
  }
}
github OHIF / Viewers / platform / core / src / studies / services / wado / retrieveMetadata.js View on Github external
const numLutEntries = lutDescriptor[0];
  const bits = lutDescriptor[2];

  let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server);

  // TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
  // incorrect bulk data URIs
  if (server.wadoRoot.indexOf('https') === 0 && !uri.includes('https')) {
    uri = uri.replace('http', 'https');
  }

  const config = {
    url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
    headers: DICOMWeb.getAuthorizationHeader(server),
  };
  const dicomWeb = new api.DICOMwebClient(config);
  const options = {
    BulkDataURI: uri,
  };

  const readUInt16 = (byteArray, position) => {
    return byteArray[position] + byteArray[position + 1] * 256;
  };

  const arrayBufferToPaletteColorLUT = result => {
    const arraybuffer = result[0];
    const byteArray = new Uint8Array(arraybuffer);
    const lut = [];

    for (let i = 0; i < numLutEntries; i++) {
      if (bits === 16) {
        lut[i] = readUInt16(byteArray, i * 2);
github OHIF / Viewers / Packages / ohif-studies / imports / both / services / qido / instances.js View on Github external
OHIF.studies.services.QIDO.Instances = function(server, studyInstanceUid) {
    // TODO: Are we using this function anywhere?? Can we remove it?

    const config = {
        url: server.qidoRoot,
        headers: OHIF.DICOMWeb.getAuthorizationHeader()
    };
    const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
    const queryParams = getQIDOQueryParams(filter, server.qidoSupportsIncludeField);
    const options = {
        studyInstanceUID: studyInstanceUid
    };

    return dicomWeb.searchForInstances(options).then(result => {
        return {
            wadoUriRoot: server.wadoUriRoot,
            studyInstanceUid: studyInstanceUid,
            seriesList: resultDataToStudyMetadata(server, studyInstanceUid, result.data)
        };
    });
};
github OHIF / Viewers / Packages / ohif-studies / imports / both / services / wado / retrieveMetadata.js View on Github external
const bits = lutDescriptor[2];

    let uri = WADOProxy.convertURL(instance[tag].BulkDataURI, server)

    // TODO: Workaround for dcm4chee behind SSL-terminating proxy returning
    // incorrect bulk data URIs
    if (server.wadoRoot.indexOf('https') === 0 &&
        !uri.includes('https')) {
        uri = uri.replace('http', 'https');
    }

    const config = {
        url: server.wadoRoot, //BulkDataURI is absolute, so this isn't used
        headers: OHIF.DICOMWeb.getAuthorizationHeader()
    };
    const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
    const options = {
        BulkDataURI: uri
    };

    const readUInt16 = (byteArray, position) => {
        return byteArray[position] + (byteArray[position + 1] * 256);
    }

    const arrayBufferToPaletteColorLUT = (arraybuffer) =>{
        const byteArray = new Uint8Array(arraybuffer);
        const lut = [];

        for (let i = 0; i < numLutEntries; i++) {
            if (bits === 16) {
                lut[i] = readUInt16(byteArray, i * 2);
            } else {
github OHIF / Viewers / Packages / ohif-core / client / services / qido / instances.js View on Github external
export default function Instances(server, studyInstanceUid) {
    // TODO: Are we using this function anywhere?? Can we remove it?

    const config = {
        url: server.qidoRoot,
        headers: OHIF.DICOMWeb.getAuthorizationHeader()
    };
    const dicomWeb = new DICOMwebClient.api.DICOMwebClient(config);
    const queryParams = getQIDOQueryParams(filter, server.qidoSupportsIncludeField);
    const options = {
        studyInstanceUID: studyInstanceUid
    };

    return dicomWeb.searchForInstances(options).then(result => {
        return {
            wadoUriRoot: server.wadoUriRoot,
            studyInstanceUid: studyInstanceUid,
            seriesList: resultDataToStudyMetadata(server, studyInstanceUid, result.data)
        };
    });
};
github dcmjs-org / dicom-microscopy-viewer / src / api.js View on Github external
const tileLoadFunction = (tile, src) => {
      if (src !== null) {
        const studyInstanceUID = DICOMwebClient.utils.getStudyInstanceUIDFromUri(src);
        const seriesInstanceUID = DICOMwebClient.utils.getSeriesInstanceUIDFromUri(src);
        const sopInstanceUID = DICOMwebClient.utils.getSOPInstanceUIDFromUri(src);
        const frameNumbers = DICOMwebClient.utils.getFrameNumbersFromUri(src);
        const img = tile.getImage();
        if (options.retrieveRendered) {
          const mediaType = 'image/png';
          const retrieveOptions = {
            studyInstanceUID,
            seriesInstanceUID,
            sopInstanceUID,
            frameNumbers,
            mediaTypes: [{ mediaType }]
          };
          options.client.retrieveInstanceFramesRendered(retrieveOptions).then((renderedFrame) => {
            const blob = new Blob([renderedFrame], {type: mediaType});
            img.src = window.URL.createObjectURL(blob);
          });
        } else {
          // TODO: support "image/jp2" and "image/jls"
github OHIF / Viewers / platform / core / src / studies / services / wado / retrieveMetadataLoaderAsync.js View on Github external
configLoad() {
    const { server } = this;

    const client = new api.DICOMwebClient({
      url: server.qidoRoot,
      headers: DICOMWeb.getAuthorizationHeader(server),
    });

    this.client = client;
  }
  async preLoad() {
github OHIF / react-vtkjs-viewport / examples / VTKCrosshairsExample.js View on Github external
function createStudyImageIds(baseUrl, studySearchOptions) {
  const SOP_INSTANCE_UID = '00080018';
  const SERIES_INSTANCE_UID = '0020000E';

  const client = new dicomwebClientApi.DICOMwebClient({ url });

  return new Promise((resolve, reject) => {
    client.retrieveStudyMetadata(studySearchOptions).then(instances => {
      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(
github OHIF / Viewers / platform / core / src / studies / services / wado / retrieveMetadata.js View on Github external
async function searchStudySeries(server, studyInstanceUID) {
  const dicomWeb = new api.DICOMwebClient({
    url: server.qidoRoot,
    headers: DICOMWeb.getAuthorizationHeader(server),
  });
  const seriesList = await dicomWeb.searchForSeries({ studyInstanceUID });
  return seriesList
    .sort(seriesSortingCriteria)
    .map(series => getSeriesInfo(series).seriesInstanceUid);
}

dicomweb-client

Implementation of DICOMweb client code

MIT
Latest version published 11 months ago

Package Health Score

75 / 100
Full package analysis