dicom-synth 1.3.0 → 1.5.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 +81 -16
- package/bin/dicom-synth-generate.mjs +100 -40
- package/dist/esm/collection/writer.js +37 -54
- package/dist/esm/index.js +248 -85
- package/dist/esm/schema/parametric.js +327 -0
- package/dist/esm/schema/validate.js +136 -32
- package/dist/esm/syntheticFixtures/generator.js +37 -54
- package/dist/esm/syntheticFixtures/uid.js +4 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/schema/parametric.d.ts +2 -0
- package/dist/types/schema/types.d.ts +26 -7
- package/dist/types/schema/validate.d.ts +2 -1
- package/dist/types/syntheticFixtures/uid.d.ts +2 -0
- package/package.json +2 -2
|
@@ -10,6 +10,10 @@ export type ViolationClass = 'uid-too-long' | 'non-conformant-uid' | 'missing-me
|
|
|
10
10
|
export type Modality = 'CT' | 'PT' | 'MR' | 'CR';
|
|
11
11
|
type BaseImageSpec = {
|
|
12
12
|
modality?: Modality;
|
|
13
|
+
rows?: number;
|
|
14
|
+
columns?: number;
|
|
15
|
+
frames?: number;
|
|
16
|
+
targetSizeKb?: number;
|
|
13
17
|
tags?: DicomTagOverrides;
|
|
14
18
|
transferSyntax?: TransferSyntax;
|
|
15
19
|
violations?: ViolationClass[];
|
|
@@ -23,12 +27,6 @@ export type InvalidUidImageSpec = BaseImageSpec & {
|
|
|
23
27
|
export type VendorWarningsImageSpec = BaseImageSpec & {
|
|
24
28
|
type: 'vendor-warnings-image';
|
|
25
29
|
};
|
|
26
|
-
export type LargeImageSpec = BaseImageSpec & {
|
|
27
|
-
type: 'large-image';
|
|
28
|
-
rows: number;
|
|
29
|
-
columns: number;
|
|
30
|
-
frames?: number;
|
|
31
|
-
};
|
|
32
30
|
export type FakeSignatureSpec = {
|
|
33
31
|
type: 'fake-signature';
|
|
34
32
|
};
|
|
@@ -39,7 +37,7 @@ export type NonDicomSpec = {
|
|
|
39
37
|
export type DicomdirSpec = {
|
|
40
38
|
type: 'dicomdir';
|
|
41
39
|
};
|
|
42
|
-
export type ImageSpec = ValidImageSpec | InvalidUidImageSpec | VendorWarningsImageSpec
|
|
40
|
+
export type ImageSpec = ValidImageSpec | InvalidUidImageSpec | VendorWarningsImageSpec;
|
|
43
41
|
export type FileSpec = ImageSpec | FakeSignatureSpec | NonDicomSpec | DicomdirSpec;
|
|
44
42
|
export type EntrySpec = FileSpec & {
|
|
45
43
|
count?: number;
|
|
@@ -63,4 +61,25 @@ export type DatasetSpec = {
|
|
|
63
61
|
seed?: number;
|
|
64
62
|
layout?: DatasetLayout;
|
|
65
63
|
};
|
|
64
|
+
export type Range = number | {
|
|
65
|
+
min: number;
|
|
66
|
+
max: number;
|
|
67
|
+
};
|
|
68
|
+
export type ParametricStudies = {
|
|
69
|
+
count: Range;
|
|
70
|
+
seriesPerStudy: Range;
|
|
71
|
+
filesPerSeries: Range;
|
|
72
|
+
fileSizeKb?: Range;
|
|
73
|
+
modalities?: Modality[];
|
|
74
|
+
tags?: DicomTagOverrides;
|
|
75
|
+
};
|
|
76
|
+
export type ParametricEdgeCase = EntrySpec & {
|
|
77
|
+
frequency?: number;
|
|
78
|
+
};
|
|
79
|
+
export type ParametricSpec = {
|
|
80
|
+
seed?: number;
|
|
81
|
+
studies: ParametricStudies;
|
|
82
|
+
edgeCases?: ParametricEdgeCase[];
|
|
83
|
+
layout?: DatasetLayout;
|
|
84
|
+
};
|
|
66
85
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { DatasetSpec } from './types.js';
|
|
1
|
+
import type { DatasetSpec, ParametricSpec } from './types.js';
|
|
2
2
|
export declare const HEX_TAG_RE: RegExp;
|
|
3
3
|
export declare function validateDatasetSpec(raw: unknown): DatasetSpec;
|
|
4
|
+
export declare function validateParametricSpec(raw: unknown): ParametricSpec;
|
|
@@ -3,6 +3,8 @@ export type UidSet = {
|
|
|
3
3
|
series: string;
|
|
4
4
|
sop: string;
|
|
5
5
|
};
|
|
6
|
+
export declare const PARAMETRIC_STREAM_OFFSET = 2246822507;
|
|
7
|
+
export declare function seededStream(seed: number, offset: number, a: number, b: number): () => number;
|
|
6
8
|
export type GroupUidGenerator = {
|
|
7
9
|
study: (studyIndex: number) => string;
|
|
8
10
|
series: (studyIndex: number, seriesIndex: number) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dicom-synth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Toolkit for synthetic DICOM fixtures and public fixture fetch/cache.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
"semantic-release": "^25.0.3",
|
|
91
91
|
"tsx": "^4.19.3",
|
|
92
92
|
"typescript": "^5.8.3",
|
|
93
|
-
"vitest": "^3.2.
|
|
93
|
+
"vitest": "^3.2.6"
|
|
94
94
|
}
|
|
95
95
|
}
|