Sign inSign up

opendicom/dcm4chee

By opendicom

•Updated 9 months ago

Image
0

2.2K

opendicom/dcm4chee repository overview

⁠Description

opendicom/dcm4chee is a Docker image built to run dcm4chee-2.18.3⁠ with persistence to store application settings and dicom files. The database is assumed to be instantiated elsewhere.

It comes with the possibility of downloading Weasis DICOM Viewer⁠ for different platforms (linux, macOS and Windows) from the web access and view the studies with it.

The libclib_jiio plugin was updated to its latest version (1.2.0-b04) which improves the memory leak bug when compressing in jpeg2000, although it does not solve it definitively. More information about this here⁠.

This image was equipped with the cron daemon running in background, so it is possible to carry out maintenance tasks on the container automatically, such as deleting logs ,backup database or restarting the service, for example due to the memory leak problems previously named.

⁠Custom default setting

Has opendicom⁠ custom settings as default.

  • Dcm4chee Archive setting
    • Mappings for received HL7-ORM messages
      • $JBOSS_HOME/server/default/conf/dcm4chee-hl7/opendicom_orm2dcm_v3.xsl
      • $JBOSS_HOME/server/default/conf/dcm4chee-hl7/opendicom_common_v3.xsl
    • Coercion for received DICOM files
      • $JBOSS_HOME/server/default/conf/dcm4chee-ae/cstorerq.xsl
    • Mappings for received DICOM files
      • $JBOSS_HOME/server/default/conf/dcm4chee-attribute-filter.xml
    • Customization of web interface (Reading Room CSS)
      • $JBOSS_HOME/server/default/deploy/dcm4chee-web-ear-3.0.7-mysql.ear
    • ONLINE FileSystem Service
      • DefaultStorageDirectory = /archive
    • HL7Service
      • Stylesheet = opendicom_orm2dcm_v3.xsl
      • PatientMatching=pid,issued
    • StoreSCP Service
      • PatientMatching = pid,issuer?,[birthdate?]
  • Dcm4chee-web3
    • Roles
      • Role WebAdmin groups: Web,AET
  • Jboss Console

⁠Extra software

Include some extra software for debugging purpose

  • dcmtk
  • mysql client
  • nano editor

⁠Usage

⁠Start a new container without persistence

This instance is absolutely for testing, as any configuration or file sent will be deleted at the end of the container.

docker run --rm --name container_name -d opendicom/dcm4chee:<tag>

⁠Persistence

This image supports persisting multiple components. Docker volumes or bind-mounts are used. The choice depends on each installation and/or use preference.

⁠Configuration of dcm4chee-2.18.3

The /opt/dcm4chee/server/default directory is where dcm4chee-2.18.3 configuration is saved, to persist it, it's possible to use volumes or bind-mounts.

"If you bind-mount into a non-empty directory on the container, the directory’s existing contents are obscured by the bind mount." [more info]⁠.

If we use bind mount to persist the configuration in a new instance, the configuration files would be obscured by the bind mount, thus not accessible. To solve this, the image behaves as follows:

Configuration files are located in /opt/dcm4chee/server/default_base. If the container's /opt/dcm4chee/server/default directory is empty (except for archive or .DS_Store) move the contents of /opt/dcm4chee/server/default_base to /opt /dcm4chee/server/default. As a result:

  • If a bind mount is performed on an empty directory on the docker host to /opt/dcm4chee/server/default of the container. The docker host directory is populated with the base configuration files.
  • If a bind mount is performed on a directory with items on the docker host to /opt/dcm4chee/server/default of the container. The items are assumed to be the configuration files and the directory is NOT modified.
  • In the case of using volumes, the process is identical to the two previous points.
⁠DICOM Archive

By default, the /archive directory is defined as the destination for dicom files received by dcm4chee. Using named volumes or bind-mount persistence is achieved.

If a bind mount is performed, the rules defined by Docker are applied to bind mount⁠

⁠Start a new container with persistence

This example assumes having two empty directory on the docker hots. One fome dicom archive and other for dcm4chee configuration.

/data/archive/
docker run --name container_name -d \
	-v /data/archive:/opt/dcm4chee/server/default/archive/ \
	-v /data/default:/opt/dcm4chee/server/default/ \
	opendicom/dcm4chee:<tag>

⁠Weasis

It includes weasis-pacs-connector v6.1.5 which allows you to open the Weasis⁠ application via [Weasis Web Protocol](https://nroduit⁠. github.io/en/getting-started/weasis-protocol/). Therefore, to view a study it's sufficient to install the native Weasis application on the Client PC and search for the study from the dcm4chee web interface http://<host>:<port>/dcm4chee-web3

⁠Cron

Cron by default looks for changes in /etc/crontab and /etc/cron.d/* when it detects a change, updates its in-memory task list from that files. This behavior works perfectly from a full operating system, but it can fail from some containers, so that, when there is a change in a configuration file, cron does not detect it and therefore does not install the new task in memory.

For this reason opendicom/dcm4chee handles cron with some peculiarity. There is a /crontab_file file that contains the desired cron settings. Every time the container is created or started it loads the configuration from this file into memory. If this file is changed after the initial container it will be necessary to manually load the configuration into memory or restart the container.

⁠Load cron configuration manually

To manually load the cron configuration after you modified the /crontab_file

docker exec -it container_name bash
crontab /crontab_file

⁠Task loggin

To see the output of the tasks it is necessary to redirect stdin and stdout to the process with pid 1. In this way we can observe the logs with the Docker command

docker logs container_name

To redirect the outputs, in the /crontab_file we must add a cron task as follows:

0 1 * * * /scripts/s1.sh > /proc/1/fd/1 2>/proc/1/fd/2

Note in this case the output of the tasks will be mixed with the output of dcm4chee

⁠Use environment variables from cron

Cron does not access user environments variales so they must be configured in some way. When the container starts, it reads the user environment variables and create a script in /.env that export them. This script can be executed automaticaly in every cron task by simply setting BASH_ENV=/.env variable in the cron configuraction file /contab_file

⁠Start a new container with persistence and cron

We assume that the file /data/crontab_file exists on the docker host and that it has a suitable cron configuration.

docker run --name container_name -d \
    -v /data/archive:/opt/dcm4chee/server/default/archive/ \
	  -v /data/default:/opt/dcm4chee/server/default/ \
    -v /data/crontab_file:/crontab_file
	opendicom/dcm4chee:<tag>

⁠Environment Variables

it is possible to configure several parameters through environment variables.

⁠MYSQL_HOST

Optional variable. Default value: localhost. Specifies the name or ip of the database server. If it's another container, must be it's name. If instantiated from a docker-compose.yml it can be either the service name or the container name, preferably the service name.

⁠MYSQL_PORT

Optional variable. Default value 3306 Specifies the port where the mysql server runs.

⁠MYSQL_DATABASE

Optional variable. Default value pacsdb Specifies the name of the database to be used by opendicom/dcm4chee-2.18.3

⁠MYSQL_USER

Optional variable. Default value pacs Specifies the username that opendicom/dcm4chee uses for the database connection

⁠MYSQL_PASSWORD

Optional variable. Default value pacs Specifies the password that opendicom/dcm4chee uses for the database connection

⁠MYSQL_CONNECT_RETRY

Optional variable. Default value 30 When the container starts and before starting dcm4chee-2.18.3 checks the connection to the database, if it fails it repeats the check every MYSQL_CONNECT_RETRY seconds until the connection is established.

⁠JAVA_OPTS

Optional variable. Determines the configuration of the jboss application server used by dcm4chee-2.18.3. You may need to modify the dcm4chee.nodename, Xms and Xmx values ​​as follows:

JAVA_OPTS: ... -Ddcm4che.archive.nodename=DCM4CHEE -Xms512m -Xmx1024m -XX:MaxPermSize=128m

⁠DCM4CHEE_USER_UID

Optional variable. Default value 0 Specifies the user uid used to run dcm4chee and cron tasks. If this value es diferent from 0, when the container starts it change the owner of the dcm4chee application. Warning! does not change the owner of the dicom filesystem, only the application files.

⁠Docker-compose

Inside the compose directory in this repo, is presented all the necessary configuration to start a new instance of opendicom/dcm4chee:<tag>. The same directory already proposes the structure of folders and files necessary to start an new empty instance with data persistence.

  • Iniciar el compose

    cd ./compose
    docker-compose up -d
    

Tag summary

Content type

Image

Digest

sha256:24d0b7379…

Size

669.8 MB

Last updated

over 3 years ago

docker pull opendicom/dcm4chee