Skip to content

Commit

Permalink
Merge pull request #405 from Emory-HITI/dev
Browse files Browse the repository at this point in the history
Some recent contributions
  • Loading branch information
pradeeban authored May 4, 2023
2 parents a1682b2 + 4a6542d commit 0117cf3
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 2 deletions.
22 changes: 22 additions & 0 deletions modules/cold-extraction/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
25 changes: 25 additions & 0 deletions modules/cold-extraction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,28 @@ nohup /opt/dcm4che-5.22.5/bin/movescu -c "[email protected]: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
```

11 changes: 11 additions & 0 deletions modules/cold-extraction/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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
4 changes: 4 additions & 0 deletions modules/cold-extraction/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schedule
pandas
pynetdicom
pydicom
4 changes: 2 additions & 2 deletions modules/frontend/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
25 changes: 25 additions & 0 deletions modules/meta-extraction/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
11 changes: 11 additions & 0 deletions modules/meta-extraction/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions modules/meta-extraction/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pymongo
pydicom
schedule
pandas
requests

0 comments on commit 0117cf3

Please sign in to comment.