dicom-synth 1.17.0 → 1.19.0
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/README.md +1 -1
- package/bin/dicom-synth-describe.mjs +12 -1
- package/dist/esm/collection/generate.js +977 -0
- package/dist/esm/collection/writer.js +243 -109
- package/dist/esm/describe/describe.js +281 -25
- package/dist/esm/index.js +535 -243
- package/dist/esm/nonStandardDicom/dicomdir.js +14 -15
- package/dist/esm/platform/bytes.js +39 -0
- package/dist/esm/platform/random.js +22 -0
- package/dist/esm/platform/sha256.js +131 -0
- package/dist/esm/schema/parametric.js +73 -4
- package/dist/esm/schema/validate.js +1 -0
- package/dist/esm/syntheticFixtures/generator.js +31 -14
- package/dist/esm/syntheticFixtures/streamWrite.js +156 -13
- package/dist/esm/syntheticFixtures/uid.js +148 -4
- package/dist/esm/syntheticFixtures/violations.js +18 -6
- package/dist/types/collection/generate.d.ts +43 -0
- package/dist/types/collection/writer.d.ts +0 -27
- package/dist/types/describe/describe.d.ts +12 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/nonStandardDicom/dicomdir.d.ts +1 -6
- package/dist/types/platform/bytes.d.ts +4 -0
- package/dist/types/platform/random.d.ts +2 -0
- package/dist/types/platform/sha256.d.ts +1 -0
- package/dist/types/schema/validate.d.ts +1 -0
- package/dist/types/syntheticFixtures/generator.d.ts +2 -2
- package/dist/types/syntheticFixtures/violations.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ for await (const file of generateCollectionFromSpec({
|
|
|
24
24
|
entries: [{ type: 'valid-image', count: 5 }],
|
|
25
25
|
seed: 42,
|
|
26
26
|
})) {
|
|
27
|
-
console.log(file.filename, file.buffer.length) //
|
|
27
|
+
console.log(file.filename, file.buffer.length) // Uint8Array ready to parse or pipe
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -6,7 +6,7 @@ import { describeDirectory } from '../dist/esm/index.js'
|
|
|
6
6
|
|
|
7
7
|
function usage() {
|
|
8
8
|
console.error(
|
|
9
|
-
'Usage: dicom-synth-describe <dir> [--out <spec.json[.gz]>] [--tree] [--keep-tags <a,b,...>] [--keep-tags-file <path>] [--size-tolerance <fraction>] [--no-preserve-uids] [--uid-salt <hex>] [--gzip]\n' +
|
|
9
|
+
'Usage: dicom-synth-describe <dir> [--out <spec.json[.gz]>] [--tree] [--keep-tags <a,b,...>] [--keep-tags-file <path>] [--keep-private-tags] [--size-tolerance <fraction>] [--no-preserve-uids] [--uid-salt <hex>] [--gzip]\n' +
|
|
10
10
|
'\n' +
|
|
11
11
|
'Scans a DICOM tree and emits a DatasetSpec describing its shape\n' +
|
|
12
12
|
'(studies/series, per-file size, modality).\n' +
|
|
@@ -22,6 +22,13 @@ function usage() {
|
|
|
22
22
|
"responsibility, not this tool's.\n" +
|
|
23
23
|
'--keep-tags-file reads the same allow-list from a file (one tag per\n' +
|
|
24
24
|
'line, # comments); merged with any --keep-tags.\n' +
|
|
25
|
+
'--keep-private-tags captures ALL private (odd-group) elements as-is as\n' +
|
|
26
|
+
'raw { vr, value } tag forms — creators, scalars, nested private\n' +
|
|
27
|
+
'sequences. Private blocks routinely carry PHI/device detail: handling\n' +
|
|
28
|
+
"that is the caller's responsibility. UID-valued leaves are still\n" +
|
|
29
|
+
'hashed unless --no-preserve-uids. Individual private tags can instead\n' +
|
|
30
|
+
'be named (8-hex) in --keep-tags. Binary/unparseable payloads are\n' +
|
|
31
|
+
'skipped and counted.\n' +
|
|
25
32
|
'--size-tolerance folds near-identical file sizes (fraction, e.g. 0.05\n' +
|
|
26
33
|
'= ±5%) into one entry; default exact.\n' +
|
|
27
34
|
'--no-preserve-uids emits shape only with freshly minted UIDs (no link\n' +
|
|
@@ -52,6 +59,7 @@ let preserveUids = true
|
|
|
52
59
|
let uidSalt
|
|
53
60
|
let gzip = false
|
|
54
61
|
let captureTree = false
|
|
62
|
+
let keepPrivateTags = false
|
|
55
63
|
const keepTags = []
|
|
56
64
|
|
|
57
65
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -77,6 +85,8 @@ for (let i = 0; i < args.length; i++) {
|
|
|
77
85
|
console.error('--size-tolerance must be a non-negative number')
|
|
78
86
|
process.exit(1)
|
|
79
87
|
}
|
|
88
|
+
} else if (args[i] === '--keep-private-tags') {
|
|
89
|
+
keepPrivateTags = true
|
|
80
90
|
} else if (args[i] === '--no-preserve-uids') {
|
|
81
91
|
preserveUids = false
|
|
82
92
|
} else if (args[i] === '--tree') {
|
|
@@ -107,6 +117,7 @@ let result
|
|
|
107
117
|
try {
|
|
108
118
|
result = describeDirectory(dir, {
|
|
109
119
|
...(keepTags.length ? { keepTags } : {}),
|
|
120
|
+
...(keepPrivateTags ? { keepPrivateTags: true } : {}),
|
|
110
121
|
...(sizeTolerance !== undefined ? { sizeTolerance } : {}),
|
|
111
122
|
preserveUids,
|
|
112
123
|
...(uidSalt !== undefined ? { uidSalt } : {}),
|