@radicalimaging/static-wado-creator 1.3.2 → 1.6.10

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +234 -0
  2. package/README.md +1 -1
  3. package/bin/mkdicomweb.mjs +8 -0
  4. package/dist/canvas-xaqc8v6y.node +0 -0
  5. package/dist/index.js +481518 -0
  6. package/lib/DeleteStudy.js +9 -2
  7. package/lib/RejectInstance.js +15 -3
  8. package/lib/StaticWado.js +245 -41
  9. package/lib/createPart10.js +8 -4
  10. package/lib/createThumbnail.js +181 -0
  11. package/lib/index.js +2 -0
  12. package/lib/instanceMain.js +1 -0
  13. package/lib/mkdicomwebConfig.js +122 -19
  14. package/lib/model/TagLists.js +24 -3
  15. package/lib/model/uids.js +5 -1
  16. package/lib/operation/InstanceDeduplicate.js +14 -4
  17. package/lib/operation/ScanStudy.js +38 -5
  18. package/lib/operation/StudyData.js +158 -38
  19. package/lib/operation/ThumbnailService.js +65 -31
  20. package/lib/operation/adapter/decodeImage.js +5 -2
  21. package/lib/operation/adapter/getImageInfo.js +19 -1
  22. package/lib/operation/adapter/transcodeImage.js +174 -52
  23. package/lib/operation/extractImageFrames.js +19 -4
  24. package/lib/operation/getDataSet.js +41 -7
  25. package/lib/operation/getEncapsulatedImageFrame.js +30 -6
  26. package/lib/operation/getUncompressedImageFrame.js +10 -2
  27. package/lib/operation/getVR.js +10 -2
  28. package/lib/operation/getValue.js +40 -12
  29. package/lib/operation/validateMetadata.js +40 -0
  30. package/lib/program/index.js +5 -3
  31. package/lib/serverMain.js +27 -0
  32. package/lib/util/IdCreator.js +32 -6
  33. package/lib/util/adaptProgramOpts.js +1 -1
  34. package/lib/util/compressionOptionParser.js +12 -3
  35. package/lib/util/resultsReport.ts +88 -0
  36. package/lib/writer/CompleteStudyWriter.js +49 -13
  37. package/lib/writer/DeduplicateWriter.js +2 -1
  38. package/lib/writer/ExpandUriPath.js +4 -1
  39. package/lib/writer/HashDataWriter.js +5 -1
  40. package/lib/writer/ImageFrameWriter.js +38 -13
  41. package/lib/writer/RawDicomWriter.js +11 -2
  42. package/lib/writer/VideoWriter.js +19 -7
  43. package/lib/writer/WriteMultipart.js +3 -1
  44. package/lib/writer/WriteStream.js +12 -4
  45. package/lib/writer/static-dicomweb.code-workspace +8 -0
  46. package/package.json +23 -19
  47. package/bin/mkdicomweb.js +0 -9
  48. package/license.md +0 -21
@@ -11,17 +11,25 @@ let writeCount = 0;
11
11
  */
12
12
  const WriteStream = (dir, nameSrc, options = {}) => {
13
13
  const isGzip = nameSrc.indexOf(".gz") != -1 || options.gzip;
14
- const name = (isGzip && nameSrc.indexOf(".gz") === -1 && `${nameSrc}.gz`) || nameSrc;
15
- if (options.mkdir) fs.mkdirSync(dir, { recursive: true });
14
+ const name =
15
+ (isGzip && nameSrc.indexOf(".gz") === -1 && `${nameSrc}.gz`) || nameSrc;
16
+ if (options.mkdir) {
17
+ fs.mkdirSync(dir, { recursive: true });
18
+ }
16
19
 
17
- const tempName = path.join(dir, `tempFile-${Math.round(Math.random() * 1000000000)}`);
20
+ const tempName = path.join(
21
+ dir,
22
+ `tempFile-${Math.round(Math.random() * 1000000000)}`,
23
+ );
18
24
  const finalName = path.join(dir, name);
19
25
  writeCount++;
20
26
  if (writeCount > 10) {
21
27
  console.log("Write count", tempName, finalName, writeCount);
22
28
  if (writeCount > 100) {
23
29
  console.error("Too many open writes", new Error());
24
- throw new Error(`Write count too high ${writeCount} destination ${finalName}`);
30
+ throw new Error(
31
+ `Write count too high ${writeCount} destination ${finalName}`,
32
+ );
25
33
  }
26
34
  }
27
35
  const rawStream = fs.createWriteStream(tempName);
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "../../../.."
5
+ }
6
+ ],
7
+ "settings": {}
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radicalimaging/static-wado-creator",
3
- "version": "1.3.2",
3
+ "version": "1.6.10",
4
4
  "description": "Library to convert DICOMP10 to DICOMweb format. Original upstream: https://github.com/chafey/dicomp10-to-dicomweb-js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,11 +10,9 @@
10
10
  "DICOM",
11
11
  "DICOMweb"
12
12
  ],
13
- "author": [
14
- "Chris Hafey <chafey@gmail.com>",
15
- "Bill Wallace <bill.wallace@radicalimaging.com>"
16
- ],
13
+ "author": "Bill Wallace <bill.wallace@radicalimaging.com>",
17
14
  "contributors": [
15
+ "Chris Hafey <chafey@gmail.com>",
18
16
  "Rodolfo Costa <rodolfo.costa@radicalimaging.com>"
19
17
  ],
20
18
  "engines": {
@@ -24,50 +22,56 @@
24
22
  },
25
23
  "repository": {
26
24
  "type": "git",
27
- "url": "https://github.com/OHIF/static-wado",
25
+ "url": "https://github.com/radicalimaging/static-dicomweb",
28
26
  "directory": "packages/static-wado-creator"
29
27
  },
30
28
  "bugs": {
31
- "url": "https://github.com/OHIF/static-wado/issues"
29
+ "url": "https://github.com/radicalimaging/static-dicomweb/issues"
32
30
  },
33
- "homepage": "https://github.com/OHIF/static-wado#readme",
31
+ "homepage": "https://github.com/radicalimaging/static-dicomweb#readme",
34
32
  "license": "ISC",
35
33
  "main": "lib/index.js",
34
+ "module": "dist/index.js",
36
35
  "directories": {
37
36
  "lib": "lib",
37
+ "dist": "dist",
38
38
  "bin": "bin"
39
39
  },
40
40
  "files": [
41
41
  "bin",
42
+ "dist",
42
43
  "lib"
43
44
  ],
44
45
  "bin": {
45
- "mkdicomweb": "bin/mkdicomweb.js"
46
+ "mkdicomweb": "bin/mkdicomweb.mjs"
46
47
  },
47
48
  "scripts": {
48
49
  "test": "jest --config ./jest.config.js",
49
- "build": "echo \"No build yet\" && exit 0",
50
+ "build": "bun run build:esm",
51
+ "build:esm": "bun build lib/index.js --target node --outdir dist --",
52
+ "clean": "rimraf dist",
50
53
  "link:exec": "npm install -g && npm link",
51
54
  "lint": "npx eslint --color \"**/*.{js,mjs,cjs}\"",
55
+ "mkdicomweb": "bun bin/mkdicomwebDev.mjs --",
56
+ "pack:js": "npm pack --",
57
+ "publishJS": "yarn publish --no-git-tag-version",
52
58
  "lint:fix": "npx eslint --fix --color \"**/*.{js,mjs,cjs}\""
53
59
  },
54
60
  "jest": {
55
61
  "verbose": true
56
62
  },
57
63
  "dependencies": {
58
- "@cornerstonejs/dicom-codec": ">=1.0.5",
59
- "@radicalimaging/static-cs-lite": "^1.3.2",
60
- "@radicalimaging/static-wado-util": "^1.3.2",
61
- "canvas": "^2.11.1",
64
+ "@radicalimaging/cs3d": ">=1.6.1",
65
+ "@radicalimaging/static-wado-util": ">=1.6.1",
66
+ "canvas": ">=3.1.0",
62
67
  "config-point": ">=0.5.1",
63
- "dcmjs": "^0.29.5",
68
+ "dcmjs": "0.35.0",
64
69
  "dicom-parser": "^1.8.13",
65
- "glob": "^7.2.0",
70
+ "glob": "^11.0.0",
66
71
  "node-object-hash": "^3.0.0",
67
- "uuid": "^8.3.2"
72
+ "uuid": "^11.0.2"
68
73
  },
69
74
  "devDependencies": {
70
75
  "must": "^0.13.4"
71
- },
72
- "gitHead": "202e8673a2c9618f441023c8382187ae7fdf5b1a"
76
+ }
73
77
  }
package/bin/mkdicomweb.js DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { mkdicomwebConfig } = require("../lib");
4
- const { configureProgram } = require("../lib/program");
5
-
6
- // Configure program commander
7
- configureProgram(mkdicomwebConfig).then(() => {
8
- console.verbose("done");
9
- });
package/license.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Radical Imaging Inc
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.