@ubercode/dcmtk 0.1.4 → 0.3.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 +20 -15
- package/dist/DicomInstance-D9plqHp5.d.ts +625 -0
- package/dist/DicomInstance-DNHPkkzl.d.cts +625 -0
- package/dist/{dcmodify-CTXBWKU9.d.cts → dcmodify-B-_uUIKB.d.ts} +4 -2
- package/dist/{dcmodify-Daeafqrm.d.ts → dcmodify-Gds9u5Vj.d.cts} +4 -2
- package/dist/dicom.cjs +329 -51
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.d.cts +368 -3
- package/dist/dicom.d.ts +368 -3
- package/dist/dicom.js +329 -51
- package/dist/dicom.js.map +1 -1
- package/dist/index.cjs +1993 -423
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +324 -10
- package/dist/index.d.ts +324 -10
- package/dist/index.js +1962 -417
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +2380 -197
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +1654 -3
- package/dist/servers.d.ts +1654 -3
- package/dist/servers.js +2306 -146
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +98 -51
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +21 -4
- package/dist/tools.d.ts +21 -4
- package/dist/tools.js +98 -52
- package/dist/tools.js.map +1 -1
- package/dist/{types-zHhxS7d2.d.cts → types-Cgumy1N4.d.cts} +1 -24
- package/dist/{types-zHhxS7d2.d.ts → types-Cgumy1N4.d.ts} +1 -24
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +8 -8
- package/dist/index-BZxi4104.d.ts +0 -826
- package/dist/index-CapkWqxy.d.ts +0 -1295
- package/dist/index-DX4C3zbo.d.cts +0 -826
- package/dist/index-r7AvpkCE.d.cts +0 -1295
package/dist/dicom.d.cts
CHANGED
|
@@ -1,3 +1,368 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { D as DicomTag, a as DicomTagPath } from './DicomInstance-DNHPkkzl.cjs';
|
|
2
|
+
export { C as ChangeSet, b as DicomDataset, d as DicomInstance } from './DicomInstance-DNHPkkzl.cjs';
|
|
3
|
+
export { x as xmlToJson } from './dcmodify-Gds9u5Vj.cjs';
|
|
4
|
+
import './types-Cgumy1N4.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DICOM Value Representation (VR) definitions, categories, and metadata.
|
|
8
|
+
*
|
|
9
|
+
* Provides a complete catalogue of all 34 standard DICOM VRs with their
|
|
10
|
+
* constraints (max length, padding, fixed-length) and category classification.
|
|
11
|
+
*
|
|
12
|
+
* @module dicom/vr
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* All 34 standard DICOM Value Representation codes.
|
|
16
|
+
*
|
|
17
|
+
* @see DICOM PS3.5 Section 6.2
|
|
18
|
+
*/
|
|
19
|
+
declare const VR: {
|
|
20
|
+
/** Application Entity — 16 bytes max, leading/trailing spaces significant */
|
|
21
|
+
readonly AE: "AE";
|
|
22
|
+
/** Age String — 4 bytes fixed, e.g. "032Y" */
|
|
23
|
+
readonly AS: "AS";
|
|
24
|
+
/** Attribute Tag — 4 bytes fixed */
|
|
25
|
+
readonly AT: "AT";
|
|
26
|
+
/** Code String — 16 bytes max */
|
|
27
|
+
readonly CS: "CS";
|
|
28
|
+
/** Date — 8 bytes fixed, YYYYMMDD */
|
|
29
|
+
readonly DA: "DA";
|
|
30
|
+
/** Decimal String — 16 bytes max per value */
|
|
31
|
+
readonly DS: "DS";
|
|
32
|
+
/** Date Time — 26 bytes max */
|
|
33
|
+
readonly DT: "DT";
|
|
34
|
+
/** Floating Point Double — 8 bytes fixed */
|
|
35
|
+
readonly FD: "FD";
|
|
36
|
+
/** Floating Point Single — 4 bytes fixed */
|
|
37
|
+
readonly FL: "FL";
|
|
38
|
+
/** Integer String — 12 bytes max */
|
|
39
|
+
readonly IS: "IS";
|
|
40
|
+
/** Long String — 64 chars max */
|
|
41
|
+
readonly LO: "LO";
|
|
42
|
+
/** Long Text — 10240 chars max */
|
|
43
|
+
readonly LT: "LT";
|
|
44
|
+
/** Other Byte — no max */
|
|
45
|
+
readonly OB: "OB";
|
|
46
|
+
/** Other Double — no max */
|
|
47
|
+
readonly OD: "OD";
|
|
48
|
+
/** Other Float — no max */
|
|
49
|
+
readonly OF: "OF";
|
|
50
|
+
/** Other Long — no max */
|
|
51
|
+
readonly OL: "OL";
|
|
52
|
+
/** Other 64-bit Very Long — no max */
|
|
53
|
+
readonly OV: "OV";
|
|
54
|
+
/** Other Word — no max */
|
|
55
|
+
readonly OW: "OW";
|
|
56
|
+
/** Person Name — 64 chars max per component group */
|
|
57
|
+
readonly PN: "PN";
|
|
58
|
+
/** Short String — 16 chars max */
|
|
59
|
+
readonly SH: "SH";
|
|
60
|
+
/** Signed Long — 4 bytes fixed */
|
|
61
|
+
readonly SL: "SL";
|
|
62
|
+
/** Sequence of Items — no max */
|
|
63
|
+
readonly SQ: "SQ";
|
|
64
|
+
/** Signed Short — 2 bytes fixed */
|
|
65
|
+
readonly SS: "SS";
|
|
66
|
+
/** Short Text — 1024 chars max */
|
|
67
|
+
readonly ST: "ST";
|
|
68
|
+
/** Signed 64-bit Very Long — 8 bytes fixed */
|
|
69
|
+
readonly SV: "SV";
|
|
70
|
+
/** Time — 14 bytes max */
|
|
71
|
+
readonly TM: "TM";
|
|
72
|
+
/** Unlimited Characters — no max */
|
|
73
|
+
readonly UC: "UC";
|
|
74
|
+
/** Unique Identifier (UID) — 64 bytes max */
|
|
75
|
+
readonly UI: "UI";
|
|
76
|
+
/** Unsigned Long — 4 bytes fixed */
|
|
77
|
+
readonly UL: "UL";
|
|
78
|
+
/** Unknown — no max */
|
|
79
|
+
readonly UN: "UN";
|
|
80
|
+
/** Universal Resource Identifier/Locator — no max */
|
|
81
|
+
readonly UR: "UR";
|
|
82
|
+
/** Unsigned Short — 2 bytes fixed */
|
|
83
|
+
readonly US: "US";
|
|
84
|
+
/** Unlimited Text — no max */
|
|
85
|
+
readonly UT: "UT";
|
|
86
|
+
/** Unsigned 64-bit Very Long — 8 bytes fixed */
|
|
87
|
+
readonly UV: "UV";
|
|
88
|
+
};
|
|
89
|
+
/** A valid DICOM Value Representation code. */
|
|
90
|
+
type VRValue = (typeof VR)[keyof typeof VR];
|
|
91
|
+
/** Names for the five VR categories. */
|
|
92
|
+
declare const VR_CATEGORY_NAME: {
|
|
93
|
+
readonly STRING: "STRING";
|
|
94
|
+
readonly NUMERIC: "NUMERIC";
|
|
95
|
+
readonly BINARY: "BINARY";
|
|
96
|
+
readonly SEQUENCE: "SEQUENCE";
|
|
97
|
+
readonly TAG: "TAG";
|
|
98
|
+
};
|
|
99
|
+
/** A VR category name. */
|
|
100
|
+
type VRCategoryName = (typeof VR_CATEGORY_NAME)[keyof typeof VR_CATEGORY_NAME];
|
|
101
|
+
/**
|
|
102
|
+
* VR codes grouped by category.
|
|
103
|
+
*
|
|
104
|
+
* - STRING: text-based VRs that hold character data
|
|
105
|
+
* - NUMERIC: VRs that hold numeric data (integer or float)
|
|
106
|
+
* - BINARY: VRs that hold raw binary/byte data
|
|
107
|
+
* - SEQUENCE: the SQ VR for nested datasets
|
|
108
|
+
* - TAG: the AT VR for attribute tag references
|
|
109
|
+
*/
|
|
110
|
+
declare const VR_CATEGORY: {
|
|
111
|
+
readonly STRING: readonly ["AE", "AS", "CS", "DA", "DS", "DT", "IS", "LO", "LT", "PN", "SH", "ST", "TM", "UC", "UI", "UR", "UT"];
|
|
112
|
+
readonly NUMERIC: readonly ["FD", "FL", "SL", "SS", "SV", "UL", "US", "UV"];
|
|
113
|
+
readonly BINARY: readonly ["OB", "OD", "OF", "OL", "OV", "OW", "UN"];
|
|
114
|
+
readonly SEQUENCE: readonly ["SQ"];
|
|
115
|
+
readonly TAG: readonly ["AT"];
|
|
116
|
+
};
|
|
117
|
+
/** Metadata describing the constraints of a single VR. */
|
|
118
|
+
interface VRMetadata {
|
|
119
|
+
/** Maximum value length in bytes/chars, or null if unlimited. */
|
|
120
|
+
readonly maxLength: number | null;
|
|
121
|
+
/** Character used for padding to even length, or null if no padding. */
|
|
122
|
+
readonly paddingChar: ' ' | '\0' | null;
|
|
123
|
+
/** Whether this VR has a fixed (non-variable) length. */
|
|
124
|
+
readonly fixed: boolean;
|
|
125
|
+
/** The category this VR belongs to. */
|
|
126
|
+
readonly category: VRCategoryName;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Complete metadata for all 34 standard DICOM VRs.
|
|
130
|
+
*
|
|
131
|
+
* @see DICOM PS3.5 Table 6.2-1
|
|
132
|
+
*/
|
|
133
|
+
declare const VR_META: Readonly<Record<VRValue, VRMetadata>>;
|
|
134
|
+
/**
|
|
135
|
+
* Type guard: checks whether a string is a valid DICOM VR code.
|
|
136
|
+
*
|
|
137
|
+
* @param vr - The string to check
|
|
138
|
+
* @returns True if `vr` is one of the 34 standard VR codes
|
|
139
|
+
*/
|
|
140
|
+
declare function isStringVR(vr: string): vr is VRValue;
|
|
141
|
+
/**
|
|
142
|
+
* Checks whether a VR code represents a numeric value representation.
|
|
143
|
+
*
|
|
144
|
+
* @param vr - The VR code to check
|
|
145
|
+
* @returns True if the VR is FD, FL, SL, SS, SV, UL, US, or UV
|
|
146
|
+
*/
|
|
147
|
+
declare function isNumericVR(vr: string): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Checks whether a VR code represents a binary value representation.
|
|
150
|
+
*
|
|
151
|
+
* @param vr - The VR code to check
|
|
152
|
+
* @returns True if the VR is OB, OD, OF, OL, OV, OW, or UN
|
|
153
|
+
*/
|
|
154
|
+
declare function isBinaryVR(vr: string): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Returns the category name for a given VR code.
|
|
157
|
+
*
|
|
158
|
+
* @param vr - A valid VR code
|
|
159
|
+
* @returns The category name (STRING, NUMERIC, BINARY, SEQUENCE, or TAG)
|
|
160
|
+
*/
|
|
161
|
+
declare function getVRCategory(vr: VRValue): VRCategoryName;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* DICOM tag dictionary with O(1) lookup by tag and lazy reverse lookup by name.
|
|
165
|
+
*
|
|
166
|
+
* Uses the shipped `src/data/dictionary.json` generated from `_configs/dicom.dic.json`.
|
|
167
|
+
*
|
|
168
|
+
* @module dicom/dictionary
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/** A single entry from the DICOM data dictionary. */
|
|
172
|
+
interface DictionaryEntry {
|
|
173
|
+
/** The Value Representation code (e.g. "PN", "LO", "US"). */
|
|
174
|
+
readonly vr: VRValue;
|
|
175
|
+
/** The standard keyword name (e.g. "PatientName"). */
|
|
176
|
+
readonly name: string;
|
|
177
|
+
/** Value multiplicity as [min, max], where max is null if unbounded. */
|
|
178
|
+
readonly vm: readonly [number, number | null];
|
|
179
|
+
/** Whether this tag is retired in the current DICOM standard. */
|
|
180
|
+
readonly retired: boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Looks up a DICOM tag in the data dictionary.
|
|
184
|
+
*
|
|
185
|
+
* Accepts tags in either branded `DicomTag` format `"(0010,0010)"` or
|
|
186
|
+
* raw 8-char hex format `"00100010"`.
|
|
187
|
+
*
|
|
188
|
+
* @param tag - A DicomTag or 8-char hex string
|
|
189
|
+
* @returns The dictionary entry, or undefined if the tag is not in the dictionary
|
|
190
|
+
*/
|
|
191
|
+
declare function lookupTag(tag: DicomTag | string): DictionaryEntry | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Looks up a DICOM tag by its standard keyword name.
|
|
194
|
+
*
|
|
195
|
+
* @param name - The standard keyword (e.g. "PatientName", "Modality")
|
|
196
|
+
* @returns An object with the 8-char hex tag and dictionary entry, or undefined
|
|
197
|
+
*/
|
|
198
|
+
declare function lookupTagByName(name: string): {
|
|
199
|
+
readonly tag: string;
|
|
200
|
+
readonly entry: DictionaryEntry;
|
|
201
|
+
} | undefined;
|
|
202
|
+
/**
|
|
203
|
+
* Looks up a DICOM tag by its standard keyword, returning just the branded DicomTag.
|
|
204
|
+
*
|
|
205
|
+
* @param keyword - The standard keyword (e.g. "PatientName")
|
|
206
|
+
* @returns The DicomTag in `(XXXX,XXXX)` format, or undefined if not found
|
|
207
|
+
*/
|
|
208
|
+
declare function lookupTagByKeyword(keyword: string): DicomTag | undefined;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Curated list of common DICOM SOP Class UIDs.
|
|
212
|
+
*
|
|
213
|
+
* This is not exhaustive — DICOM defines hundreds of SOP classes.
|
|
214
|
+
* This file covers the ~70 most commonly encountered SOP classes
|
|
215
|
+
* in clinical and research imaging workflows.
|
|
216
|
+
*
|
|
217
|
+
* @see DICOM PS3.4 Annex B — SOP Class definitions
|
|
218
|
+
* @module data/sopClasses
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* Common DICOM SOP Class UIDs.
|
|
222
|
+
*
|
|
223
|
+
* Keys are PascalCase names matching the DICOM standard keyword.
|
|
224
|
+
* Values are the dotted-numeric UID strings.
|
|
225
|
+
*/
|
|
226
|
+
declare const SOP_CLASSES: {
|
|
227
|
+
readonly Verification: "1.2.840.10008.1.1";
|
|
228
|
+
readonly ComputedRadiographyImageStorage: "1.2.840.10008.5.1.4.1.1.1";
|
|
229
|
+
readonly DigitalXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.1.1";
|
|
230
|
+
readonly DigitalXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.1.1.1";
|
|
231
|
+
readonly DigitalMammographyXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.1.2";
|
|
232
|
+
readonly DigitalMammographyXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.1.2.1";
|
|
233
|
+
readonly CTImageStorage: "1.2.840.10008.5.1.4.1.1.2";
|
|
234
|
+
readonly EnhancedCTImageStorage: "1.2.840.10008.5.1.4.1.1.2.1";
|
|
235
|
+
readonly UltrasoundMultiFrameImageStorage: "1.2.840.10008.5.1.4.1.1.3.1";
|
|
236
|
+
readonly MRImageStorage: "1.2.840.10008.5.1.4.1.1.4";
|
|
237
|
+
readonly EnhancedMRImageStorage: "1.2.840.10008.5.1.4.1.1.4.1";
|
|
238
|
+
readonly MRSpectroscopyStorage: "1.2.840.10008.5.1.4.1.1.4.2";
|
|
239
|
+
readonly EnhancedMRColorImageStorage: "1.2.840.10008.5.1.4.1.1.4.3";
|
|
240
|
+
readonly UltrasoundImageStorage: "1.2.840.10008.5.1.4.1.1.6.1";
|
|
241
|
+
readonly EnhancedUSVolumeStorage: "1.2.840.10008.5.1.4.1.1.6.2";
|
|
242
|
+
readonly SecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7";
|
|
243
|
+
readonly MultiFrameSingleBitSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.1";
|
|
244
|
+
readonly MultiFrameGrayscaleByteSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.2";
|
|
245
|
+
readonly MultiFrameGrayscaleWordSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.3";
|
|
246
|
+
readonly MultiFrameTrueColorSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.4";
|
|
247
|
+
readonly XRayAngiographicImageStorage: "1.2.840.10008.5.1.4.1.1.12.1";
|
|
248
|
+
readonly EnhancedXAImageStorage: "1.2.840.10008.5.1.4.1.1.12.1.1";
|
|
249
|
+
readonly XRayRadiofluoroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.12.2";
|
|
250
|
+
readonly EnhancedXRFImageStorage: "1.2.840.10008.5.1.4.1.1.12.2.1";
|
|
251
|
+
readonly NuclearMedicineImageStorage: "1.2.840.10008.5.1.4.1.1.20";
|
|
252
|
+
readonly VLEndoscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.1";
|
|
253
|
+
readonly VLMicroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.2";
|
|
254
|
+
readonly VLSlideCoordinatesMicroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.3";
|
|
255
|
+
readonly VLPhotographicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.4";
|
|
256
|
+
readonly OphthalmicPhotography8BitImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.1";
|
|
257
|
+
readonly OphthalmicPhotography16BitImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.2";
|
|
258
|
+
readonly VLWholeSlideMicroscopyImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.6";
|
|
259
|
+
readonly PositronEmissionTomographyImageStorage: "1.2.840.10008.5.1.4.1.1.128";
|
|
260
|
+
readonly EnhancedPETImageStorage: "1.2.840.10008.5.1.4.1.1.130";
|
|
261
|
+
readonly RTImageStorage: "1.2.840.10008.5.1.4.1.1.481.1";
|
|
262
|
+
readonly RTDoseStorage: "1.2.840.10008.5.1.4.1.1.481.2";
|
|
263
|
+
readonly RTStructureSetStorage: "1.2.840.10008.5.1.4.1.1.481.3";
|
|
264
|
+
readonly RTBeamsTreatmentRecordStorage: "1.2.840.10008.5.1.4.1.1.481.4";
|
|
265
|
+
readonly RTPlanStorage: "1.2.840.10008.5.1.4.1.1.481.5";
|
|
266
|
+
readonly RTBrachyTreatmentRecordStorage: "1.2.840.10008.5.1.4.1.1.481.6";
|
|
267
|
+
readonly RTTreatmentSummaryRecordStorage: "1.2.840.10008.5.1.4.1.1.481.7";
|
|
268
|
+
readonly RTIonPlanStorage: "1.2.840.10008.5.1.4.1.1.481.8";
|
|
269
|
+
readonly RTIonBeamsTreatmentRecordStorage: "1.2.840.10008.5.1.4.1.1.481.9";
|
|
270
|
+
readonly BasicTextSRStorage: "1.2.840.10008.5.1.4.1.1.88.11";
|
|
271
|
+
readonly EnhancedSRStorage: "1.2.840.10008.5.1.4.1.1.88.22";
|
|
272
|
+
readonly ComprehensiveSRStorage: "1.2.840.10008.5.1.4.1.1.88.33";
|
|
273
|
+
readonly Comprehensive3DSRStorage: "1.2.840.10008.5.1.4.1.1.88.34";
|
|
274
|
+
readonly KeyObjectSelectionDocumentStorage: "1.2.840.10008.5.1.4.1.1.88.59";
|
|
275
|
+
readonly GrayscaleSoftcopyPresentationStateStorage: "1.2.840.10008.5.1.4.1.1.11.1";
|
|
276
|
+
readonly ColorSoftcopyPresentationStateStorage: "1.2.840.10008.5.1.4.1.1.11.2";
|
|
277
|
+
readonly EncapsulatedPDFStorage: "1.2.840.10008.5.1.4.1.1.104.1";
|
|
278
|
+
readonly EncapsulatedCDAStorage: "1.2.840.10008.5.1.4.1.1.104.2";
|
|
279
|
+
readonly RawDataStorage: "1.2.840.10008.5.1.4.1.1.66";
|
|
280
|
+
readonly SpatialRegistrationStorage: "1.2.840.10008.5.1.4.1.1.66.1";
|
|
281
|
+
readonly SpatialFiducialsStorage: "1.2.840.10008.5.1.4.1.1.66.2";
|
|
282
|
+
readonly DeformableSpatialRegistrationStorage: "1.2.840.10008.5.1.4.1.1.66.3";
|
|
283
|
+
readonly SegmentationStorage: "1.2.840.10008.5.1.4.1.1.66.4";
|
|
284
|
+
readonly SurfaceSegmentationStorage: "1.2.840.10008.5.1.4.1.1.66.5";
|
|
285
|
+
readonly TwelveLeadECGWaveformStorage: "1.2.840.10008.5.1.4.1.1.9.1.1";
|
|
286
|
+
readonly GeneralECGWaveformStorage: "1.2.840.10008.5.1.4.1.1.9.1.2";
|
|
287
|
+
readonly AmbulatoryECGWaveformStorage: "1.2.840.10008.5.1.4.1.1.9.1.3";
|
|
288
|
+
readonly HemodynamicWaveformStorage: "1.2.840.10008.5.1.4.1.1.9.2.1";
|
|
289
|
+
readonly BasicVoiceAudioWaveformStorage: "1.2.840.10008.5.1.4.1.1.9.4.1";
|
|
290
|
+
readonly PatientRootQueryRetrieveInformationModelFind: "1.2.840.10008.5.1.4.1.2.1.1";
|
|
291
|
+
readonly PatientRootQueryRetrieveInformationModelMove: "1.2.840.10008.5.1.4.1.2.1.2";
|
|
292
|
+
readonly PatientRootQueryRetrieveInformationModelGet: "1.2.840.10008.5.1.4.1.2.1.3";
|
|
293
|
+
readonly StudyRootQueryRetrieveInformationModelFind: "1.2.840.10008.5.1.4.1.2.2.1";
|
|
294
|
+
readonly StudyRootQueryRetrieveInformationModelMove: "1.2.840.10008.5.1.4.1.2.2.2";
|
|
295
|
+
readonly StudyRootQueryRetrieveInformationModelGet: "1.2.840.10008.5.1.4.1.2.2.3";
|
|
296
|
+
readonly ModalityWorklistInformationModelFind: "1.2.840.10008.5.1.4.31";
|
|
297
|
+
readonly StorageCommitmentPushModel: "1.2.840.10008.1.20.1";
|
|
298
|
+
};
|
|
299
|
+
/** A SOP class name key from the curated list. */
|
|
300
|
+
type SOPClassName = keyof typeof SOP_CLASSES;
|
|
301
|
+
/**
|
|
302
|
+
* Looks up the SOP class name for a given UID string.
|
|
303
|
+
*
|
|
304
|
+
* @param uid - A DICOM SOP Class UID string
|
|
305
|
+
* @returns The SOP class name, or undefined if not in the curated list
|
|
306
|
+
*/
|
|
307
|
+
declare function sopClassNameFromUID(uid: string): SOPClassName | undefined;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* DICOM tag path parser and serializer.
|
|
311
|
+
*
|
|
312
|
+
* Provides iterative (no recursion) parsing of DICOM tag paths like
|
|
313
|
+
* `(0040,A730)[0].(0040,A160)` into structured segments, and conversion
|
|
314
|
+
* back to dcmodify-compatible strings.
|
|
315
|
+
*
|
|
316
|
+
* Supports wildcard indices `[*]` for use with DicomDataset.findValues.
|
|
317
|
+
*
|
|
318
|
+
* @module dicom/tagPath
|
|
319
|
+
*/
|
|
320
|
+
|
|
321
|
+
/** A single segment of a parsed DICOM tag path. */
|
|
322
|
+
interface TagSegment {
|
|
323
|
+
/** The DICOM tag for this segment. */
|
|
324
|
+
readonly tag: DicomTag;
|
|
325
|
+
/** The array index for sequence items, or undefined for non-sequence tags. */
|
|
326
|
+
readonly index?: number | undefined;
|
|
327
|
+
/** Whether this segment uses a wildcard index `[*]`. */
|
|
328
|
+
readonly isWildcard?: boolean | undefined;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Parses a DICOM tag path into an array of segments.
|
|
332
|
+
*
|
|
333
|
+
* Uses iterative parsing with bounded loop (Rule 8.2: no recursion).
|
|
334
|
+
*
|
|
335
|
+
* @param path - A branded DicomTagPath string
|
|
336
|
+
* @returns An array of TagSegment objects
|
|
337
|
+
* @throws Error if the path is malformed or exceeds MAX_TRAVERSAL_DEPTH
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```ts
|
|
341
|
+
* tagPathToSegments('(0040,A730)[0].(0040,A160)' as DicomTagPath)
|
|
342
|
+
* // => [
|
|
343
|
+
* // { tag: '(0040,A730)' as DicomTag, index: 0 },
|
|
344
|
+
* // { tag: '(0040,A160)' as DicomTag }
|
|
345
|
+
* // ]
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
declare function tagPathToSegments(path: DicomTagPath): ReadonlyArray<TagSegment>;
|
|
349
|
+
/**
|
|
350
|
+
* Converts tag segments back to a dcmodify-compatible path string.
|
|
351
|
+
*
|
|
352
|
+
* Format: `(0040,A730)[0].(0040,A160)`
|
|
353
|
+
*
|
|
354
|
+
* @param segments - An array of TagSegment objects
|
|
355
|
+
* @returns A dcmodify-compatible path string
|
|
356
|
+
*/
|
|
357
|
+
declare function segmentsToModifyPath(segments: ReadonlyArray<TagSegment>): string;
|
|
358
|
+
/**
|
|
359
|
+
* Converts tag segments to a canonical display string.
|
|
360
|
+
*
|
|
361
|
+
* Same format as dcmodify path: `(0040,A730)[0].(0040,A160)`
|
|
362
|
+
*
|
|
363
|
+
* @param segments - An array of TagSegment objects
|
|
364
|
+
* @returns A human-readable path string
|
|
365
|
+
*/
|
|
366
|
+
declare function segmentsToString(segments: ReadonlyArray<TagSegment>): string;
|
|
367
|
+
|
|
368
|
+
export { type DictionaryEntry, type SOPClassName, SOP_CLASSES, type TagSegment, VR, type VRCategoryName, type VRMetadata, type VRValue, VR_CATEGORY, VR_CATEGORY_NAME, VR_META, getVRCategory, isBinaryVR, isNumericVR, isStringVR, lookupTag, lookupTagByKeyword, lookupTagByName, segmentsToModifyPath, segmentsToString, sopClassNameFromUID, tagPathToSegments };
|