npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dicomweb-client

v0.10.4

Published

Implementation of DICOMweb client code

Downloads

46,011

Readme

Build Status

DICOMweb Client

JavaScript client implementation of DICOMweb.

For further details please refer to PS3.18 of the DICOM standard.

Goal

This is work-in-progress and should not be used in clinical practice. Use at your own risk.

The main motivations for this project is:

  • Support for storing, quering, retrieving DICOM objects over the web using RESTful services STOW-RS, QIDO-RS and WADO-RS, respectively
  • Building a lightweight library to facilitate integration into web applications

Installation

Install the dicomweb-client package using the npm package manager:

npm install dicomweb-client

Building and testing

Build and test code locally:

git clone https://github.com/dcmjs-org/dicomweb-client ~/dicomweb-client
cd ~/dicomweb-client
npm install
npm run build
npm test

Usage

<script type="text/javascript" src="https://unpkg.com/dicomweb-client"></script>
const url = 'http://localhost:8080/dicomweb';
const client = new DICOMwebClient.api.DICOMwebClient({url});
client.searchForStudies().then(studies => {
  console.log(studies)
});

Configuration Options

The API can be configured with a number of custom configuration options to control the requests. These are:

  • url to retrieve from for the base requests
  • singlepart, either true or a set of parts from bulkdata,image,video to request as single part responses
  • headers to add to the retrieve
  • XMLHttpRequest can be passed to storeInstances as a property of the options parameter. When present, instead of creating a new XMLHttpRequest instance, the passed instance is used instead. One use of this would be to track the progress of a DICOM store and/or cancel it.

An example use of XMLHttpRequest being passed into the store is shown in the js snippet below as an example of where the upload's percentage progress is output to the console.

const url = 'http://localhost:8080/dicomweb';
const client = new DICOMwebClient.api.DICOMwebClient({url});

// an ArrayBuffer of the DICOM object/file
const dataSet = ... ; 

// A custom HTTP request
const request = new XMLHttpRequest();

// A callback that outputs the percentage complete to the console.
const progressCallback = evt => {
  if (!evt.lengthComputable) {
    // Progress computation is not possible.
    return;
  }

  const percentComplete = Math.round((100 * evt.loaded) / evt.total);
  console.log("storeInstances  is " + percentComplete + "%");
};

// Add the progress callback as a listener to the request upload object.
request.upload.addEventListener('progress', progressCallback);

const storeInstancesOptions = {
  dataSets,
  request,
}
client.storeInstances(storeInstancesOptions).then( () => console.log("storeInstances completed successfully.") );

For maintainers

Use semantic commit messages to generate releases and change log entries: Semantic Release: How does it work?. Github actions are used to trigger building and uploading new npm packages.

Citation

Please cite the following article when using the client for scientific studies: Herrmann et al. J Path Inform. 2018:

@article{jpathinform-2018-9-37,
    Author={
        Herrmann, M. D. and Clunie, D. A. and Fedorov A. and Doyle, S. W. and Pieper, S. and
        Klepeis, V. and Le, L. P. and Mutter, G. L. and Milstone, D. S. and Schultz, T. J. and
        Kikinis, R. and Kotecha, G. K. and Hwang, D. H. and Andriole, K, P. and Iafrate, A. J. and
        Brink, J. A. and Boland, G. W. and Dreyer, K. J. and Michalski, M. and
        Golden, J. A. and Louis, D. N. and Lennerz, J. K.
    },
    Title={Implementing the {DICOM} standard for digital pathology},
    Journal={Journal of Pathology Informatics},
    Year={2018},
    Number={1},
    Volume={9},
    Number={37}
}

Support

The developers gratefully acknowledge their reseach support: