Skip to main content

A Command line tool for the dicom processor library

Project description

DCM PROCESSOR

A dicom processing library setup with docker containers.

DEPENDENCIES

  1. Python (version >= 3.6)
  2. Docker
  3. Docker Compose (you can install with pip package manager with the command pip install docker-compose)

NOTES ON DEPENDENCIES

  1. Current user should have access to execute docker commands without sudo. This can be normally achieved in linux with the command below:
    sudo usermod -aG docker $USER
  2. You need to make sure you have the current version of docker-compose installed.

INSTALLATION

pip install dcm-processor

CREATE AN APPLICATION

  1. Run the command below and follow the prompt.
    dcm-processor create app

  2. In case you did not select yes to initialize the application after creation then run the command below to initialize the application.
    dcm-processor init app

START AN APPLICATION

  1. Run the command below and select the application to start it.
    dcm-processor start app

STOP AN APPLICATION

  1. Run the command below and select the application to remove it.
    dcm-processor stop app

CREATE A SERVICE TEMPLATE

  1. Run command below and follow prompt to create a service template.
    dcm-processor create service
  2. Fill in the files in registry folder and copy your source code into the module folder.

Service entry in the registry

  • The settings.json file can either be an object or an array of objects with the following fields:

    • jobName : [string,required] the name of the job, this should be unique from other service jobs.

    • worker : [string,required] name of the function to be run as the worker, this should be a full function name. (see section below for details.).

    • callback : [string,required] name of the function which determines if a job should be scheduled for the current dicom processing or not. (see section below for details).

    • dependsOn : [string/list of string,optional] name(s) of jobs which the current service job depends on. this will make sure that those jobs run successfully before this job runs.

    • priority : [string,optional] the priority level assigned to this job. if not specified a default priority is assigned.

    • timeout : [string/number,optional] the RQ queuing timeout default is 1 hour.

    • params: [object,optional] this is an object with additional parameters that will be sent to the worker function.

    • sortPosition : [number,optional] this is a sorting variable which is used to sort the order in which jobs are scheduled (Note: independent jobs are however scheduled before dependent jobs).

    • description : [string,optional] this is a description for this current job. Its not used in any operation but only for third parties to have an idea what your service does.

  • The python file __init__.py should contain the callback function(s) you stated in the settings.json file

INSTALL SERVICE

  1. Run command below and follow prompt to install a service.
    dcm-processor install service

REMOVE SERVICE

  1. Run command below and follow prompt to remove a service.
    dcm-processor remove service

CREATE WORKER TEMPLATE

  1. Run command below and follow prompt to create a worker template.
    dcm-processor create worker

  2. Fill in the files as follows:

    • The settings.json file can either be an object or an array of objects with the following fields:

      • name : [string,required] the name of the worker, this should be unique from other worker.

      • scripts : [list of shell scripts] scripts that are executed during building of the docker image to install optional packages etc. defaults ["script.sh"] pointing to the default script file in the template.

      • entryScriptPaths : [list of mounted paths] name of docker mounted path which will contain shell script that are executed at the start of the worker. This can be used to executed dynamic shell scripts during container runtime.

      • baseImage : [string, required] name of the base docker image to build the container on. defaults ubuntu:20.04.

      • environments : [list of objects] a list of virtual environment configurations. Each object contains the fields below:

        • name : [string, required] the name of the virtualenv. Should be unique for all virtualenvs in the current worker.

        • requirements: [list of file paths] requirements files with python libraries to be installed in the virtualenv. This is executed during building of the docker image.

        • entryRequirementPaths : [list of mounted paths] List of docker mounted paths which will contain requirements files which can be used to update the python library dynamically. These are executed at the start of the worker during runtime.

        • channels : [list of string] this is the list of service channels that will be executed with this virtualenv.

        • pythonVersion : [string] the version of python to be used for this virtualenv.

    • The script.sh can be used to run any shell commands needed to install extra packages like java, compilers, etc needed to run the service modules.

    • The requirements.txt should be filled with the python libraries needed to run the service modules.

INSTALL WORKER

  1. Run command below and follow prompt to install a worker.
    dcm-processor install worker

REMOVE WORKER

  1. Run command below and follow prompt to remove a worker.
    dcm-processor remove worker

TO DOS

  1. Add documentation for non-interactive (-o) mode.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dcm-processor-1.0.1.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

dcm_processor-1.0.1-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file dcm-processor-1.0.1.tar.gz.

File metadata

  • Download URL: dcm-processor-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.28.2 requests-toolbelt/0.9.1 urllib3/1.26.15 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for dcm-processor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6b7b34a9383995a0ceec3207f89e90061f2408982847243067d83ebe80000903
MD5 e3a351f858e427a1aeec1a95d41d4ae4
BLAKE2b-256 d7a86fa56666e2b968989308194cf132d2bf9aa1558dd0f969eea84141323d9a

See more details on using hashes here.

File details

Details for the file dcm_processor-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dcm_processor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.28.2 requests-toolbelt/0.9.1 urllib3/1.26.15 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for dcm_processor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10b74bd681f6d99a276c13874c927f34d1b178aed8dc9d1e911907f8dcff6843
MD5 b4a1c6763cc4f68592ff4d576259568a
BLAKE2b-256 00c7f78da40ee7e7f5009415570ce69ee33a1560c4763deb5eab12a8d6eeb8ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page