• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language CMake
  • License
    Other
  • Created over 10 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).

dcmjs

Note: for the pure-JavaScript DICOM implementation, see github.com/dcmjs-org/dcmjs. The package here may still be useful for specialized tasks.

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 allows to selectively execute a dcmtk application.

  • To list available application:
require('dcmjs').run(['list'])
$ node dcmjs-cli list

Output:

dcm2pnm
dcmdump
dcm2xml
dcmftest
  • To execute an application:
require('dcmjs').run(['dcmdump'])
$ node dcmjs-cli dcmdump

Output:

$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
[...]

Prerequisites

docker pull dockcross/web-wasm
docker run dockcross/web-wasm > ~/bin/dockcross-web-wasm
chmod u+x ~/bin/dockcross-web-wasm

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

Building

The following commands will checkout dcmjs project and build dcmjs.js using dockcross-web-wasm.

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

When done, you will have these files in the dcmjs-build/dcmjs-build/bin folder:

$ ls -1 dcmjs-build/dcmjs-build/bin/
dcmjs-cli
dcmjs.js
dcmjs.js.gz
dcmjs.wasm
dcmjs.wasmt

File IO using node

To support using the javascript module with node, the current folder is mounted as /working. This means that input files must be in in the current directory or a sub-directory.

For example, assuming we have the these files:

/home/awesome/downloads/dcmjs-cli
/home/awesome/downloads/dcmjs.js
/tmp/data/sr.dcm

The following is expected to work:

cd /tmp
node /home/awesome/downloads/dcmjs-cli dsr2xml /working/data/sr.dcm

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:

  • cda2dcm: -DBUILD_cda2dcm_APP:BOOL=[ON|OFF]
  • dcm2json: -DBUILD_dcm2json_APP:BOOL=[ON|OFF]
  • dcm2pdf: -DBUILD_dcm2pdf_APP:BOOL=[ON|OFF]
  • dcm2pnm: -DBUILD_dcm2pnm_APP:BOOL=[ON|OFF]
  • dcm2xml: -DBUILD_dcm2xml_APP:BOOL=[ON|OFF]
  • dcmcjpeg: -DBUILD_dcmcjpeg_APP:BOOL=[ON|OFF]
  • dcmcjpls: -DBUILD_dcmcjpls_APP:BOOL=[ON|OFF]
  • dcmconv: -DBUILD_dcmconv_APP:BOOL=[ON|OFF]
  • dcmcrle: -DBUILD_dcmcrle_APP:BOOL=[ON|OFF]
  • dcmdjpeg: -DBUILD_dcmdjpeg_APP:BOOL=[ON|OFF]
  • dcmdjpls: -DBUILD_dcmdjpls_APP:BOOL=[ON|OFF]
  • dcmdrle: -DBUILD_dcmdrle_APP:BOOL=[ON|OFF]
  • dcmdspfn: -DBUILD_dcmdspfn_APP:BOOL=[ON|OFF]
  • dcmdump: -DBUILD_dcmdump_APP:BOOL=[ON|OFF]
  • dcmftest: -DBUILD_dcmftest_APP:BOOL=[ON|OFF]
  • dcmgpdir: -DBUILD_dcmgpdir_APP:BOOL=[ON|OFF]
  • dcmicmp: -DBUILD_dcmicmp_APP:BOOL=[ON|OFF]
  • dcmj2pnm: -DBUILD_dcmj2pnm_APP:BOOL=[ON|OFF]
  • dcml2pnm: -DBUILD_dcml2pnm_APP:BOOL=[ON|OFF]
  • dcmmkcrv: -DBUILD_dcmmkcrv_APP:BOOL=[ON|OFF]
  • dcmmkdir: -DBUILD_dcmmkdir_APP:BOOL=[ON|OFF]
  • dcmmklut: -DBUILD_dcmmklut_APP:BOOL=[ON|OFF]
  • dcmodify: -DBUILD_dcmodify_APP:BOOL=[ON|OFF]
  • dcmp2pgm: -DBUILD_dcmp2pgm_APP:BOOL=[ON|OFF]
  • dcmprscp: -DBUILD_dcmprscp_APP:BOOL=[ON|OFF]
  • dcmprscu: -DBUILD_dcmprscu_APP:BOOL=[ON|OFF]
  • dcmpschk: -DBUILD_dcmpschk_APP:BOOL=[ON|OFF]
  • dcmpsmk: -DBUILD_dcmpsmk_APP:BOOL=[ON|OFF]
  • dcmpsprt: -DBUILD_dcmpsprt_APP:BOOL=[ON|OFF]
  • dcmpsrcv: -DBUILD_dcmpsrcv_APP:BOOL=[ON|OFF]
  • dcmpssnd: -DBUILD_dcmpssnd_APP:BOOL=[ON|OFF]
  • dcmqridx: -DBUILD_dcmqridx_APP:BOOL=[ON|OFF]
  • dcmqrscp: -DBUILD_dcmqrscp_APP:BOOL=[ON|OFF]
  • dcmqrti: -DBUILD_dcmqrti_APP:BOOL=[ON|OFF]
  • dcmquant: -DBUILD_dcmquant_APP:BOOL=[ON|OFF]
  • dcmrecv: -DBUILD_dcmrecv_APP:BOOL=[ON|OFF]
  • dcmscale: -DBUILD_dcmscale_APP:BOOL=[ON|OFF]
  • dcmsend: -DBUILD_dcmsend_APP:BOOL=[ON|OFF]
  • dcmsign: -DBUILD_dcmsign_APP:BOOL=[ON|OFF]
  • dcod2lum: -DBUILD_dcod2lum_APP:BOOL=[ON|OFF]
  • dconvlum: -DBUILD_dconvlum_APP:BOOL=[ON|OFF]
  • drtdump: -DBUILD_drtdump_APP:BOOL=[ON|OFF]
  • dsr2html: -DBUILD_dsr2html_APP:BOOL=[ON|OFF]
  • dsr2xml: -DBUILD_dsr2xml_APP:BOOL=[ON|OFF]
  • dsrdump: -DBUILD_dsrdump_APP:BOOL=[ON|OFF]
  • dump2dcm: -DBUILD_dump2dcm_APP:BOOL=[ON|OFF]
  • echoscu: -DBUILD_echoscu_APP:BOOL=[ON|OFF]
  • findscu: -DBUILD_findscu_APP:BOOL=[ON|OFF]
  • getscu: -DBUILD_getscu_APP:BOOL=[ON|OFF]
  • img2dcm: -DBUILD_img2dcm_APP:BOOL=[ON|OFF]
  • mdfconen: -DBUILD_mdfconen_APP:BOOL=[ON|OFF]
  • mdfdsman: -DBUILD_mdfdsman_APP:BOOL=[ON|OFF]
  • movescu: -DBUILD_movescu_APP:BOOL=[ON|OFF]
  • pdf2dcm: -DBUILD_pdf2dcm_APP:BOOL=[ON|OFF]
  • stl2dcm: -DBUILD_stl2dcm_APP:BOOL=[ON|OFF]
  • storescp: -DBUILD_storescp_APP:BOOL=[ON|OFF]
  • storescu: -DBUILD_storescu_APP:BOOL=[ON|OFF]
  • termscu: -DBUILD_termscu_APP:BOOL=[ON|OFF]
  • wlcefs: -DBUILD_wlcefs_APP:BOOL=[ON|OFF]
  • wlmscpfs: -DBUILD_wlmscpfs_APP:BOOL=[ON|OFF]
  • xml2dcm: -DBUILD_xml2dcm_APP:BOOL=[ON|OFF]
  • xml2dsr: -DBUILD_xml2dsr_APP: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): \`-DBUILD_${appname}_APP:BOOL=[ON|OFF]\`";
done | sort

List of options found in CMake/Externals/External_DCMTK.cmake can be generated using:

cd DCMTK
for file in `find -wholename *apps/*.cc`; do
  appname=$( basename ${file%.*} );
  echo -e "dcmtk_build_app_option(BUILD_${appname}_APP OFF)";
done | sort | column -t

Creating a release

  1. Choose a release name (e.g dcmjs-3.6.1)
release=<name-of-release>
  1. Fetch and tag repository
git fetch
git tag -s -m "${release}" ${release} origin/master
  1. Publish tag
git push origin ${release}

More Repositories

1

CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
C++
841
star
2

QtPropertyBrowser

A property browser framework enabling the user to edit a set of properties.
C++
128
star
3

PythonQt

CMake-ified version of PythonQt
65
star
4

DCMTK

WARNING: This is NOT the official upstream DCMTK git repository.
C++
44
star
5

QtSOAP

The Qt SOAP project provides basic web service support with version 1.1 of the SOAP protocol. It is fork of
C++
42
star
6

qRestAPI

Simple Qt library allowing to synchronously or asynchronously query a REST server.
C++
31
star
7

AppLauncher

Simple and small program allowing to set the environment of any executable.
CMake
31
star
8

CTKData

17
star
9

Log4Qt

CMake-ified version of Log4Qt
C++
13
star
10

dcmjs.org

Website showcasing dcmjs - a javascript cross-compile of dcmtk
JavaScript
11
star
11

ctk-cli

Python interface for inspecting and running CLI modules (as defined by CommonTK)
Python
9
star
12

Artichoke

CMake module allowing to easily create a build system on top of ExternalProjects
CMake
9
star
13

QEmbedIPython

Python
8
star
14

zlib

CMake'ified zlib
C
7
star
15

CTK-web

A set of common web components for medical imaging, surgical navigation, and related purposes
JavaScript
5
star
16

sqlite

CMake-ified version of sqlite
C
4
star
17

QtTesting

This is a mirror of the Gitlab repository. Please use Gitlab for PRs and Issues.
C++
4
star
18

CmdLineParams

C++
3
star
19

KWSys

Unmaintained repository - See https://gitlab.kitware.com/utils/kwsys for up-to-date Kitware System Library
C++
3
star
20

qxmlrpc

QT4 based XML-RPC library
C++
3
star
21

Examples

Collection of independent CMake-based projects illustrating how to build and link against CTK
3
star
22

PythonQtWrapper

Simple tool used to automatically generate the decorator associated with the constructor and decorator of QObject based class
C++
3
star
23

libcurl

CMake-ified version of libcurl
C
2
star
24

libexpat

CMake-ified version of expat
C
1
star
25

bzip2

CMake'ified bzip2
C
1
star