radames commited on
Commit
7857181
1 Parent(s): d1b16af
Files changed (7) hide show
  1. .gitignore +1 -0
  2. Dockerfile +82 -0
  3. README.md +1 -0
  4. nginx.conf +51 -0
  5. orthanc.json +438 -0
  6. requirements.txt +1 -0
  7. run.sh +12 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ venv
Dockerfile ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ TZ=America/Los_Angeles
5
+
6
+ USER root
7
+ RUN apt-get update && apt-get install -y \
8
+ git \
9
+ make build-essential libssl-dev zlib1g-dev \
10
+ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
11
+ libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs \
12
+ cmake-curses-gui cmake libinsighttoolkit4-dev libfftw3-dev libvtk7-dev \
13
+ ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx lsof \
14
+ orthanc orthanc-dicomweb vim \
15
+ nginx \
16
+ && rm -rf /var/lib/apt/lists/* \
17
+ && git lfs install
18
+
19
+ # install plastimatch
20
+ RUN git clone https://gitlab.com/plastimatch/plastimatch && cd plastimatch && mkdir build && cd build && cmake .. && make -j$(nproc) && make install
21
+
22
+ WORKDIR /code
23
+
24
+ COPY ./requirements.txt /code/requirements.txt
25
+
26
+ # User
27
+ RUN useradd -m -u 1000 user
28
+ ENV HOME=/home/user \
29
+ PATH=/home/user/.local/bin:$PATH
30
+
31
+ USER user
32
+
33
+ # Pyenv
34
+ RUN curl https://pyenv.run | bash
35
+ ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
36
+
37
+ ARG PYTHON_VERSION=3.10.13
38
+ # Python
39
+ RUN pyenv install $PYTHON_VERSION && \
40
+ pyenv global $PYTHON_VERSION && \
41
+ pyenv rehash && \
42
+ pip install --no-cache-dir --upgrade pip setuptools wheel && \
43
+ pip install --no-cache-dir \
44
+ datasets \
45
+ huggingface-hub "protobuf<4" "click<8.1"
46
+
47
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
48
+
49
+ # Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app
50
+ WORKDIR $HOME/app
51
+
52
+ ENV HOME=/home/user \
53
+ PATH=/home/user/.local/bin:$PATH \
54
+ PYTHONPATH=$HOME/app \
55
+ PYTHONUNBUFFERED=1
56
+
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
63
+ # monailabel start_server --app apps/radiology --studies http://127.0.0.1:8042/dicom-web --conf models deepedit
64
+ # CMD ["monailabel", "start_server", "--app", "apps/radiology", "--studies", "http://0.0.0.0:8042/dicom-web", "--conf" , "models", "deepedit"]
65
+ # CMD ["monailabel", "start_server", "--app", "apps/radiology", "--studies", "datasets/Task01_BrainTumour/imagesTr", "--conf" , "models", "deepedit"]
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 && \
72
+ mkdir -p /var/cache/nginx /var/log/nginx /var/lib/nginx && \
73
+ touch /var/run/nginx.pid && \
74
+ chown -R user:user /var/cache/nginx /var/log/nginx /var/lib/nginx /var/run/nginx.pid
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 .
81
+ CMD ["sh", "run.sh"]
82
+ # monailabel start_server --app apps/radiology --studies datasets/Task01_BrainTumour/imagesTr --conf models deepedit
README.md CHANGED
@@ -5,6 +5,7 @@ colorFrom: purple
5
  colorTo: purple
6
  sdk: docker
7
  pinned: false
 
8
  ---
9
 
10
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
5
  colorTo: purple
6
  sdk: docker
7
  pinned: false
8
+ app_port: 8000
9
  ---
10
 
11
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
nginx.conf ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 4444 default_server;
3
+ server_name _;
4
+
5
+ # location / {
6
+ # # Proxy pass to the app at /ohif
7
+ # proxy_pass http://0.0.0.0:8000/ohif/;
8
+ # proxy_http_version 1.1;
9
+ # proxy_set_header Upgrade $http_upgrade;
10
+ # proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
15
+ # proxy_read_timeout 86400;
16
+ # proxy_redirect off;
17
+
18
+ # # Handling URI
19
+ # proxy_set_header X-Forwarded-Prefix "/";
20
+ # }
21
+ location / {
22
+ # Proxy pass to the app at /ohif
23
+ proxy_pass http://0.0.0.0:8000;
24
+ proxy_http_version 1.1;
25
+ proxy_set_header Upgrade $http_upgrade;
26
+ proxy_set_header Connection 'upgrade';
27
+ proxy_set_header Host $host;
28
+ proxy_set_header X-Real-IP $remote_addr;
29
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
+ proxy_cache_bypass $http_upgrade;
31
+ proxy_read_timeout 86400;
32
+ proxy_redirect off;
33
+ }
34
+ location /orthanc {
35
+ # Serve backend from port
36
+ proxy_pass http://0.0.0.0:8042;
37
+ rewrite /orthanc(.*) $1 break;
38
+ proxy_http_version 1.1;
39
+ proxy_set_header Upgrade $http_upgrade;
40
+ proxy_set_header Connection 'upgrade';
41
+ proxy_set_header Host $host;
42
+ proxy_set_header X-Real-IP $remote_addr;
43
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
44
+ proxy_cache_bypass $http_upgrade;
45
+ proxy_read_timeout 86400;
46
+ proxy_redirect off;
47
+ proxy_request_buffering off;
48
+ proxy_max_temp_file_size 0;
49
+ client_max_body_size 0;
50
+ }
51
+ }
orthanc.json ADDED
@@ -0,0 +1,438 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ /**
3
+ * General configuration of Orthanc
4
+ **/
5
+ // The logical name of this instance of Orthanc. This one is
6
+ // displayed in Orthanc Explorer and at the URI "/system".
7
+ "Name": "Orthanc",
8
+ // Path to the directory that holds the heavyweight files (i.e. the
9
+ // raw DICOM instances). Backslashes must be either escaped by
10
+ // doubling them, or replaced by forward slashes "/".
11
+ "StorageDirectory": "/var/lib/orthanc/db-v6",
12
+ // Path to the directory that holds the SQLite index (if unset, the
13
+ // value of StorageDirectory is used). This index could be stored on
14
+ // a RAM-drive or a SSD device for performance reasons.
15
+ "IndexDirectory": "/var/lib/orthanc/db-v6",
16
+ // Path to the directory where Orthanc stores its large temporary
17
+ // files. The content of this folder can be safely deleted if
18
+ // Orthanc once stopped. The folder must exist. The corresponding
19
+ // filesystem must be properly sized, given that for instance a ZIP
20
+ // archive of DICOM images created by a job can weight several GBs,
21
+ // and that there might be up to "min(JobsHistorySize,
22
+ // MediaArchiveSize)" archives to be stored simultaneously. If not
23
+ // set, Orthanc will use the default temporary folder of the
24
+ // operating system (such as "/tmp/" on UNIX-like systems, or
25
+ // "C:/Temp" on Microsoft Windows).
26
+ // "TemporaryDirectory" : "/tmp/Orthanc/",
27
+ // Enable the transparent compression of the DICOM instances
28
+ "StorageCompression": false,
29
+ // Maximum size of the storage in MB (a value of "0" indicates no
30
+ // limit on the storage size)
31
+ "MaximumStorageSize": 0,
32
+ // Maximum number of patients that can be stored at a given time
33
+ // in the storage (a value of "0" indicates no limit on the number
34
+ // of patients)
35
+ "MaximumPatientCount": 0,
36
+ // List of paths to the custom Lua scripts that are to be loaded
37
+ // into this instance of Orthanc
38
+ "LuaScripts": [],
39
+ // List of paths to the plugins that are to be loaded into this
40
+ // instance of Orthanc (e.g. "./libPluginTest.so" for Linux, or
41
+ // "./PluginTest.dll" for Windows). These paths can refer to
42
+ // folders, in which case they will be scanned non-recursively to
43
+ // find shared libraries. Backslashes must be either escaped by
44
+ // doubling them, or replaced by forward slashes "/".
45
+ "Plugins": [
46
+ "/usr/share/orthanc/plugins/"
47
+ ],
48
+ // Maximum number of processing jobs that are simultaneously running
49
+ // at any given time. A value of "0" indicates to use all the
50
+ // available CPU logical cores. To emulate Orthanc <= 1.3.2, set
51
+ // this value to "1".
52
+ "ConcurrentJobs": 2,
53
+ /**
54
+ * Configuration of the HTTP server
55
+ **/
56
+ // Enable the HTTP server. If this parameter is set to "false",
57
+ // Orthanc acts as a pure DICOM server. The REST API and Orthanc
58
+ // Explorer will not be available.
59
+ "HttpServerEnabled": true,
60
+ // HTTP port for the REST services and for the GUI
61
+ "HttpPort": 8042,
62
+ // When the following option is "true", if an error is encountered
63
+ // while calling the REST API, a JSON message describing the error
64
+ // is put in the HTTP answer. This feature can be disabled if the
65
+ // HTTP client does not properly handles such answers.
66
+ "HttpDescribeErrors": true,
67
+ // Enable HTTP compression to improve network bandwidth utilization,
68
+ // at the expense of more computations on the server. Orthanc
69
+ // supports the "gzip" and "deflate" HTTP encodings.
70
+ "HttpCompressionEnabled": true,
71
+ /**
72
+ * Configuration of the DICOM server
73
+ **/
74
+ // Enable the DICOM server. If this parameter is set to "false",
75
+ // Orthanc acts as a pure REST server. It will not be possible to
76
+ // receive files or to do query/retrieve through the DICOM protocol.
77
+ "DicomServerEnabled": true,
78
+ // The DICOM Application Entity Title
79
+ "DicomAet": "ORTHANC",
80
+ // Check whether the called AET corresponds to the AET of Orthanc
81
+ // during an incoming DICOM SCU request
82
+ "DicomCheckCalledAet": false,
83
+ // The DICOM port
84
+ "DicomPort": 4242,
85
+ // The default encoding that is assumed for DICOM files without
86
+ // "SpecificCharacterSet" DICOM tag, and that is used when answering
87
+ // C-Find requests (including worklists). The allowed values are
88
+ // "Ascii", "Utf8", "Latin1", "Latin2", "Latin3", "Latin4",
89
+ // "Latin5", "Cyrillic", "Windows1251", "Arabic", "Greek", "Hebrew",
90
+ // "Thai", "Japanese", "Chinese", "JapaneseKanji", "Korean", and
91
+ // "SimplifiedChinese".
92
+ "DefaultEncoding": "Latin1",
93
+ // The transfer syntaxes that are accepted by Orthanc C-Store SCP
94
+ "DeflatedTransferSyntaxAccepted": true,
95
+ "JpegTransferSyntaxAccepted": true,
96
+ "Jpeg2000TransferSyntaxAccepted": true,
97
+ "JpegLosslessTransferSyntaxAccepted": true,
98
+ "JpipTransferSyntaxAccepted": true,
99
+ "Mpeg2TransferSyntaxAccepted": true,
100
+ "RleTransferSyntaxAccepted": true,
101
+ // Whether Orthanc accepts to act as C-Store SCP for unknown storage
102
+ // SOP classes (aka. "promiscuous mode")
103
+ "UnknownSopClassAccepted": false,
104
+ // Set the timeout (in seconds) after which the DICOM associations
105
+ // are closed by the Orthanc SCP (server) if no further DIMSE
106
+ // command is received from the SCU (client).
107
+ "DicomScpTimeout": 30,
108
+ /**
109
+ * Security-related options for the HTTP server
110
+ **/
111
+ // Whether remote hosts can connect to the HTTP server
112
+ "RemoteAccessAllowed": true,
113
+ // Whether or not SSL is enabled
114
+ "SslEnabled": false,
115
+ // Path to the SSL certificate in the PEM format (meaningful only if
116
+ // SSL is enabled)
117
+ "SslCertificate": "certificate.pem",
118
+ // Whether or not the password protection is enabled (using HTTP
119
+ // basic access authentication). Starting with Orthanc 1.5.8, if
120
+ // "AuthenticationEnabled" is not explicitly set, authentication is
121
+ // enabled iff. remote access is allowed (i.e. the default value of
122
+ // "AuthenticationEnabled" equals that of "RemoteAccessAllowed").
123
+ "AuthenticationEnabled": false,
124
+ // The list of the registered users. Because Orthanc uses HTTP
125
+ // Basic Authentication, the passwords are stored as plain text.
126
+ "RegisteredUsers": {
127
+ // "alice" : "alicePassword"
128
+ },
129
+ /**
130
+ * Network topology
131
+ **/
132
+ // The list of the known DICOM modalities
133
+ "DicomModalities": {
134
+ /**
135
+ * Uncommenting the following line would enable Orthanc to
136
+ * connect to an instance of the "storescp" open-source DICOM
137
+ * store (shipped in the DCMTK distribution) started by the
138
+ * command line "storescp 2000".
139
+ **/
140
+ // "sample" : [ "STORESCP", "127.0.0.1", 2000 ]
141
+ "sample": [
142
+ "MONAILABEL",
143
+ "0.0.0.0",
144
+ 104
145
+ ]
146
+ /**
147
+ * A fourth parameter is available to enable patches for
148
+ * specific PACS manufacturers. The allowed values are currently:
149
+ * - "Generic" (default value),
150
+ * - "GenericNoWildcardInDates" (to replace "*" by "" in date fields
151
+ * in outgoing C-Find requests originating from Orthanc),
152
+ * - "GenericNoUniversalWildcard" (to replace "*" by "" in all fields
153
+ * in outgoing C-Find SCU requests originating from Orthanc),
154
+ * - "StoreScp" (storescp tool from DCMTK),
155
+ * - "ClearCanvas",
156
+ * - "Dcm4Chee",
157
+ * - "Vitrea",
158
+ * - "GE" (Enterprise Archive, MRI consoles and Advantage Workstation
159
+ * from GE Healthcare).
160
+ *
161
+ * This parameter is case-sensitive.
162
+ **/
163
+ // "clearcanvas" : [ "CLEARCANVAS", "192.168.1.1", 104, "ClearCanvas" ]
164
+ /**
165
+ * By default, the Orthanc SCP accepts all DICOM commands (C-ECHO,
166
+ * C-STORE, C-FIND, C-MOVE) issued by the registered remote SCU
167
+ * modalities. Starting with Orthanc 1.5.0, it is possible to
168
+ * specify which DICOM commands are allowed, separately for each
169
+ * remote modality, using the syntax below. The "AllowEcho" (resp.
170
+ * "AllowStore") option only has an effect respectively if global
171
+ * option "DicomAlwaysAllowEcho" (resp. "DicomAlwaysAllowStore")
172
+ * is set to false.
173
+ **/
174
+ //"untrusted" : {
175
+ // "AET" : "ORTHANC",
176
+ // "Port" : 104,
177
+ // "Host" : "127.0.0.1",
178
+ // "AllowEcho" : false,
179
+ // "AllowFind" : false,
180
+ // "AllowMove" : false,
181
+ // "AllowStore" : true
182
+ //}
183
+ },
184
+ // Whether to store the DICOM modalities in the Orthanc database
185
+ // instead of in this configuration file (new in Orthanc 1.5.0)
186
+ "DicomModalitiesInDatabase": false,
187
+ // Whether the Orthanc SCP allows incoming C-Echo requests, even
188
+ // from SCU modalities it does not know about (i.e. that are not
189
+ // listed in the "DicomModalities" option above). Orthanc 1.3.0
190
+ // is the only version to behave as if this argument was set to "false".
191
+ "DicomAlwaysAllowEcho": true,
192
+ // Whether the Orthanc SCP allows incoming C-Store requests, even
193
+ // from SCU modalities it does not know about (i.e. that are not
194
+ // listed in the "DicomModalities" option above)
195
+ "DicomAlwaysAllowStore": true,
196
+ // Whether Orthanc checks the IP/hostname address of the remote
197
+ // modality initiating a DICOM connection (as listed in the
198
+ // "DicomModalities" option above). If this option is set to
199
+ // "false", Orthanc only checks the AET of the remote modality.
200
+ "DicomCheckModalityHost": false,
201
+ // The timeout (in seconds) after which the DICOM associations are
202
+ // considered as closed by the Orthanc SCU (client) if the remote
203
+ // DICOM SCP (server) does not answer.
204
+ "DicomScuTimeout": 10,
205
+ // The list of the known Orthanc peers
206
+ "OrthancPeers": {
207
+ /**
208
+ * Each line gives the base URL of an Orthanc peer, possibly
209
+ * followed by the username/password pair (if the password
210
+ * protection is enabled on the peer).
211
+ **/
212
+ // "peer" : [ "http://127.0.0.1:8043/", "alice", "alicePassword" ]
213
+ // "peer2" : [ "http://127.0.0.1:8044/" ]
214
+ /**
215
+ * This is another, more advanced format to define Orthanc
216
+ * peers. It notably allows to specify HTTP headers, a HTTPS
217
+ * client certificate in the PEM format (as in the "--cert" option
218
+ * of curl), or to enable PKCS#11 authentication for smart cards.
219
+ **/
220
+ // "peer" : {
221
+ // "Url" : "http://127.0.0.1:8043/",
222
+ // "Username" : "alice",
223
+ // "Password" : "alicePassword",
224
+ // "HttpHeaders" : { "Token" : "Hello world" },
225
+ // "CertificateFile" : "client.crt",
226
+ // "CertificateKeyFile" : "client.key",
227
+ // "CertificateKeyPassword" : "certpass",
228
+ // "Pkcs11" : false
229
+ // }
230
+ },
231
+ // Whether to store the Orthanc peers in the Orthanc database
232
+ // instead of in this configuration file (new in Orthanc 1.5.0)
233
+ "OrthancPeersInDatabase": false,
234
+ // Parameters of the HTTP proxy to be used by Orthanc. If set to the
235
+ // empty string, no HTTP proxy is used. For instance:
236
+ // "HttpProxy" : "192.168.0.1:3128"
237
+ // "HttpProxy" : "proxyUser:proxyPassword@192.168.0.1:3128"
238
+ "HttpProxy": "",
239
+ // If set to "true", debug messages from libcurl will be issued
240
+ // whenever Orthanc makes an outgoing HTTP request. This is notably
241
+ // useful to debug HTTPS-related problems.
242
+ "HttpVerbose": false,
243
+ // Set the timeout for HTTP requests issued by Orthanc (in seconds).
244
+ "HttpTimeout": 60,
245
+ // Enable the verification of the peers during HTTPS requests. This
246
+ // option must be set to "false" if using self-signed certificates.
247
+ // Pay attention that setting this option to "false" results in
248
+ // security risks!
249
+ // Reference: http://curl.haxx.se/docs/sslcerts.html
250
+ "HttpsVerifyPeers": true,
251
+ // Path to the CA (certification authority) certificates to validate
252
+ // peers in HTTPS requests. From curl documentation ("--cacert"
253
+ // option): "Tells curl to use the specified certificate file to
254
+ // verify the peers. The file may contain multiple CA
255
+ // certificates. The certificate(s) must be in PEM format." On
256
+ // Debian-based systems, this option can be set to
257
+ // "/etc/ssl/certs/ca-certificates.crt"
258
+ "HttpsCACertificates": "",
259
+ /**
260
+ * Advanced options
261
+ **/
262
+ // Dictionary of symbolic names for the user-defined metadata. Each
263
+ // entry must map an unique string to an unique number between 1024
264
+ // and 65535. Reserved values:
265
+ // - The Orthanc whole-slide imaging plugin uses metadata 4200
266
+ "UserMetadata": {
267
+ // "Sample" : 1024
268
+ },
269
+ // Dictionary of symbolic names for the user-defined types of
270
+ // attached files. Each entry must map an unique string to an unique
271
+ // number between 1024 and 65535. Optionally, a second argument can
272
+ // provided to specify a MIME content type for the attachment.
273
+ "UserContentType": {
274
+ // "sample" : 1024
275
+ // "sample2" : [ 1025, "application/pdf" ]
276
+ },
277
+ // Number of seconds without receiving any instance before a
278
+ // patient, a study or a series is considered as stable.
279
+ "StableAge": 60,
280
+ // By default, Orthanc compares AET (Application Entity Titles) in a
281
+ // case-insensitive way. Setting this option to "true" will enable
282
+ // case-sensitive matching.
283
+ "StrictAetComparison": false,
284
+ // When the following option is "true", the MD5 of the DICOM files
285
+ // will be computed and stored in the Orthanc database. This
286
+ // information can be used to detect disk corruption, at the price
287
+ // of a small performance overhead.
288
+ "StoreMD5ForAttachments": true,
289
+ // The maximum number of results for a single C-FIND request at the
290
+ // Patient, Study or Series level. Setting this option to "0" means
291
+ // no limit.
292
+ "LimitFindResults": 0,
293
+ // The maximum number of results for a single C-FIND request at the
294
+ // Instance level. Setting this option to "0" means no limit.
295
+ "LimitFindInstances": 0,
296
+ // The maximum number of active jobs in the Orthanc scheduler. When
297
+ // this limit is reached, the addition of new jobs is blocked until
298
+ // some job finishes.
299
+ "LimitJobs": 10,
300
+ // If this option is set to "true" (default behavior until Orthanc
301
+ // 1.3.2), Orthanc will log the resources that are exported to other
302
+ // DICOM modalities or Orthanc peers, inside the URI
303
+ // "/exports". Setting this option to "false" is useful to prevent
304
+ // the index to grow indefinitely in auto-routing tasks (this is the
305
+ // default behavior since Orthanc 1.4.0).
306
+ "LogExportedResources": false,
307
+ // Enable or disable HTTP Keep-Alive (persistent HTTP
308
+ // connections). Setting this option to "true" prevents Orthanc
309
+ // issue #32 ("HttpServer does not support multiple HTTP requests in
310
+ // the same TCP stream"), but can possibly slow down HTTP clients
311
+ // that do not support persistent connections. The default behavior
312
+ // used to be "false" in Orthanc <= 1.5.1. Setting this option to
313
+ // "false" is also recommended if Orthanc is compiled against
314
+ // Mongoose.
315
+ "KeepAlive": true,
316
+ // Enable or disable Nagle's algorithm. Only taken into
317
+ // consideration if Orthanc is compiled to use CivetWeb. Experiments
318
+ // show that best performance can be obtained by setting both
319
+ // "KeepAlive" and "TcpNoDelay" to "true". Beware however of
320
+ // caveats: https://eklitzke.org/the-caveats-of-tcp-nodelay
321
+ "TcpNoDelay": true,
322
+ // Number of threads that are used by the embedded HTTP server.
323
+ "HttpThreadsCount": 50,
324
+ // If this option is set to "false", Orthanc will run in index-only
325
+ // mode. The DICOM files will not be stored on the drive. Note that
326
+ // this option might prevent the upgrade to newer versions of Orthanc.
327
+ "StoreDicom": true,
328
+ // DICOM associations initiated by Lua scripts are kept open as long
329
+ // as new DICOM commands are issued. This option sets the number of
330
+ // seconds of inactivity to wait before automatically closing a
331
+ // DICOM association used by Lua. If set to 0, the connection is
332
+ // closed immediately.
333
+ "DicomAssociationCloseDelay": 5,
334
+ // Maximum number of query/retrieve DICOM requests that are
335
+ // maintained by Orthanc. The least recently used requests get
336
+ // deleted as new requests are issued.
337
+ "QueryRetrieveSize": 100,
338
+ // When handling a C-Find SCP request, setting this flag to "true"
339
+ // will enable case-sensitive match for PN value representation
340
+ // (such as PatientName). By default, the search is
341
+ // case-insensitive, which does not follow the DICOM standard.
342
+ "CaseSensitivePN": false,
343
+ // Configure PKCS#11 to use hardware security modules (HSM) and
344
+ // smart cards when carrying on HTTPS client authentication.
345
+ /**
346
+ "Pkcs11" : {
347
+ "Module" : "/usr/local/lib/libbeidpkcs11.so",
348
+ "Module" : "C:/Windows/System32/beidpkcs11.dll",
349
+ "Pin" : "1234",
350
+ "Verbose" : true
351
+ }
352
+ **/
353
+ // If set to "false", Orthanc will not load its default dictionary
354
+ // of private tags. This might be necessary if you cannot import a
355
+ // DICOM file encoded using the Implicit VR Endian transfer syntax,
356
+ // and containing private tags: Such an import error might stem from
357
+ // a bad dictionary. You can still list your private tags of
358
+ // interest in the "Dictionary" configuration option below.
359
+ "LoadPrivateDictionary": true,
360
+ // Locale to be used by Orthanc. Currently, only used if comparing
361
+ // strings in a case-insensitive way. It should be safe to keep this
362
+ // value undefined, which lets Orthanc autodetect the suitable locale.
363
+ // "Locale" : "en_US.UTF-8",
364
+ // Register a new tag in the dictionary of DICOM tags that are known
365
+ // to Orthanc. Each line must contain the tag (formatted as 2
366
+ // hexadecimal numbers), the value representation (2 upcase
367
+ // characters), a nickname for the tag, possibly the minimum
368
+ // multiplicity (> 0 with defaults to 1), possibly the maximum
369
+ // multiplicity (0 means arbitrary multiplicity, defaults to 1), and
370
+ // possibly the Private Creator (for private tags).
371
+ "Dictionary": {
372
+ // "0014,1020" : [ "DA", "ValidationExpiryDate", 1, 1 ]
373
+ // "00e1,10c2" : [ "UI", "PET-CT Multi Modality Name", 1, 1, "ELSCINT1" ]
374
+ // "7053,1003" : [ "ST", "Original Image Filename", 1, 1, "Philips PET Private Group" ]
375
+ // "2001,5f" : [ "SQ", "StackSequence", 1, 1, "Philips Imaging DD 001" ]
376
+ },
377
+ // Whether to run DICOM C-Move operations synchronously. If set to
378
+ // "false" (asynchronous mode), each incoming C-Move request results
379
+ // in the creation of a new background job. Up to Orthanc 1.3.2, the
380
+ // implicit behavior was to use synchronous C-Move ("true"). Between
381
+ // Orthanc 1.4.0 and 1.4.2, the default behavior was set to
382
+ // asynchronous C-Move ("false"). Since Orthanc 1.5.0, the default
383
+ // behavior is back to synchronous C-Move ("true", which ensures
384
+ // backward compatibility with Orthanc <= 1.3.2).
385
+ "SynchronousCMove": true,
386
+ // Maximum number of completed jobs that are kept in memory. A
387
+ // processing job is considered as complete once it is tagged as
388
+ // "Success" or "Failure". Since Orthanc 1.5.0, a value of "0"
389
+ // indicates to keep no job in memory (i.e. jobs are removed from
390
+ // the history as soon as they are completed), which prevents the
391
+ // use of some features of Orthanc (typically, synchronous mode in
392
+ // REST API) and should be avoided for non-developers.
393
+ "JobsHistorySize": 10,
394
+ // Whether to save the jobs into the Orthanc database. If this
395
+ // option is set to "true", the pending/running/completed jobs are
396
+ // automatically reloaded from the database if Orthanc is stopped
397
+ // then restarted (except if the "--no-jobs" command-line argument
398
+ // is specified). This option should be set to "false" if multiple
399
+ // Orthanc servers are using the same database (e.g. if PostgreSQL
400
+ // or MariaDB/MySQL is used).
401
+ "SaveJobs": true,
402
+ // Specifies how Orthanc reacts when it receives a DICOM instance
403
+ // whose SOPInstanceUID is already stored. If set to "true", the new
404
+ // instance replaces the old one. If set to "false", the new
405
+ // instance is discarded and the old one is kept. Up to Orthanc
406
+ // 1.4.1, the implicit behavior corresponded to "false".
407
+ "OverwriteInstances": false,
408
+ // Maximum number of ZIP/media archives that are maintained by
409
+ // Orthanc, as a response to the asynchronous creation of archives.
410
+ // The least recently used archives get deleted as new archives are
411
+ // generated. This option was introduced in Orthanc 1.5.0, and has
412
+ // no effect on the synchronous generation of archives.
413
+ "MediaArchiveSize": 1,
414
+ // Performance setting to specify how Orthanc accesses the storage
415
+ // area during C-FIND. Three modes are available: (1) "Always"
416
+ // allows Orthanc to read the storage area as soon as it needs an
417
+ // information that is not present in its database (slowest mode),
418
+ // (2) "Never" prevents Orthanc from accessing the storage area, and
419
+ // makes it uses exclusively its database (fastest mode), and (3)
420
+ // "Answers" allows Orthanc to read the storage area to generate its
421
+ // answers, but not to filter the DICOM resources (balance between
422
+ // the two modes). By default, the mode is "Always", which
423
+ // corresponds to the behavior of Orthanc <= 1.5.0.
424
+ "StorageAccessOnFind": "Always",
425
+ // Whether Orthanc monitors its metrics (new in Orthanc 1.5.4). If
426
+ // set to "true", the metrics can be retrieved at
427
+ // "/tools/metrics-prometheus" formetted using the Prometheus
428
+ // text-based exposition format.
429
+ "MetricsEnabled": true,
430
+ // Whether calls to URI "/tools/execute-script" is enabled. Starting
431
+ // with Orthanc 1.5.8, this URI is disabled by default for security.
432
+ "ExecuteLuaEnabled": false,
433
+ // Set the timeout for HTTP requests, in seconds. This corresponds
434
+ // to option "request_timeout_ms" of Mongoose/Civetweb. It will set
435
+ // the socket options "SO_RCVTIMEO" and "SO_SNDTIMEO" to the
436
+ // specified value.
437
+ "HttpRequestTimeout": 30
438
+ }
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ monailabel
run.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Start the orthanc service
4
+ # nginx &
5
+ Orthanc &
6
+
7
+ for i in ls datasets/Task09_Spleen/imagesTs/*.nii.gz; do plastimatch convert --patient-id patient1 --input $i --output-dicom test; done && \
8
+
9
+ python -m pynetdicom storescu 127.0.0.1 4242 test -aet MONAILABEL -r && \
10
+ # # Start the monailabel service
11
+ monailabel start_server --app apps/radiology --studies http://127.0.0.1:8042/dicom-web --conf models deepedit
12
+ # monailabel start_server --app apps/radiology --studies datasets/Task09_Spleen/imagesTr --conf models deepedit