dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CMake
javascripts
src
.dockcross
.gitignore
CMakeLists.txt
License.txt
README.md
circle.yml

README.md

dcmjs

CircleCI

Overview

dcmjs is a javascript cross-compilation of dcmtk (dcmtk.org) for use in a javascript environment. Uses emscripten.

See http://dcmjs.org

See License.txt for information on using and contributing.

This package is intended for use in browser environments. For server side use probably you want to call to the corresponding natively compiled dcmtk executables.

To see javascript that uses dcmjs.js see the gh-pages branch of commontk/dcmjs.org repository which is what hosts dcmjs.org.

Usage

The module dcmjs.js allows to selectively execute a dcmtk application.

  • To list available application:
$ nodejs dcmjs.js list
dcm2pnm
dcmdump
dcm2xml
dcmftest
  • To execute an application:
$ nodejs dcmjs.js dcmdump
$dcmtk: dcmdump v3.6.1 DEV $

dcmdump: Dump DICOM file and data set
usage: dcmdump [options] dcmfile-in...

parameters:
  dcmfile-in                    DICOM input file or directory to be dumped
[...]
  • Note that node executables do not have access to the local file system. To use dcmjs on a browser see the demos in the gh-pages branch.

Prerequisites

docker pull dockcross/browser-asmjs
docker run dockcross/browser-asmjs > ~/bin/dockcross-browser-asmjs
chmod u+x ~/bin/dockcross-browser-asmjs

For more details, see https://github.com/dockcross/dockcross#readme

Building

The following commands will checkout dcmjs project and build dcmjs.js using dockcross-browser-asmjs.

git clone git://github.com/commontk/dcmjs
cd dcmjs
dockcross-browser-asmjs cmake -Bdcmjs-build -H. -GNinja
dockcross-browser-asmjs ninja -Cdcmjs-build

When done, you will have the files dcmjs.js and dcmjs.js.gz in the dcmjs-build/dcmjs-build/bin folder:

$ ls -1 dcmjs-build/dcmjs-build/bin/
dcmjs.js
dcmjs.js.gz

Add / Remove applications

Re-configuring the project setting any of these options allows to customize the list of applications bundled in the dcmjs.js module:

  • dcmdspfn: -DCMTK_APP_DCMDSPFN:BOOL=[ON|OFF]
  • dconvlum: -DCMTK_APP_DCONVLUM:BOOL=[ON|OFF]
  • dcod2lum: -DCMTK_APP_DCOD2LUM:BOOL=[ON|OFF]
  • dcmj2pnm: -DCMTK_APP_DCMJ2PNM:BOOL=[ON|OFF]
  • dcmmkdir: -DCMTK_APP_DCMMKDIR:BOOL=[ON|OFF]
  • dcmdjpeg: -DCMTK_APP_DCMDJPEG:BOOL=[ON|OFF]
  • dcmcjpeg: -DCMTK_APP_DCMCJPEG:BOOL=[ON|OFF]
  • storescp: -DCMTK_APP_STORESCP:BOOL=[ON|OFF]
  • dcmrecv: -DCMTK_APP_DCMRECV:BOOL=[ON|OFF]
  • termscu: -DCMTK_APP_TERMSCU:BOOL=[ON|OFF]
  • getscu: -DCMTK_APP_GETSCU:BOOL=[ON|OFF]
  • findscu: -DCMTK_APP_FINDSCU:BOOL=[ON|OFF]
  • dcmsend: -DCMTK_APP_DCMSEND:BOOL=[ON|OFF]
  • echoscu: -DCMTK_APP_ECHOSCU:BOOL=[ON|OFF]
  • storescu: -DCMTK_APP_STORESCU:BOOL=[ON|OFF]
  • movescu: -DCMTK_APP_MOVESCU:BOOL=[ON|OFF]
  • dcm2pnm: -DCMTK_APP_DCM2PNM:BOOL=[ON|OFF]
  • dcmquant: -DCMTK_APP_DCMQUANT:BOOL=[ON|OFF]
  • dcmscale: -DCMTK_APP_DCMSCALE:BOOL=[ON|OFF]
  • dcmsign: -DCMTK_APP_DCMSIGN:BOOL=[ON|OFF]
  • drtdump: -DCMTK_APP_DRTDUMP:BOOL=[ON|OFF]
  • dcmdjpls: -DCMTK_APP_DCMDJPLS:BOOL=[ON|OFF]
  • dcmcjpls: -DCMTK_APP_DCMCJPLS:BOOL=[ON|OFF]
  • dcml2pnm: -DCMTK_APP_DCML2PNM:BOOL=[ON|OFF]
  • readoviw: -DCMTK_APP_READOVIW:BOOL=[ON|OFF]
  • writwlst: -DCMTK_APP_WRITWLST:BOOL=[ON|OFF]
  • readwlst: -DCMTK_APP_READWLST:BOOL=[ON|OFF]
  • preplock: -DCMTK_APP_PREPLOCK:BOOL=[ON|OFF]
  • wlmscpfs: -DCMTK_APP_WLMSCPFS:BOOL=[ON|OFF]
  • wlcefs: -DCMTK_APP_WLCEFS:BOOL=[ON|OFF]
  • dcmdump: -DCMTK_APP_DCMDUMP:BOOL=[ON|OFF]
  • dcm2xml: -DCMTK_APP_DCM2XML:BOOL=[ON|OFF]
  • img2dcm: -DCMTK_APP_IMG2DCM:BOOL=[ON|OFF]
  • dcmodify: -DCMTK_APP_DCMODIFY:BOOL=[ON|OFF]
  • dcmdrle: -DCMTK_APP_DCMDRLE:BOOL=[ON|OFF]
  • dcmftest: -DCMTK_APP_DCMFTEST:BOOL=[ON|OFF]
  • mdfconen: -DCMTK_APP_MDFCONEN:BOOL=[ON|OFF]
  • mdfdsman: -DCMTK_APP_MDFDSMAN:BOOL=[ON|OFF]
  • dcmcrle: -DCMTK_APP_DCMCRLE:BOOL=[ON|OFF]
  • pdf2dcm: -DCMTK_APP_PDF2DCM:BOOL=[ON|OFF]
  • dump2dcm: -DCMTK_APP_DUMP2DCM:BOOL=[ON|OFF]
  • dcmgpdir: -DCMTK_APP_DCMGPDIR:BOOL=[ON|OFF]
  • dcmconv: -DCMTK_APP_DCMCONV:BOOL=[ON|OFF]
  • xml2dcm: -DCMTK_APP_XML2DCM:BOOL=[ON|OFF]
  • dcm2pdf: -DCMTK_APP_DCM2PDF:BOOL=[ON|OFF]
  • dcmpschk: -DCMTK_APP_DCMPSCHK:BOOL=[ON|OFF]
  • dcmp2pgm: -DCMTK_APP_DCMP2PGM:BOOL=[ON|OFF]
  • dcmpsprt: -DCMTK_APP_DCMPSPRT:BOOL=[ON|OFF]
  • dcmmklut: -DCMTK_APP_DCMMKLUT:BOOL=[ON|OFF]
  • dcmpsmk: -DCMTK_APP_DCMPSMK:BOOL=[ON|OFF]
  • dcmpsrcv: -DCMTK_APP_DCMPSRCV:BOOL=[ON|OFF]
  • dcmprscp: -DCMTK_APP_DCMPRSCP:BOOL=[ON|OFF]
  • dcmmkcrv: -DCMTK_APP_DCMMKCRV:BOOL=[ON|OFF]
  • dcmpssnd: -DCMTK_APP_DCMPSSND:BOOL=[ON|OFF]
  • dcmprscu: -DCMTK_APP_DCMPRSCU:BOOL=[ON|OFF]
  • dcmqridx: -DCMTK_APP_DCMQRIDX:BOOL=[ON|OFF]
  • dcmqrti: -DCMTK_APP_DCMQRTI:BOOL=[ON|OFF]
  • dcmqrscp: -DCMTK_APP_DCMQRSCP:BOOL=[ON|OFF]
  • dsrdump: -DCMTK_APP_DSRDUMP:BOOL=[ON|OFF]
  • xml2dsr: -DCMTK_APP_XML2DSR:BOOL=[ON|OFF]
  • dsr2xml: -DCMTK_APP_DSR2XML:BOOL=[ON|OFF]
  • dsr2html: -DCMTK_APP_DSR2HTML:BOOL=[ON|OFF]

The list above has been generated using:

cd DCMTK
for file in `find -wholename *apps/*.cc`; do
  appname=$( basename ${file%.*} );
  echo -e "* [${appname}](http://support.dcmtk.org/docs/${appname}.html): \`-DCMTK_APP_${appname^^}:BOOL=[ON|OFF]\`";
done