Spaces:
Paused
Paused
new build
Browse files- Dockerfile +13 -1
- build-ohfiv3.sh +23 -0
- monai_label.js +38 -0
- nginx.conf +26 -13
- run.sh +1 -1
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
TZ=America/Los_Angeles
|
@@ -57,6 +57,15 @@ ENV HOME=/home/user \
|
|
57 |
RUN monailabel apps --name radiology --download --output apps
|
58 |
RUN monailabel datasets --download --name Task09_Spleen --output datasets
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
# RUN monailabel datasets --download --name Task01_BrainTumour --output datasets
|
61 |
# RUN monailabel datasets --download --name Task09_Spleen --output .
|
62 |
# RUN plastimatch convert --patient-id patient1 --input Task09_Spleen/imagesTs/spleen_1.nii.gz --output-dicom dicom_output
|
@@ -66,6 +75,8 @@ RUN monailabel datasets --download --name Task09_Spleen --output datasets
|
|
66 |
|
67 |
# /etc/orthanc/orthanc.json -> "RemoteAccessAllowed": false, -> "RemoteAccessAllowed": true,
|
68 |
# RUN sed -i 's/"RemoteAccessAllowed" : false,/"RemoteAccessAllowed" : true,/g' /etc/orthanc/orthanc.json
|
|
|
|
|
69 |
USER root
|
70 |
RUN mkdir -p /var/cache/orthanc /var/log/orthanc /var/lib/orthanc && \
|
71 |
chown -R user:user /var/cache/orthanc /var/log/orthanc /usr/share/orthanc/ /var/lib/orthanc /etc/orthanc && \
|
@@ -75,6 +86,7 @@ RUN mkdir -p /var/cache/orthanc /var/log/orthanc /var/lib/orthanc && \
|
|
75 |
|
76 |
COPY --chown=user orthanc.json /etc/orthanc/orthanc.json
|
77 |
COPY --chown=user nginx.conf /etc/nginx/sites-available/default
|
|
|
78 |
|
79 |
USER user
|
80 |
COPY --chown=user run.sh .
|
|
|
1 |
+
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04 as base
|
2 |
|
3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
4 |
TZ=America/Los_Angeles
|
|
|
57 |
RUN monailabel apps --name radiology --download --output apps
|
58 |
RUN monailabel datasets --download --name Task09_Spleen --output datasets
|
59 |
|
60 |
+
# build ohifv3 viewer
|
61 |
+
FROM node:18.16.1-slim as builder
|
62 |
+
RUN apt-get update && apt-get install -y build-essential yarn git && rm -rf /var/lib/apt/lists/*
|
63 |
+
WORKDIR /code
|
64 |
+
RUN git clone https://github.com/Project-MONAI/MONAILabel.git .
|
65 |
+
WORKDIR /code/plugins/ohifv3
|
66 |
+
COPY build-ohfiv3.sh monai_label.js /code/plugins/ohifv3/
|
67 |
+
RUN ./build-ohfiv3.sh
|
68 |
+
|
69 |
# RUN monailabel datasets --download --name Task01_BrainTumour --output datasets
|
70 |
# RUN monailabel datasets --download --name Task09_Spleen --output .
|
71 |
# RUN plastimatch convert --patient-id patient1 --input Task09_Spleen/imagesTs/spleen_1.nii.gz --output-dicom dicom_output
|
|
|
75 |
|
76 |
# /etc/orthanc/orthanc.json -> "RemoteAccessAllowed": false, -> "RemoteAccessAllowed": true,
|
77 |
# RUN sed -i 's/"RemoteAccessAllowed" : false,/"RemoteAccessAllowed" : true,/g' /etc/orthanc/orthanc.json
|
78 |
+
FROM base as final
|
79 |
+
|
80 |
USER root
|
81 |
RUN mkdir -p /var/cache/orthanc /var/log/orthanc /var/lib/orthanc && \
|
82 |
chown -R user:user /var/cache/orthanc /var/log/orthanc /usr/share/orthanc/ /var/lib/orthanc /etc/orthanc && \
|
|
|
86 |
|
87 |
COPY --chown=user orthanc.json /etc/orthanc/orthanc.json
|
88 |
COPY --chown=user nginx.conf /etc/nginx/sites-available/default
|
89 |
+
COPY --from=builder --chown=user /code/plugins/ohifv3/Viewers/platform/app/dist/ /usr/share/nginx/html
|
90 |
|
91 |
USER user
|
92 |
COPY --chown=user run.sh .
|
build-ohfiv3.sh
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
git clone https://github.com/OHIF/Viewers.git
|
4 |
+
cd Viewers
|
5 |
+
git checkout 33f125940863607f8dba82c71b27a43f35431dd5
|
6 |
+
|
7 |
+
#cp -r ../extensions/monai-label extensions/
|
8 |
+
#cp -r ../modes/monai-label modes/monai-label
|
9 |
+
cd extensions
|
10 |
+
ln -s ../../extensions/monai-label monai-label
|
11 |
+
cd ..
|
12 |
+
|
13 |
+
cd modes
|
14 |
+
ln -s ../../modes/monai-label monai-label
|
15 |
+
cd ..
|
16 |
+
|
17 |
+
git apply ../extensions.patch
|
18 |
+
|
19 |
+
cp ../monai_label.js platform/app/public/config/monai_label.js
|
20 |
+
|
21 |
+
yarn config set workspaces-experimental true
|
22 |
+
yarn install --frozen-lockfile --verbose
|
23 |
+
APP_CONFIG=config/monai_label.js PUBLIC_URL=/ QUICK_BUILD=true yarn run build
|
monai_label.js
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
window.config = {
|
2 |
+
routerBasename: '/',
|
3 |
+
showStudyList: true,
|
4 |
+
extensions: [],
|
5 |
+
modes: [],
|
6 |
+
// below flag is for performance reasons, but it might not work for all servers
|
7 |
+
|
8 |
+
showWarningMessageForCrossOrigin: true,
|
9 |
+
showCPUFallbackMessage: true,
|
10 |
+
showLoadingIndicator: true,
|
11 |
+
strictZSpacingForVolumeViewport: true,
|
12 |
+
defaultDataSourceName: 'dicomweb',
|
13 |
+
useSharedArrayBuffer: 'FALSE',
|
14 |
+
dataSources: [
|
15 |
+
{
|
16 |
+
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
|
17 |
+
sourceName: 'dicomweb',
|
18 |
+
configuration: {
|
19 |
+
friendlyName: 'Orthanc Server',
|
20 |
+
name: 'Orthanc',
|
21 |
+
wadoUriRoot: 'orthanc/dicom-web/wado',
|
22 |
+
qidoRoot: 'orthanc/dicom-web/qido',
|
23 |
+
wadoRoot: 'orthanc/dicom-web/wado',
|
24 |
+
qidoSupportsIncludeField: true,
|
25 |
+
supportsReject: true,
|
26 |
+
imageRendering: 'wadors',
|
27 |
+
thumbnailRendering: 'wadors',
|
28 |
+
enableStudyLazyLoad: false,
|
29 |
+
supportsFuzzyMatching: true,
|
30 |
+
supportsWildcard: true,
|
31 |
+
dicomUploadEnabled: true,
|
32 |
+
bulkDataURI: {
|
33 |
+
enabled: true,
|
34 |
+
},
|
35 |
+
},
|
36 |
+
},
|
37 |
+
],
|
38 |
+
};
|
nginx.conf
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
server {
|
2 |
listen 4444 default_server;
|
3 |
server_name _;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# location / {
|
6 |
# # Proxy pass to the app at /ohif
|
@@ -18,19 +31,19 @@ server {
|
|
18 |
# # Handling URI
|
19 |
# proxy_set_header X-Forwarded-Prefix "/";
|
20 |
# }
|
21 |
-
location / {
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
}
|
34 |
location /orthanc {
|
35 |
# Serve backend from port
|
36 |
proxy_pass http://0.0.0.0:8042;
|
|
|
1 |
server {
|
2 |
listen 4444 default_server;
|
3 |
server_name _;
|
4 |
+
location / {
|
5 |
+
root /usr/share/nginx/html;
|
6 |
+
index index.html index.htm;
|
7 |
+
try_files $uri $uri/ /index.html;
|
8 |
+
add_header Cross-Origin-Opener-Policy same-origin;
|
9 |
+
add_header Cross-Origin-Embedder-Policy require-corp;
|
10 |
+
add_header Cross-Origin-Resource-Policy cross-origin;
|
11 |
+
proxy_set_header Host $host;
|
12 |
+
proxy_set_header X-Real-IP $remote_addr;
|
13 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
14 |
+
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
15 |
+
}
|
16 |
+
|
17 |
|
18 |
# location / {
|
19 |
# # Proxy pass to the app at /ohif
|
|
|
31 |
# # Handling URI
|
32 |
# proxy_set_header X-Forwarded-Prefix "/";
|
33 |
# }
|
34 |
+
# location / {
|
35 |
+
# # Proxy pass to the app at /ohif
|
36 |
+
# proxy_pass http://0.0.0.0:8000;
|
37 |
+
# proxy_http_version 1.1;
|
38 |
+
# proxy_set_header Upgrade $http_upgrade;
|
39 |
+
# proxy_set_header Connection 'upgrade';
|
40 |
+
# proxy_set_header Host $host;
|
41 |
+
# proxy_set_header X-Real-IP $remote_addr;
|
42 |
+
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
43 |
+
# proxy_cache_bypass $http_upgrade;
|
44 |
+
# proxy_read_timeout 86400;
|
45 |
+
# proxy_redirect off;
|
46 |
+
# }
|
47 |
location /orthanc {
|
48 |
# Serve backend from port
|
49 |
proxy_pass http://0.0.0.0:8042;
|
run.sh
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Start the orthanc service
|
4 |
-
|
5 |
Orthanc /etc/orthanc/orthanc.json &
|
6 |
|
7 |
# for i in ls datasets/Task09_Spleen/imagesTs/*.nii.gz; do
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
# Start the orthanc service
|
4 |
+
nginx &
|
5 |
Orthanc /etc/orthanc/orthanc.json &
|
6 |
|
7 |
# for i in ls datasets/Task09_Spleen/imagesTs/*.nii.gz; do
|