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

@doepnern1/dicom-web-client

v2.0.0

Published

Simple dicom client with typescript types to interact with dicom-web REST API

Downloads

58

Readme

dicom-web-client

Simple dicom client with typescript types to interact with dicom-web REST API

WORK IN PROGRESS

Github

API

There are 3 levels in this api:

  • Study
  • Series
  • Intance

Each of them has their own interfaces and slightly different types available. They try to representate the levels specified in the official DICOM specifications. However this API was built for a personal project with limited need for support of DICOM-Tags, so it is not nearly complete.

This package uses the fetch API (https://developer.mozilla.org/de/docs/Web/API/Fetch_API)

You will need to import the DicomClient class on which ou can modify the fetch function with the DicomClient.setFetchFunction(fetchFn). If you are using the DicomClient in Node, you will need to pass a baseUrl to the constructor as node-fetch does not support relative URLs.

DicomClass

new DicomClass({ baseUrl?: string, auth: string})

  • creates DicomClass on which all other functions are available, basUrl will be prepended on all requests, auth will be used to populate the Authorization header on requests.

Study

getUserStudies() : DicomStudyResponse[]

  • calls to dicom-web/studies and returns array of studys

Series

getSeriesInStudy(studyUID : string) : DicomSeriesResponse[]

  • calls to dicom-web/studies/{studyId} and returns array of DicomSeriesResponse

Instances

getInstancesInSeries(studyUID : string, seriesUID : string)

  • calls to dicom-web/studies/{studyId}/series/{seriesUID} and returns instances in series

getInstanceMetadata(studyUID : string, seriesUID : string, instanceUID : string)

  • calls to dicom-web/studies/{studyId}/series/{seriesUID}/instanes/{instanceUID}/metadata and returns metadata of series

Models

DicomStudyResponse

Tags included: http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_10.6.3.3.html

DicomSeriesResponse

Tags included: http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_10.6.3.3.2.html

studyUID : string

getThumbnail() : null | string

  • calls to dicom-web/studies/{this.StudyInstanceUID}/series/{this.SeriesInstanceUID}/thumbnail and creates blobURL to be used as image source in browser

Scheduled "ProcedureStepID" and "RequestedProcedureID" is changed to optional due to it missing often

DicomInstanceResponse

Tags included: http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_10.6.3.3.3.html

studyUID : string

seriesUID : string

Tags

Tags and their settings are defined in tags.ts.

If you encounter a problem with a tag you can look up the settings for that tag and change the type to optional if you dont need the tag. In that case a default value of "undefined" is returned if it is a date or string or -1 if it is a number.

If the tag in the server response has a weird format you can specify customGetters : ((e : unknown)=>unknown)[] on the tag, then the parser(getTag()) will try all customGetters, passing in the value of incomingObject[{tag}]["Value"] in the order specified until one customGetter returns a value with the correct return type.