@radicalimaging/static-wado-creator 1.6.10 → 1.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +84817 -54902
- package/lib/DeleteStudy.js +9 -14
- package/lib/RejectInstance.js +4 -15
- package/lib/StaticWado.js +92 -147
- package/lib/createMain.js +3 -3
- package/lib/createPart10.js +19 -23
- package/lib/createThumbnail.js +27 -45
- package/lib/deleteMain.js +2 -2
- package/lib/groupMain.js +2 -2
- package/lib/index.js +6 -6
- package/lib/indexMain.js +2 -2
- package/lib/instanceMain.js +2 -2
- package/lib/metadataMain.js +2 -2
- package/lib/mkdicomwebConfig.js +157 -165
- package/lib/model/TagLists.js +5 -17
- package/lib/model/uids.js +29 -29
- package/lib/operation/InstanceDeduplicate.js +14 -19
- package/lib/operation/ScanStudy.js +11 -18
- package/lib/operation/StudyData.js +87 -156
- package/lib/operation/ThumbnailService.js +29 -54
- package/lib/operation/adapter/decodeImage.js +2 -2
- package/lib/operation/adapter/getImageInfo.js +7 -8
- package/lib/operation/adapter/transcodeImage.js +95 -146
- package/lib/operation/extractImageFrames.js +13 -17
- package/lib/operation/getDataSet.js +9 -43
- package/lib/operation/getEncapsulatedImageFrame.js +7 -19
- package/lib/operation/getNumberOfFrames.js +2 -2
- package/lib/operation/getUncompressedImageFrame.js +2 -10
- package/lib/operation/getVR.js +5 -5
- package/lib/operation/getValue.js +42 -65
- package/lib/operation/validateMetadata.js +4 -4
- package/lib/program/index.js +2 -5
- package/lib/rejectMain.js +2 -2
- package/lib/serverMain.js +8 -14
- package/lib/util/IdCreator.js +8 -17
- package/lib/util/adaptProgramOpts.js +2 -2
- package/lib/util/compressionOptionParser.js +5 -14
- package/lib/util/resultsReport.ts +67 -68
- package/lib/writer/CompleteStudyWriter.js +24 -37
- package/lib/writer/DeduplicateWriter.js +7 -8
- package/lib/writer/ExpandUriPath.js +3 -5
- package/lib/writer/HashDataWriter.js +18 -18
- package/lib/writer/ImageFrameWriter.js +20 -33
- package/lib/writer/MultipartHeader.js +1 -1
- package/lib/writer/RawDicomWriter.js +12 -13
- package/lib/writer/ThumbnailWriter.js +2 -2
- package/lib/writer/VideoWriter.js +23 -34
- package/lib/writer/WriteMultipart.js +4 -6
- package/lib/writer/WriteStream.js +14 -20
- package/package.json +1 -1
- package/lib/writer/static-dicomweb.code-workspace +0 -8
package/lib/mkdicomwebConfig.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const ConfigPoint = require(
|
|
2
|
-
const { staticWadoConfig } = require(
|
|
3
|
-
const createMain = require(
|
|
4
|
-
const createPart10 = require(
|
|
5
|
-
const createThumbnail = require(
|
|
6
|
-
const deleteMain = require(
|
|
7
|
-
const rejectMain = require(
|
|
8
|
-
const serverMain = require(
|
|
9
|
-
const instanceMain = require(
|
|
10
|
-
const indexMain = require(
|
|
11
|
-
const groupMain = require(
|
|
12
|
-
const metadataMain = require(
|
|
13
|
-
const compressionOptionParser = require(
|
|
1
|
+
const ConfigPoint = require('config-point');
|
|
2
|
+
const { staticWadoConfig } = require('@radicalimaging/static-wado-util');
|
|
3
|
+
const createMain = require('./createMain');
|
|
4
|
+
const createPart10 = require('./createPart10');
|
|
5
|
+
const createThumbnail = require('./createThumbnail');
|
|
6
|
+
const deleteMain = require('./deleteMain');
|
|
7
|
+
const rejectMain = require('./rejectMain');
|
|
8
|
+
const serverMain = require('./serverMain');
|
|
9
|
+
const instanceMain = require('./instanceMain');
|
|
10
|
+
const indexMain = require('./indexMain');
|
|
11
|
+
const groupMain = require('./groupMain');
|
|
12
|
+
const metadataMain = require('./metadataMain');
|
|
13
|
+
const compressionOptionParser = require('./util/compressionOptionParser');
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Defines the basic configuration values for the dicomwebserver component. See the README for more details.
|
|
@@ -24,318 +24,310 @@ const { mkdicomwebConfig } = ConfigPoint.register({
|
|
|
24
24
|
isGroup: true,
|
|
25
25
|
options: [
|
|
26
26
|
{
|
|
27
|
-
key:
|
|
28
|
-
description:
|
|
29
|
-
defaultValue:
|
|
27
|
+
key: '-c <configFile.json5>',
|
|
28
|
+
description: 'Use an alternate configuration file',
|
|
29
|
+
defaultValue: '~/static-wado.json5',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
key:
|
|
33
|
-
description:
|
|
34
|
-
"Clean the outputs before generating/starting to write new values.",
|
|
32
|
+
key: '--clean',
|
|
33
|
+
description: 'Clean the outputs before generating/starting to write new values.',
|
|
35
34
|
defaultValue: false,
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
|
-
key:
|
|
39
|
-
description:
|
|
40
|
-
"List of deployments from configuration to deploy to. Separated by space.",
|
|
37
|
+
key: '-d, --deployments <listvalue...>',
|
|
38
|
+
description: 'List of deployments from configuration to deploy to. Separated by space.',
|
|
41
39
|
defaultValue: undefined,
|
|
42
40
|
},
|
|
43
41
|
{
|
|
44
|
-
key:
|
|
45
|
-
description:
|
|
42
|
+
key: '--no-notifications',
|
|
43
|
+
description: 'Turns off notifications',
|
|
46
44
|
},
|
|
47
45
|
{
|
|
48
|
-
key:
|
|
49
|
-
description:
|
|
46
|
+
key: '--delete',
|
|
47
|
+
description: 'Delete the imported instances',
|
|
50
48
|
defaultValue: false,
|
|
51
49
|
},
|
|
52
50
|
{
|
|
53
|
-
key:
|
|
54
|
-
description:
|
|
51
|
+
key: '--lossy',
|
|
52
|
+
description: 'Generate lossy instances instead of lossless',
|
|
55
53
|
defaultValue: false,
|
|
56
54
|
},
|
|
57
55
|
{
|
|
58
|
-
key:
|
|
56
|
+
key: '--alternate <type>',
|
|
59
57
|
description:
|
|
60
|
-
|
|
61
|
-
choices: [
|
|
58
|
+
'Generates an alternate representaton of the image generally in the /lossy sub-directory',
|
|
59
|
+
choices: ['jhc', 'jls', 'jhcLossless', 'jlsLossless'],
|
|
62
60
|
},
|
|
63
61
|
{
|
|
64
|
-
key:
|
|
65
|
-
description:
|
|
62
|
+
key: '--alternate-thumbnail',
|
|
63
|
+
description: 'Generates a thumbnail for the alternate representation',
|
|
66
64
|
},
|
|
67
65
|
{
|
|
68
|
-
key:
|
|
69
|
-
description:
|
|
70
|
-
defaultValue:
|
|
66
|
+
key: '--alternate-name <dir>',
|
|
67
|
+
description: 'Uses a given sub directory name',
|
|
68
|
+
defaultValue: 'lossy',
|
|
71
69
|
},
|
|
72
70
|
{
|
|
73
|
-
key:
|
|
74
|
-
description:
|
|
71
|
+
key: '-v, --verbose',
|
|
72
|
+
description: 'Write verbose output',
|
|
75
73
|
defaultValue: false,
|
|
76
74
|
},
|
|
77
75
|
{
|
|
78
|
-
key:
|
|
79
|
-
description:
|
|
76
|
+
key: '--show-progress',
|
|
77
|
+
description: 'Show progress during DICOM file processing',
|
|
80
78
|
},
|
|
81
79
|
{
|
|
82
|
-
key:
|
|
80
|
+
key: '-t, --content-type <type>',
|
|
83
81
|
description:
|
|
84
82
|
'Destination type to compress to (choices: "jpeg", "jls", "lei", "jls-lossy", "jhc", "jxl" or DICOM Transfer Syntax UID - default: "jls")',
|
|
85
|
-
defaultValue:
|
|
83
|
+
defaultValue: 'jls',
|
|
86
84
|
customParser: compressionOptionParser,
|
|
87
85
|
},
|
|
88
86
|
{
|
|
89
|
-
key:
|
|
87
|
+
key: '--encapsulated-image',
|
|
90
88
|
description:
|
|
91
|
-
|
|
89
|
+
'Avoid encapsulating the image frame. Writes with the extension and without multipart',
|
|
92
90
|
},
|
|
93
91
|
{
|
|
94
|
-
key:
|
|
92
|
+
key: '-e, --no-encapsulated-image',
|
|
95
93
|
description:
|
|
96
|
-
|
|
94
|
+
'Avoid encapsulating the image frame. Writes with the extension and without multipart',
|
|
97
95
|
},
|
|
98
96
|
{
|
|
99
|
-
key:
|
|
100
|
-
description:
|
|
97
|
+
key: '--single-part-image',
|
|
98
|
+
description: 'Writes single part image data',
|
|
101
99
|
},
|
|
102
100
|
{
|
|
103
|
-
key:
|
|
104
|
-
description:
|
|
101
|
+
key: '--no-single-part-image',
|
|
102
|
+
description: 'Writes single part image data',
|
|
105
103
|
},
|
|
106
104
|
{
|
|
107
|
-
key:
|
|
108
|
-
description:
|
|
105
|
+
key: '-m, --maximum-inline-public-length <value>',
|
|
106
|
+
description: 'Maximum length of public binary data',
|
|
109
107
|
defaultValue: 128 * 1024 + 2,
|
|
110
108
|
},
|
|
111
109
|
{
|
|
112
|
-
key:
|
|
113
|
-
description:
|
|
110
|
+
key: '-M, --maximum-inline-private-length <value>',
|
|
111
|
+
description: 'Maximum length of private binary data',
|
|
114
112
|
defaultValue: 64,
|
|
115
113
|
},
|
|
116
114
|
{
|
|
117
|
-
key:
|
|
118
|
-
description:
|
|
119
|
-
defaultValue: [
|
|
115
|
+
key: '-r, --recompress <listvalue...>',
|
|
116
|
+
description: 'List of types to recompress separated by space',
|
|
117
|
+
defaultValue: ['uncompressed', 'jp2', 'jls', 'jll'],
|
|
120
118
|
choices: [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
119
|
+
'uncompressed',
|
|
120
|
+
'jp2',
|
|
121
|
+
'jpeg',
|
|
122
|
+
'jpeglossless',
|
|
123
|
+
'rle',
|
|
124
|
+
'jph',
|
|
125
|
+
'jls',
|
|
126
|
+
'true',
|
|
127
|
+
'none',
|
|
130
128
|
],
|
|
131
129
|
},
|
|
132
130
|
{
|
|
133
|
-
key:
|
|
134
|
-
description:
|
|
135
|
-
|
|
136
|
-
defaultValue: ["uncompressed"],
|
|
131
|
+
key: '--recompress-color <listvalue...>',
|
|
132
|
+
description: 'List of types to recompress for color images, separated by space',
|
|
133
|
+
defaultValue: ['uncompressed'],
|
|
137
134
|
choices: [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
135
|
+
'uncompressed',
|
|
136
|
+
'jpeg',
|
|
137
|
+
'jp2',
|
|
138
|
+
'jpeglossless',
|
|
139
|
+
'rle',
|
|
140
|
+
'jph',
|
|
141
|
+
'jls',
|
|
142
|
+
'true',
|
|
143
|
+
'none',
|
|
147
144
|
],
|
|
148
145
|
},
|
|
149
146
|
{
|
|
150
|
-
key:
|
|
151
|
-
description:
|
|
147
|
+
key: '-f, --force',
|
|
148
|
+
description: 'Force the update even if the SOP exists',
|
|
152
149
|
defaultValue: false,
|
|
153
150
|
},
|
|
154
151
|
{
|
|
155
|
-
key:
|
|
156
|
-
description:
|
|
152
|
+
key: '--delete-input',
|
|
153
|
+
description: 'Deletes successful input files',
|
|
157
154
|
defaultValue: false,
|
|
158
155
|
},
|
|
159
156
|
{
|
|
160
|
-
key:
|
|
161
|
-
description:
|
|
157
|
+
key: '--delete-failed',
|
|
158
|
+
description: 'Deletes unsuccessful input files',
|
|
162
159
|
defaultValue: false,
|
|
163
160
|
},
|
|
164
161
|
{
|
|
165
|
-
key:
|
|
166
|
-
description:
|
|
167
|
-
defaultValue: [
|
|
168
|
-
choices: [
|
|
162
|
+
key: '--recompress-thumb <listvalue...>',
|
|
163
|
+
description: 'List of types to recompress thumb separated by space',
|
|
164
|
+
defaultValue: ['uncompressed', 'jp2'],
|
|
165
|
+
choices: ['uncompressed', 'jp2', 'jpeglossless', 'rle', 'none'],
|
|
169
166
|
},
|
|
170
167
|
{
|
|
171
|
-
key:
|
|
172
|
-
description:
|
|
168
|
+
key: '--no-recompress',
|
|
169
|
+
description: 'Force no recompression',
|
|
173
170
|
defaultValue: false,
|
|
174
171
|
},
|
|
175
172
|
{
|
|
176
|
-
key:
|
|
177
|
-
description:
|
|
173
|
+
key: '--no-recompress-thumb',
|
|
174
|
+
description: 'Force no recompression thumbnail',
|
|
178
175
|
defaultValue: false,
|
|
179
176
|
},
|
|
180
177
|
{
|
|
181
|
-
key:
|
|
182
|
-
description:
|
|
178
|
+
key: '--no-thumb',
|
|
179
|
+
description: 'Skip generating thumbnails using CS3D internal render',
|
|
183
180
|
defaultValue: true,
|
|
184
181
|
},
|
|
185
182
|
{
|
|
186
|
-
key:
|
|
187
|
-
description:
|
|
183
|
+
key: '--dcm2jpg',
|
|
184
|
+
description: 'Use dcm2jpg for thumbnail image generation',
|
|
188
185
|
defaultValue: false,
|
|
189
186
|
},
|
|
190
187
|
{
|
|
191
|
-
key:
|
|
192
|
-
description:
|
|
188
|
+
key: '--rendered',
|
|
189
|
+
description: 'Use dcm2jpg to generate a rendered PNG image',
|
|
193
190
|
defaultValue: false,
|
|
194
191
|
},
|
|
195
192
|
{
|
|
196
|
-
key:
|
|
197
|
-
description:
|
|
198
|
-
defaultValue:
|
|
193
|
+
key: '-T, --color-content-type <value>',
|
|
194
|
+
description: 'Colour content type',
|
|
195
|
+
defaultValue: 'jpeg',
|
|
199
196
|
},
|
|
200
197
|
{
|
|
201
|
-
key:
|
|
202
|
-
description:
|
|
203
|
-
|
|
204
|
-
defaultValue: "deduplicated",
|
|
198
|
+
key: '--path-deduplicated <path>',
|
|
199
|
+
description: 'Set the deduplicate data directory path (relative to dir)',
|
|
200
|
+
defaultValue: 'deduplicated',
|
|
205
201
|
},
|
|
206
202
|
{
|
|
207
|
-
key:
|
|
208
|
-
description:
|
|
209
|
-
defaultValue:
|
|
203
|
+
key: '--path-instances <path>',
|
|
204
|
+
description: 'Set the instances directory path (relative to dir)',
|
|
205
|
+
defaultValue: 'instances',
|
|
210
206
|
},
|
|
211
207
|
{
|
|
212
|
-
key:
|
|
213
|
-
description:
|
|
208
|
+
key: '--store-multipart-bulk-data',
|
|
209
|
+
description: 'Use multipart encoding for non image frame bulkdata',
|
|
214
210
|
defaultValue: false,
|
|
215
211
|
},
|
|
216
212
|
{
|
|
217
|
-
key:
|
|
213
|
+
key: '--prepend-bulk-data-uri <value>',
|
|
218
214
|
description:
|
|
219
|
-
|
|
220
|
-
defaultValue:
|
|
215
|
+
'Prepend bulkdata uri (ex. to use absolute Uri like http://host:3000/dicomweb)',
|
|
216
|
+
defaultValue: '',
|
|
221
217
|
},
|
|
222
218
|
{
|
|
223
|
-
key:
|
|
219
|
+
key: '--expand-bulk-data-uri',
|
|
224
220
|
description:
|
|
225
|
-
|
|
221
|
+
'expand bulkdata relative uri to use full relative path (should also be set when using --prepend-bulk-data-uri)',
|
|
226
222
|
defaultValue: false,
|
|
227
223
|
},
|
|
228
224
|
{
|
|
229
|
-
key:
|
|
230
|
-
description:
|
|
225
|
+
key: '--quiet',
|
|
226
|
+
description: 'Run quietly, minimizing extraneous output',
|
|
231
227
|
defaultValue: false,
|
|
232
228
|
},
|
|
233
229
|
{
|
|
234
|
-
key:
|
|
235
|
-
description:
|
|
230
|
+
key: '--multipart',
|
|
231
|
+
description: 'Add a multipart result output',
|
|
236
232
|
defaultValue: false,
|
|
237
233
|
},
|
|
238
234
|
{
|
|
239
|
-
key:
|
|
240
|
-
description:
|
|
235
|
+
key: '--no-verify',
|
|
236
|
+
description: 'Verify',
|
|
241
237
|
defaultValue: true,
|
|
242
238
|
},
|
|
243
239
|
{
|
|
244
|
-
key:
|
|
245
|
-
description:
|
|
240
|
+
key: '-o, --dir <value>',
|
|
241
|
+
description: 'Set output directory',
|
|
246
242
|
defaultValue: {
|
|
247
|
-
configOperation:
|
|
248
|
-
source:
|
|
249
|
-
reference:
|
|
243
|
+
configOperation: 'reference',
|
|
244
|
+
source: 'staticWadoConfig',
|
|
245
|
+
reference: 'rootDir',
|
|
250
246
|
},
|
|
251
247
|
},
|
|
252
248
|
{
|
|
253
|
-
key:
|
|
254
|
-
description:
|
|
255
|
-
"Choose sop instances to run against (only for instance runs)",
|
|
249
|
+
key: '--sop-instance-uid <value>',
|
|
250
|
+
description: 'Choose sop instances to run against (only for instance runs)',
|
|
256
251
|
},
|
|
257
252
|
{
|
|
258
|
-
key:
|
|
259
|
-
description:
|
|
260
|
-
"Choose series instances to run against (only for instance runs)",
|
|
253
|
+
key: '--series-instance-uid <value>',
|
|
254
|
+
description: 'Choose series instances to run against (only for instance runs)',
|
|
261
255
|
},
|
|
262
256
|
|
|
263
257
|
{
|
|
264
|
-
key:
|
|
265
|
-
description:
|
|
258
|
+
key: '--hash-study-uid-path',
|
|
259
|
+
description: 'Enable hashing of studyUID folder structure',
|
|
266
260
|
defaultValue: false,
|
|
267
261
|
},
|
|
268
262
|
],
|
|
269
263
|
programs: [
|
|
270
264
|
{
|
|
271
|
-
command:
|
|
265
|
+
command: 'create',
|
|
272
266
|
isDefault: true,
|
|
273
|
-
arguments: [
|
|
267
|
+
arguments: ['input'],
|
|
274
268
|
main: createMain,
|
|
275
269
|
helpDescription:
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
270
|
+
'Make DICOMweb query and metadata from binary Part 10 DICOM files. Does a full read\n' +
|
|
271
|
+
'of deduplicated files each time a study instance UID is found, and only updates\n' +
|
|
272
|
+
'those studies having at least one ',
|
|
279
273
|
},
|
|
280
274
|
{
|
|
281
|
-
command:
|
|
275
|
+
command: 'server',
|
|
282
276
|
main: serverMain,
|
|
283
|
-
helpDescription:
|
|
284
|
-
"Run server deploy instances single threaded/separated exec process",
|
|
277
|
+
helpDescription: 'Run server deploy instances single threaded/separated exec process',
|
|
285
278
|
},
|
|
286
279
|
{
|
|
287
|
-
command:
|
|
288
|
-
arguments: [
|
|
280
|
+
command: 'part10',
|
|
281
|
+
arguments: ['studyUID'],
|
|
289
282
|
main: createPart10,
|
|
290
|
-
helpDescription:
|
|
283
|
+
helpDescription: 'Store the specified study as part 10 data',
|
|
291
284
|
},
|
|
292
285
|
{
|
|
293
|
-
command:
|
|
286
|
+
command: 'index',
|
|
294
287
|
main: indexMain,
|
|
295
|
-
helpDescription:
|
|
288
|
+
helpDescription: 'Recreate the index for the DICOMweb data.',
|
|
296
289
|
},
|
|
297
290
|
{
|
|
298
|
-
command:
|
|
291
|
+
command: 'thumbnail',
|
|
299
292
|
main: createThumbnail,
|
|
300
|
-
helpDescription:
|
|
293
|
+
helpDescription: 'Create a thumbnail for the specified image',
|
|
301
294
|
options: [
|
|
302
295
|
{
|
|
303
|
-
key:
|
|
304
|
-
description:
|
|
296
|
+
key: '--series-thumbnail',
|
|
297
|
+
description: 'Generate a series thumbnail instead of instance',
|
|
305
298
|
},
|
|
306
299
|
],
|
|
307
300
|
},
|
|
308
301
|
{
|
|
309
|
-
command:
|
|
310
|
-
arguments: [
|
|
302
|
+
command: 'instance',
|
|
303
|
+
arguments: ['input'],
|
|
311
304
|
main: instanceMain,
|
|
312
305
|
helpDescription:
|
|
313
306
|
"Make instance level DICOMweb metadata and bulkdata, but don't group or write series metadata",
|
|
314
307
|
},
|
|
315
308
|
{
|
|
316
|
-
command:
|
|
317
|
-
arguments: [
|
|
309
|
+
command: 'group',
|
|
310
|
+
arguments: ['input'],
|
|
318
311
|
main: groupMain,
|
|
319
312
|
helpDescription:
|
|
320
|
-
|
|
313
|
+
'Group instance level metadata into deduplicated data.\nDeletes instance level deduplicated information once it is confirmed written.',
|
|
321
314
|
},
|
|
322
315
|
{
|
|
323
|
-
command:
|
|
324
|
-
arguments: [
|
|
316
|
+
command: 'metadata',
|
|
317
|
+
arguments: ['input'],
|
|
325
318
|
main: metadataMain,
|
|
326
319
|
helpDescription:
|
|
327
|
-
|
|
320
|
+
'Write the metadata object (series and study details) from the grouped deduplicated data.',
|
|
328
321
|
},
|
|
329
322
|
{
|
|
330
|
-
command:
|
|
323
|
+
command: 'delete',
|
|
331
324
|
main: deleteMain,
|
|
332
|
-
helpDescription:
|
|
333
|
-
"Delete the given study, series or instance (not yet implemented)",
|
|
325
|
+
helpDescription: 'Delete the given study, series or instance (not yet implemented)',
|
|
334
326
|
},
|
|
335
327
|
{
|
|
336
|
-
command:
|
|
328
|
+
command: 'reject <studyUID...>',
|
|
337
329
|
main: rejectMain,
|
|
338
|
-
helpDescription:
|
|
330
|
+
helpDescription: 'Reject the specified series',
|
|
339
331
|
},
|
|
340
332
|
],
|
|
341
333
|
},
|
package/lib/model/TagLists.js
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
const hashFactory = require(
|
|
2
|
-
const { Tags } = require(
|
|
1
|
+
const hashFactory = require('node-object-hash');
|
|
2
|
+
const { Tags } = require('@radicalimaging/static-wado-util');
|
|
3
3
|
|
|
4
4
|
/* eslint "no-param-reassign": "off" */
|
|
5
5
|
|
|
6
6
|
const hasher = hashFactory.hasher();
|
|
7
7
|
|
|
8
8
|
const { PatientID, PatientName, IssuerOfPatientID } = Tags;
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
AccessionNumber,
|
|
12
|
-
StudyInstanceUID,
|
|
13
|
-
StudyDate,
|
|
14
|
-
StudyTime,
|
|
15
|
-
} = Tags;
|
|
16
|
-
const {
|
|
17
|
-
SeriesDescription,
|
|
18
|
-
SeriesNumber,
|
|
19
|
-
SeriesInstanceUID,
|
|
20
|
-
SeriesDate,
|
|
21
|
-
SeriesTime,
|
|
22
|
-
} = Tags;
|
|
9
|
+
const { StudyDescription, AccessionNumber, StudyInstanceUID, StudyDate, StudyTime } = Tags;
|
|
10
|
+
const { SeriesDescription, SeriesNumber, SeriesInstanceUID, SeriesDate, SeriesTime } = Tags;
|
|
23
11
|
|
|
24
12
|
const { DeduppedHash, DeduppedRef, DeduppedType } = Tags;
|
|
25
13
|
|
|
@@ -153,7 +141,7 @@ const TagSets = {
|
|
|
153
141
|
extract: (data, type, tagSet, options) => {
|
|
154
142
|
const ret = {};
|
|
155
143
|
const { remove, hashRef } = options || {};
|
|
156
|
-
tagSet.forEach(
|
|
144
|
+
tagSet.forEach(tag => {
|
|
157
145
|
const value = data[tag];
|
|
158
146
|
if (value) {
|
|
159
147
|
ret[tag] = value;
|
package/lib/model/uids.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const octetStream =
|
|
1
|
+
const octetStream = 'application/octet-stream';
|
|
2
2
|
const uncompressed = {
|
|
3
3
|
uncompressed: true,
|
|
4
4
|
gzip: true,
|
|
@@ -8,41 +8,41 @@ const uncompressed = {
|
|
|
8
8
|
/**
|
|
9
9
|
* @see {@link https://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_8.7.3.3.2.html}
|
|
10
10
|
*/
|
|
11
|
-
const jpeg =
|
|
12
|
-
const jls =
|
|
13
|
-
const jll =
|
|
14
|
-
const jxl =
|
|
15
|
-
const htj2k =
|
|
16
|
-
const jp2 =
|
|
17
|
-
const rle =
|
|
11
|
+
const jpeg = 'image/jpeg';
|
|
12
|
+
const jls = 'image/jls';
|
|
13
|
+
const jll = 'image/jll';
|
|
14
|
+
const jxl = 'image/x-jxl';
|
|
15
|
+
const htj2k = 'image/jphc';
|
|
16
|
+
const jp2 = 'image/jp2';
|
|
17
|
+
const rle = 'image/dicom-rle';
|
|
18
18
|
|
|
19
19
|
const uids = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
'1.2.840.10008.1.2': uncompressed,
|
|
21
|
+
'1.2.840.10008.1.2.1': uncompressed,
|
|
22
|
+
'1.2.840.10008.1.2.1.99': uncompressed,
|
|
23
|
+
'1.2.840.10008.1.2.2': uncompressed,
|
|
24
|
+
'1.2.840.10008.1.2.4.50': {
|
|
25
25
|
contentType: jpeg,
|
|
26
26
|
lossy: true,
|
|
27
|
-
extension:
|
|
27
|
+
extension: '.jpeg',
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
'1.2.840.10008.1.2.4.51': { contentType: jpeg, lossy: true },
|
|
30
|
+
'1.2.840.10008.1.2.4.57': { contentType: jpeg },
|
|
31
|
+
'1.2.840.10008.1.2.4.70': { contentType: jll, extension: '.jll' },
|
|
32
|
+
'1.2.840.10008.1.2.4.140': { contentType: jxl, extension: '.jxl' },
|
|
33
33
|
// Lossy, original JPEG reconstruction mode
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
'1.2.840.10008.1.2.4.141': { contentType: jxl, lossy: true },
|
|
35
|
+
'1.2.840.10008.1.2.4.142': { contentType: jxl, lossy: true },
|
|
36
|
+
'1.2.840.10008.1.2.4.80': { contentType: jls, extension: '.jls' },
|
|
37
|
+
'1.2.840.10008.1.2.4.81': { contentType: jls, lossy: true },
|
|
38
|
+
'1.2.840.10008.1.2.4.90': { contentType: jp2, extension: '.jp2' },
|
|
39
|
+
'1.2.840.10008.1.2.4.91': { contentType: jp2 },
|
|
40
40
|
// Private/test transfer syntax for HTJ2K
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
'3.2.840.10008.1.2.4.96': { contentType: htj2k },
|
|
42
|
+
'1.2.840.10008.1.2.4.201': { contentType: htj2k },
|
|
43
|
+
'1.2.840.10008.1.2.4.202': { contentType: htj2k, extension: '.jhc' },
|
|
44
|
+
'1.2.840.10008.1.2.4.203': { contentType: htj2k, lossy: true },
|
|
45
|
+
'1.2.840.10008.1.2.5': { contentType: rle },
|
|
46
46
|
default: {},
|
|
47
47
|
};
|
|
48
48
|
|