From 85294d579e5425a992938c746e7d07b3d7824d38 Mon Sep 17 00:00:00 2001 From: imiro Date: Mon, 20 Mar 2023 08:06:48 -0500 Subject: [PATCH 1/8] Containerizing meta-extraction module --- modules/meta-extraction/Dockerfile | 25 ++++++++++++++++++++++++ modules/meta-extraction/requirements.txt | 5 +++++ 2 files changed, 30 insertions(+) create mode 100644 modules/meta-extraction/Dockerfile create mode 100644 modules/meta-extraction/requirements.txt diff --git a/modules/meta-extraction/Dockerfile b/modules/meta-extraction/Dockerfile new file mode 100644 index 0000000..52ee809 --- /dev/null +++ b/modules/meta-extraction/Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.10.10-bullseye + +# install JRE for DCM4CHE +RUN set -eux; \ + apt update && \ + apt install -y openjdk-11-jre + +# install DCM4CHE +RUN set -eux; \ + cd /opt; \ + curl -L https://sourceforge.net/projects/dcm4che/files/dcm4che3/5.22.5/dcm4che-5.22.5-bin.zip/download \ + -o dcm4che-5.22.5-bin.zip; \ + unzip dcm4che-5.22.5-bin.zip && \ + rm dcm4che-5.22.5-bin.zip + +COPY . /usr/src/app +WORKDIR /usr/src/app + +# install required python packages +RUN pip install -r requirements.txt + +# create default dicom storage directory +RUN mkdir /opt/niffler-dicom-root + +CMD ["python", "MetadataExtractor.py"] diff --git a/modules/meta-extraction/requirements.txt b/modules/meta-extraction/requirements.txt new file mode 100644 index 0000000..3fdd1db --- /dev/null +++ b/modules/meta-extraction/requirements.txt @@ -0,0 +1,5 @@ +pymongo +pydicom +schedule +pandas +requests From 1e0e96b2bab19b31d46b7ea3757e75151498ba40 Mon Sep 17 00:00:00 2001 From: imiro Date: Mon, 3 Apr 2023 08:17:25 -0500 Subject: [PATCH 2/8] Attempt to containerize cold extraction module --- modules/cold-extraction/Dockerfile | 22 ++++++++++++++++++++++ modules/cold-extraction/docker-compose.yml | 13 +++++++++++++ modules/cold-extraction/requirements.txt | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 modules/cold-extraction/Dockerfile create mode 100644 modules/cold-extraction/docker-compose.yml create mode 100644 modules/cold-extraction/requirements.txt diff --git a/modules/cold-extraction/Dockerfile b/modules/cold-extraction/Dockerfile new file mode 100644 index 0000000..d9fe912 --- /dev/null +++ b/modules/cold-extraction/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.10.10-bullseye + +# download and add DCM4CHE +ADD https://sourceforge.net/projects/dcm4che/files/dcm4che3/5.22.5/dcm4che-5.22.5-bin.zip/download /opt/dcm4che-5.22.5-bin.zip +RUN set -eux; \ +# install JRE for DCM4CHE, mailutils + apt update && \ + apt install -y openjdk-11-jre mailutils && \ +# extract and install DCM4CHE + cd /opt; \ + unzip dcm4che-5.22.5-bin.zip && \ + rm dcm4che-5.22.5-bin.zip; \ +# create default dicom storage directory + mkdir -p /opt/data/new-study + +COPY . /usr/src/niffler-cold-extraction +WORKDIR /usr/src/niffler-cold-extraction + +# install required python packages +RUN pip install -r requirements.txt + +CMD ["python", "ColdDataRetriever.py"] diff --git a/modules/cold-extraction/docker-compose.yml b/modules/cold-extraction/docker-compose.yml new file mode 100644 index 0000000..8bfd287 --- /dev/null +++ b/modules/cold-extraction/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.1' +services: + niffler-cold-extraction: + build: . + volumes: + - ./config.json:/usr/src/niffler-cold-extraction/config.json + - ./system.json:/usr/src/niffler-cold-extraction/system.json + - ./csv/:/usr/src/niffler-cold-extraction/csv/ + - ./storage:/opt/data/new-study + networks: + - default + orthancc: + image: jodogne/orthanc-plugins:1.11.0 diff --git a/modules/cold-extraction/requirements.txt b/modules/cold-extraction/requirements.txt new file mode 100644 index 0000000..b8f06bc --- /dev/null +++ b/modules/cold-extraction/requirements.txt @@ -0,0 +1,2 @@ +schedule +pandas \ No newline at end of file From b194c03f8ca5547d94269b5c622934924e07047b Mon Sep 17 00:00:00 2001 From: imiro Date: Mon, 3 Apr 2023 15:35:55 -0500 Subject: [PATCH 3/8] Add additional requirements --- modules/cold-extraction/requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/cold-extraction/requirements.txt b/modules/cold-extraction/requirements.txt index b8f06bc..3cf9eb9 100644 --- a/modules/cold-extraction/requirements.txt +++ b/modules/cold-extraction/requirements.txt @@ -1,2 +1,4 @@ schedule -pandas \ No newline at end of file +pandas +pynetdicom +pydicom \ No newline at end of file From a96ac983eeaccc0024f65c554bf036908f175af3 Mon Sep 17 00:00:00 2001 From: imiro Date: Mon, 3 Apr 2023 15:45:06 -0500 Subject: [PATCH 4/8] Update README with docker instructions --- modules/cold-extraction/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/cold-extraction/README.md b/modules/cold-extraction/README.md index d8bbd0b..7dfb0f4 100644 --- a/modules/cold-extraction/README.md +++ b/modules/cold-extraction/README.md @@ -345,3 +345,28 @@ nohup /opt/dcm4che-5.22.5/bin/movescu -c "AE_ARCH2@xx.yy.ww.zz:104" -b "QBNIFFLE If the testing with DCM4CHE as above does not work, that is an issue likely with your PACS configuration to send DICOM data to your endpoint. Please get the above to work first in that case before attempting the execution with Niffler. +## Using Docker + +To use as a docker container, first navigate to this directory (`modules/cold-extraction`) and build the image. + +``` +cd modules/cold-extraction +docker build -t niffler/cold-extraction . +``` + +Then, run using the image tag used above. + +``` +docker run --network pacs_network --rm niffler/cold-extraction +``` + +Replace `pacs_network` with the docker network where the PACS is reachable. + +When the configuration or system JSON, as well as the CSV files change, either rebuild the image or mount as a volume before running the container. + +For ease, a docker compose file is also included. After configuring the volumes, networks, and everything else on the `docker-compose.yml` file, simply run: + +``` +docker compose up +``` + From 729869a510373f2542f63967731a17f791f93408 Mon Sep 17 00:00:00 2001 From: imiro Date: Tue, 4 Apr 2023 19:19:13 -0500 Subject: [PATCH 5/8] Remove orthanc from docker compose --- modules/cold-extraction/docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/cold-extraction/docker-compose.yml b/modules/cold-extraction/docker-compose.yml index 8bfd287..3986697 100644 --- a/modules/cold-extraction/docker-compose.yml +++ b/modules/cold-extraction/docker-compose.yml @@ -9,5 +9,3 @@ services: - ./storage:/opt/data/new-study networks: - default - orthancc: - image: jodogne/orthanc-plugins:1.11.0 From ac004e422775cade3ea3785028859c5c2b760367 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Apr 2023 21:46:37 +0000 Subject: [PATCH 6/8] Bump sqlparse from 0.4.2 to 0.4.4 in /modules/frontend Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.4.2 to 0.4.4. - [Release notes](https://github.com/andialbrecht/sqlparse/releases) - [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG) - [Commits](https://github.com/andialbrecht/sqlparse/compare/0.4.2...0.4.4) --- updated-dependencies: - dependency-name: sqlparse dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- modules/frontend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/frontend/requirements.txt b/modules/frontend/requirements.txt index 62b17d1..e570747 100644 --- a/modules/frontend/requirements.txt +++ b/modules/frontend/requirements.txt @@ -21,5 +21,5 @@ pytz==2021.1 schedule==1.1.0 six==1.16.0 SQLAlchemy==1.4.18 -sqlparse==0.4.2 +sqlparse==0.4.4 Werkzeug==2.2.3 From f1cd67ec0ef776661f943c9f60d178d98c6e69a6 Mon Sep 17 00:00:00 2001 From: imiro Date: Wed, 26 Apr 2023 06:31:53 -0500 Subject: [PATCH 7/8] Add docker compose for meta extraction module --- modules/meta-extraction/docker-compose.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 modules/meta-extraction/docker-compose.yml diff --git a/modules/meta-extraction/docker-compose.yml b/modules/meta-extraction/docker-compose.yml new file mode 100644 index 0000000..4e2fff7 --- /dev/null +++ b/modules/meta-extraction/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' +services: + niffler-meta-extraction: + build: . + environment: + MONGO_URI: user:password@mongo:27017 + mongo: + image: mongo:5.0 + environment: + MONGO_INITDB_ROOT_USERNAME: user + MONGO_INITDB_ROOT_PASSWORD: password From 17f4900c525dc9e5ff349eb4f0a5d40f3f344b94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 22:52:23 +0000 Subject: [PATCH 8/8] Bump flask from 2.0.1 to 2.3.2 in /modules/frontend Bumps [flask](https://github.com/pallets/flask) from 2.0.1 to 2.3.2. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.0.1...2.3.2) --- updated-dependencies: - dependency-name: flask dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- modules/frontend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/frontend/requirements.txt b/modules/frontend/requirements.txt index 62b17d1..aed5262 100644 --- a/modules/frontend/requirements.txt +++ b/modules/frontend/requirements.txt @@ -1,7 +1,7 @@ bidict==0.21.2 click==8.0.1 colorama==0.4.4 -Flask==2.0.1 +Flask==2.3.2 Flask-Login==0.5.0 Flask-SocketIO==4.3.2 Flask-SQLAlchemy==2.5.1