Skip to content

Installation

chin edited this page May 7, 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

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.example.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
#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

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
  • Example config file can found at config/raccoon-dimse-app.example.json
  • Please use absolute path in raccoon.dicomStoreRoot and raccoon.raccoonUploadScriptPath
{
  "mongodb": {
    "hosts": ["127.0.0.1"],
    "ports": [27017],
    "username": "root",
    "password": "root",
    "authSource": "admin",
    "database": "raccoon-dicom",
    "debug": false
  },
  "raccoon": {
    "dicomStoreRoot": "./",
    "raccoonUploadScriptPath": "local/dicom-uploader-stow.js",
    "mode": "STOW",
    "stowUrl": "http://127.0.0.1:8081/dicom-web/studies"
  }
}

Config Properties Info

Field Name Type of Value Description
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.username 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.authSource string The name of the MongoDB database to authenticate against.
mongodb.database string The name of the MongoDB database.
mongodb.debug boolean A flag indicating whether or not debug mode is enabled for MongoDB. Which setting logger level of mongodb
raccoon.dicomStoreRoot string The root directory of Raccoon-DICOM that use in C-MOVE

⚠️Please use absolute path
raccoon.raccoonUploadScriptPath string The path to the DICOM uploader script (i.e. local/dicom-uploader-stow.js or local/dicom-uploader.js) of the Raccoon-DICOM.

⚠️Please use absolute path
raccoon.mode string The mode of operation of upload script ("STOW" or "LOCAL")
raccoon.stowUrl string The URL for the STOW endpoint of the Raccoon-DICOM.

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