Skip to content

Installation

chin edited this page Jun 17, 2023 · 9 revisions

Installation

Environment Requirements

  • Before starting Raccoon, MongoDB, imagemagick, node.js, and JAVA JDK must be installed.
  • node.js >= 16
  • Java JDK >= 11
  • imagemagick
  • MongoDB >= 4.4

📢📢📢

  • You must copy opencv_java library into JDK's lib folder (on windows is bin folder)
  • On Windows, please copy opencv_java.dll, you can find this file at models/DICOM/dcm4che/javaNode/dcm4chee/lib/windows-x86-64
  • On Linux, please copy libclib_jiio.so and libopencv_java.so, you can find this file at models/DICOM/dcm4che/javaNode/dcm4chee/lib/linux-x86-64

Install Node.js Packages

  • ⚠️ Please enter Raccoon-DICOM project folder first
npm install

Configuration

dotenv .env

  • The .env file at project root.
  • You can copy the .env.template and modify it.
# MongoDB
MONGODB_NAME="raccoon-dicom"
MONGODB_HOSTS=["mongodb"]
MONGODB_PORTS=[27017]
MONGODB_USER="root"
MONGODB_PASSWORD="root"
MONGODB_AUTH_SOURCE="admin"
MONGODB_IS_SHARDING_MODE=false

# Server
SERVER_PORT=8081
SERVER_SESSION_SECRET_KEY="secret-key"

# DICOM Web
DICOM_STORE_ROOTPATH="/dicomFiles"
DICOMWEB_HOST="{host}"
DICOMWEB_PORT=8081
DICOMWEB_API="dicom-web"

# DICOM DIMSE
ENABLE_DIMSE=false
DCM4CHE_QRSCP_COMMAND=`[
    "-b",
    "DCMQRSCP:11112",
    "--dicomdir",
    "{project}/config/DICOMDIR",
    "--ae-config",
    "{project}/config/ae.properties",
    "--all-storage",
    "--filepath",
    "DICOM/{0020000D,hash}/{0020000E,hash}/{00080018,hash}.dcm",
    "--raccoon",
    "{project}/config/raccoon-dimse-app.json"
]`

# FHIR
SYCN_TO_FHIR_SERVER=false
FHIRSERVER_BASE_URL="http://localhost:8088/fhir"

Environment Variables Info

Field Name Type of Value Description
#MongoDB
MONGODB_NAME string The name of the MongoDB database.
MONGODB_HOSTS array of strings A list of hostnames or IP addresses where the MongoDB server is running.
MONGODB_PORTS array of numbers A list of port numbers corresponding to the MongoDB servers specified in MONGODB_HOSTS.
MONGODB_USER string The username to use when connecting to the MongoDB server.
MONGODB_PASSWORD string The password to use when connecting to the MongoDB server.
MONGODB_AUTH_SOURCE string The name of the MongoDB database to authenticate against.
MONGODB_IS_SHARDING_MODE boolean A flag indicating whether or not the MongoDB instance is running in sharding mode.
#Server
SERVER_PORT number The port number on which the server will run.
SERVER_SESSION_SECRET_KEY string The secret key of session
#DICOMweb
DICOM_STORE_ROOTPATH string The root directory where DICOM files will be stored.
DICOMWEB_HOST string The hostname of the DICOM Web server. Which use to combine 00081190 (Retrieve URL).

You can use {host} in string that will replace to request.headers.host
DICOMWEB_PORT number The port number on which the DICOM Web server will run. Which use to combine 00081190 (Retrieve URL)

e.g. 8088, will be http://example.com:8088/dicom-web/studies
DICOMWEB_AE string Set returned Retrieve AE Title (0008,0054) in QIDO-RS. If the DIMSE service is enabled, the AE Title use from DIMSE.
#DIMSE
ENABLE_DIMSE boolean A flag indicating whether or not the DICOM DIMSE service should be enabled.
DCM4CHE_QRSCP_COMMAND string The command to start the DCM4CHE QRSCP service. Please see the usage fromdcm4che-tool-dcmqrscp, and you must pass --raccoon {json-config-file} to allow DCM4CHE QRSCP communicate with raccoon.

DIMSE config of racoon please see DIMSE APP.

You can use {project} in string that will replace to __dirname

Plugins Config

  • The config.js file is located at project plugins folder.
  • You can copy the config.template.js and modify it.
  • You may just copy & rename without editing this config

For for plugins/config.js Properties Info

👉 See this documentation

DIMSE APP

  • Raccoon-DICOM use DCM4CHE QRSCP Tool to provide DIMSE services
  • You can set ENABLE_DIMSE=true to enable DICOM DIMSE service
  • And you must pass --raccoon {json-config-file} in DCM4CHE_QRSCP_COMMAND environment
  • Raccoon-dicom will automatically generate raccoon-dimse-app.json config for DIMSE service

Deploy

Local

  • Run command below to deploy Raccoon-DICOM
node server.js

Docker-compose

  • You can also use Docker-compose to deploy
  • ⚠️ You should do Configuration first
  • Run command below to deploy Raccoon-DICOM
sudo docker compose up

Note You may need to copy docker-compose.yaml to another directory and modify path of raccoon.build.context To prevent mapping too much data in volumes (i.e. mongodb, raccoon-storage)

Troubleshooting on linux

  • Unknown VR: Tag not found in data dictionary when using STOW-RS

    • You need set the DCMDICTPATH environment variable
    • The dicom.dic can find in the /usr/share/libdcmtk{version} or ./models/DICOM/dcmtk/dicom.dic

    The {version} corresponds to dcmtk version, e.g. 3.6.5 => libdcmtk15

    • Set DCMDICTPATH environment variable using command or you can add the command to profile file(~/.bashrc,~/.profile etc.), example with dcmtk 3.6.5:
    export DCMDICTPATH=/usr/share/libdcmtk15/dicom.dic
    • Check the environment variable
    echo $DCMDICTPATH

Test

Upload DICOM (STOW-RS)

  • Following use the file at test/dicomFiles/jpeg2000/example-jpeg-2000.dcm to test upload
  • use curl to upload
curl --location --request POST "http://localhost:8081/dicom-web/studies" ^
--header "Accept: application/dicom+json" ^
--header "Content-Type: multipart/related; type=\"application/dicom\"" ^
--form "[email protected]; type=application/dicom"
  • The successful message
{"00081190":{"vr":"UT","Value":["http://localhost:8081/dicom-web/studies/1.3.46.670589.45.1.1.4993912214784.1.5436.1538560373543"]},"00081198":{"vr":"SQ","Value":[]},"00081199":{"vr":"SQ","Value":[{"00081150":{"vr":"UI","Value":["1.2.840.10008.5.1.4.1.1.77.1.6"]},"00081155":{"vr":"UI","Value":["1.3.6.1.4.1.5962.99.1.3002151337.1017604488.1540600476073.6.0"]},"00081190":{"vr":"UT","Value":["http://localhost:8081/dicom-web/studies/1.3.46.670589.45.1.1.4993912214784.1.5436.1538560373543/series/1.3.46.670589.45.1.1.4993912214784.1.5436.1538560606509.3/instances/1.3.6.1.4.1.5962.99.1.3002151337.1017604488.1540600476073.6.0"]}}]}}

GET DICOM Info (QIDO-RS)

Retrieve-DICOM-Frame (WADO-RS)

image

image