How to use the dicomweb-client.api.DICOMwebClient function in dicomweb-client

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 / 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);
}
github OHIF / react-vtkjs-viewport / examples / VTKFusionExample.js View on Github external
async function createStudyImageIds(baseUrl, studySearchOptions) {
  const SOP_INSTANCE_UID = '00080018';
  const SERIES_INSTANCE_UID = '0020000E';

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

  const instances = await client.retrieveStudyMetadata(studySearchOptions);

  const instancesToRetrieve = [];

  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 +
github OHIF / Viewers / platform / viewer / src / lib / DICOMSR / handleStructuredReport.js View on Github external
ImplementationVersionName: VERSION_NAME,
  };

  const denaturalized = DicomMetaDictionary.denaturalizeDataset(meta);
  const dicomDict = new DicomDict(denaturalized);

  dicomDict.dict = DicomMetaDictionary.denaturalizeDataset(dataset);

  const part10Buffer = dicomDict.write();

  const config = {
    url: serverUrl,
    headers: DICOMWeb.getAuthorizationHeader(),
  };

  const dicomWeb = new api.DICOMwebClient(config);
  const options = {
    datasets: [part10Buffer],
  };

  await dicomWeb.storeInstances(options);
};

dicomweb-client

Implementation of DICOMweb client code

MIT
Latest version published 12 months ago

Package Health Score

69 / 100
Full package analysis