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

dicomp10-to-dicomweb

v0.4.0

Published

Library to convert DICOMP10 to DICOMweb format

Downloads

15

Readme

dicomp10-to-dicomweb-js

Status: Beta - in development (as of Oct 25, 2021)

The scope of this project is to convert DICOM P10 into a format into a DICOMweb compatible format - specifically JSON metadata, frames and bulkdata. This library will enable the following:

  • Building of DICOMweb compliant services
    • Ability to stream the data for "on the fly" use cases
  • Ability to pregenerate DICOMweb responses and store them so they can be served up with a standard HTTP server to implement a subset of DICOMweb WADO-RS, specifically:
    • Retrieve instance metadata
    • Retrieve series level metadata
    • Retrieve frames in an instance
    • Retrieve bulk data
    • Retrieve study, series or instance query
  • To explore an alternative archive format that is web friendly (no need for a DICOM parser)
    • Should be able to recreate DICOM P10 file from this data (semantic equivalence or possibly bit for bit equivalent)
    • Will make updates more efficient (e.g. updating patient name just requires updating metadata)
    • More efficient image access (no need to scan through DICOM P10 to access frames, or store the offsets of each frame separately and seek to them)

The scope of this library is limited to:

  • Taking one or more DICOM files as input, writing Bulkdata and Pixeldata
  • Creating either deduplicated representations or instance level metadata
  • Combining deduplicated representations into sets of deduplicated representations
  • Using the deduplicated representations to generate study/series/instance query results and series metadata

View the design rationale for more information on the scope

View frequently asked questions

View specification

Pre-requisites

  • NodeJS (v14.18.1 used but earlier/later versions should also)
  • NPM

Running Unit Tests

npm run test

A visual studio code build task is also included so you can run it from there with "Terminal->Run Build Task" (Shift+Command+B)

Running the CLI

Install the CLI with either npm install -g . or npm install -g dicomp10-to-dicomweb

To create instances

Run the tool:

mkdicomwebinstances <directoryOfP10Files>

To create a full DICOMweb output structure

Run the tool:

mkdicomweb <directoryOfP10Files>

To run separated stages

The mkdicomweb tool runs the three stages all together, on just the studies references. This can instead be done on separate files by running:

mkdicomwebdeduplicated <directoryOfP10Files>
mkdicomwebdeduplicatedgroup
mkdicomwebstudy

which creates a full study directory. The first stage writes to ~/dicomweb/instances// data about each instance as it is read in. The second stage then groups these files for more efficient compression into the ~/dicomweb/deduplicated// The last stage then creates the actual DICOMweb files.

There is currently no notification of what studies have been updated between stages. The intent is to write notifications to ~/dicomweb/notifications/ of what operations need to be applied/updated.

To Serve Instances As a Web Server

cd ~/dicomweb
npx http-server -p 5000 -g --cors

The -g option serves up compressed files ending in .gz as compressed http streams.

To Create DICOM part 10 from DICOMweb files

TODO

Run the tool mkdicomwebpart10 on the studyUID, and optionally on the series/instance UID's of interest to generate a local set of part 10 files.

To Update DICOM Metadata

TODO

Run the tool

mkdicomwebupdate -<delete/anonymize/patient/study/series/instance> <studyInstanceUID> (tag=newValue)* 

to delete the given item or to update the specified attribute contained in the given level. Multiple mkdicomwebupdate commands may be run to perform updates on different attribute sets, or they may be grouped into a single file for bulk application.

TODO (Looking for help here!!)

  • Create docker container to encapsulate build environment
  • Create test data (DICOM P10 and expected DICOMweb results) - Jordan working on this
  • Document API
  • Create CI + Publish to NPM
  • Fix Bugs
    • Get bulkdata refs written properly
  • Enhance cli
    • Add support for specifying bulkDataMinSize
    • Add support for writing out DICOM P10 file
  • Enhance library
    • Write out "info" file
      • P10 Header
      • Data needed to recreate original P10 instance
  • Create DICOMweb -> DICOM P10 tool