@ubercode/dcmtk 1.0.0-rc.1 → 1.0.0-rc.3
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/{DicomInstance-DGWB2mfD.d.ts → DicomInstance-A11-CkGx.d.ts} +30 -2
- package/dist/{DicomInstance-BGXtON9T.d.cts → DicomInstance-Ce4mcUT9.d.cts} +30 -2
- package/dist/dicom.cjs +1024 -35
- package/dist/dicom.cjs.map +1 -1
- package/dist/dicom.d.cts +2 -2
- package/dist/dicom.d.ts +2 -2
- package/dist/dicom.js +1024 -36
- package/dist/dicom.js.map +1 -1
- package/dist/{index-C6dWOhHS.d.ts → index-CPVO4eNC.d.ts} +1 -1
- package/dist/{index-D1msvaAt.d.cts → index-CSd2_zMM.d.cts} +1 -1
- package/dist/index.cjs +1046 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1045 -43
- package/dist/index.js.map +1 -1
- package/dist/servers.cjs +30451 -36
- package/dist/servers.cjs.map +1 -1
- package/dist/servers.d.cts +2 -2
- package/dist/servers.d.ts +2 -2
- package/dist/servers.js +30451 -37
- package/dist/servers.js.map +1 -1
- package/dist/tools.cjs +30387 -14
- package/dist/tools.cjs.map +1 -1
- package/dist/tools.d.cts +91 -2
- package/dist/tools.d.ts +91 -2
- package/dist/tools.js +30386 -16
- package/dist/tools.js.map +1 -1
- package/package.json +3 -1
package/dist/tools.d.cts
CHANGED
|
@@ -108,12 +108,20 @@ interface Dcm2jsonResult {
|
|
|
108
108
|
readonly source: Dcm2jsonSource;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
-
* Converts a DICOM file to the DICOM JSON Model.
|
|
111
|
+
* Converts a DICOM file to the DICOM JSON Model using DCMTK binaries.
|
|
112
112
|
*
|
|
113
113
|
* Uses a two-phase strategy:
|
|
114
114
|
* 1. Primary: dcm2xml → XML-to-JSON conversion (more reliable)
|
|
115
115
|
* 2. Fallback: direct dcm2json binary with JSON repair
|
|
116
116
|
*
|
|
117
|
+
* The fallback only runs when time budget remains; when both paths fail,
|
|
118
|
+
* the returned error includes both failures.
|
|
119
|
+
*
|
|
120
|
+
* @deprecated Use {@link dicom2json} — the pure-JS parser is ~75x faster,
|
|
121
|
+
* needs no DCMTK binaries, and preserves private tags correctly (this
|
|
122
|
+
* binary path renumbers private blocks in its XML output). This function
|
|
123
|
+
* remains available as an escape hatch (see `dcmtkFallback` on dicom2json).
|
|
124
|
+
*
|
|
117
125
|
* @param inputPath - Path to the DICOM input file
|
|
118
126
|
* @param options - Conversion options
|
|
119
127
|
* @returns A Result containing the DICOM JSON Model with source discriminant
|
|
@@ -129,6 +137,87 @@ interface Dcm2jsonResult {
|
|
|
129
137
|
*/
|
|
130
138
|
declare function dcm2json(inputPath: string, options?: Dcm2jsonOptions): Promise<Result<Dcm2jsonResult>>;
|
|
131
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Pure-JS DICOM to JSON conversion — no DCMTK binaries required.
|
|
142
|
+
*
|
|
143
|
+
* Parses DICOM Part-10 files directly in-process (via `dicom-parser`) and
|
|
144
|
+
* produces the same DICOM JSON Model shape as {@link dcm2json}, orders of
|
|
145
|
+
* magnitude faster: no process spawn, no XML intermediate, and bulk pixel
|
|
146
|
+
* data is never loaded.
|
|
147
|
+
*
|
|
148
|
+
* Differences from the dcm2json/dcm2xml output, by design:
|
|
149
|
+
* - File meta group 0002 elements are included, so
|
|
150
|
+
* `DicomDataset.transferSyntaxUID` returns the actual transfer syntax.
|
|
151
|
+
* - Group length elements (gggg,0000) are always omitted.
|
|
152
|
+
*
|
|
153
|
+
* Set `dcmtkFallback: true` to retry with the deprecated {@link dcm2json}
|
|
154
|
+
* binary path when the JS parser fails (e.g. exotic files DCMTK tolerates).
|
|
155
|
+
*
|
|
156
|
+
* @module dicom2json
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
/** Indicates which engine produced the result. 'js' is the pure-JS parser; 'xml' and 'direct' come from the DCMTK fallback. */
|
|
160
|
+
type Dicom2jsonSource = 'js' | 'xml' | 'direct';
|
|
161
|
+
/** Options for {@link dicom2json}. */
|
|
162
|
+
interface Dicom2jsonOptions extends ToolBaseOptions {
|
|
163
|
+
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent. Accepts DICOM defined terms ('ISO_IR 100') or DCMTK-style aliases ('latin-1'). */
|
|
164
|
+
readonly charsetAssume?: string | undefined;
|
|
165
|
+
/** Charset to decode with when the file's specified character set is unsupported. `'latin-1'` recommended — maps every byte to a valid character. */
|
|
166
|
+
readonly charsetFallback?: string | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Decode values detected as mislabeled UTF-8 (high bytes forming valid UTF-8 under a single-byte declared charset)
|
|
169
|
+
* as UTF-8 instead of the declared charset. A `possible UTF-8 mislabel` warning is pushed either way. Defaults to false.
|
|
170
|
+
*/
|
|
171
|
+
readonly utf8MislabelPromote?: boolean | undefined;
|
|
172
|
+
/** Retry with the deprecated dcm2json binary path when the JS parser fails. Defaults to false. */
|
|
173
|
+
readonly dcmtkFallback?: boolean | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Bounded head-read: for files above ~8 MB, read only the metadata and skip bulk value bytes
|
|
176
|
+
* (PixelData and friends), keeping peak memory proportional to the metadata instead of the file.
|
|
177
|
+
* The parse output is identical — bulk VRs are always emitted as bare `{ vr }`. Set false to
|
|
178
|
+
* always read the whole file. Defaults to true.
|
|
179
|
+
*/
|
|
180
|
+
readonly boundedRead?: boolean | undefined;
|
|
181
|
+
}
|
|
182
|
+
/** Options for {@link dicom2jsonFromBuffer} (charset handling only). */
|
|
183
|
+
type Dicom2jsonBufferOptions = Pick<Dicom2jsonOptions, 'charsetAssume' | 'charsetFallback' | 'utf8MislabelPromote'>;
|
|
184
|
+
/** Result of a successful dicom2json conversion. */
|
|
185
|
+
interface Dicom2jsonResult {
|
|
186
|
+
/** The DICOM JSON Model object. */
|
|
187
|
+
readonly data: DicomJsonModel;
|
|
188
|
+
/** Non-fatal parser warnings (empty for DCMTK fallback results). */
|
|
189
|
+
readonly warnings: readonly string[];
|
|
190
|
+
/** Which engine produced this result. */
|
|
191
|
+
readonly source: Dicom2jsonSource;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Converts a DICOM file to the DICOM JSON Model using the pure-JS parser.
|
|
195
|
+
*
|
|
196
|
+
* @param inputPath - Path to the DICOM input file
|
|
197
|
+
* @param options - Conversion options
|
|
198
|
+
* @returns A Result containing the DICOM JSON Model with source discriminant
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* const result = await dicom2json('/path/to/study.dcm');
|
|
203
|
+
* if (result.ok) {
|
|
204
|
+
* console.log(result.value.source); // 'js'
|
|
205
|
+
* console.log(result.value.data['00100010']); // Patient Name
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
declare function dicom2json(inputPath: string, options?: Dicom2jsonOptions): Promise<Result<Dicom2jsonResult>>;
|
|
210
|
+
/**
|
|
211
|
+
* Converts an in-memory DICOM Part-10 buffer to the DICOM JSON Model.
|
|
212
|
+
*
|
|
213
|
+
* Synchronous — no file I/O, no timeout, no DCMTK fallback.
|
|
214
|
+
*
|
|
215
|
+
* @param buffer - The DICOM file bytes
|
|
216
|
+
* @param options - Charset handling options
|
|
217
|
+
* @returns A Result containing the DICOM JSON Model
|
|
218
|
+
*/
|
|
219
|
+
declare function dicom2jsonFromBuffer(buffer: Uint8Array, options?: Dicom2jsonBufferOptions): Result<Dicom2jsonResult>;
|
|
220
|
+
|
|
132
221
|
/**
|
|
133
222
|
* Dump DICOM metadata as text using the dcmdump binary.
|
|
134
223
|
*
|
|
@@ -2286,4 +2375,4 @@ interface DcmmklutResult {
|
|
|
2286
2375
|
*/
|
|
2287
2376
|
declare function dcmmklut(outputPath: string, options?: DcmmklutOptions): Promise<Result<DcmmklutResult>>;
|
|
2288
2377
|
|
|
2289
|
-
export { type Cda2dcmOptions, type Cda2dcmResult, ColorConversion, type ColorConversionValue, type Dcm2cdaOptions, type Dcm2cdaResult, type Dcm2jsonOptions, type Dcm2jsonResult, type Dcm2jsonSource, type Dcm2pdfOptions, type Dcm2pdfResult, type Dcm2pnmOptions, Dcm2pnmOutputFormat, type Dcm2pnmOutputFormatValue, type Dcm2pnmResult, Dcm2xmlCharset, type Dcm2xmlCharsetValue, type Dcm2xmlOptions, type Dcm2xmlResult, type DcmcjpegOptions, type DcmcjpegResult, type DcmcjplsOptions, type DcmcjplsResult, type DcmconvOptions, type DcmconvResult, type DcmcrleOptions, type DcmcrleResult, type DcmdecapOptions, type DcmdecapResult, type DcmdjpegOptions, type DcmdjpegResult, type DcmdjplsOptions, type DcmdjplsResult, type DcmdrleOptions, type DcmdrleResult, type DcmdspfnOptions, type DcmdspfnResult, DcmdumpFormat, type DcmdumpFormatValue, type DcmdumpOptions, type DcmdumpResult, type DcmencapOptions, type DcmencapResult, type DcmftestOptions, type DcmftestResult, type DcmgpdirOptions, type DcmgpdirResult, type Dcmj2pnmOptions, Dcmj2pnmOutputFormat, type Dcmj2pnmOutputFormatValue, type Dcmj2pnmResult, type DcmmkcrvOptions, type DcmmkcrvResult, type DcmmkdirOptions, type DcmmkdirResult, type DcmmklutOptions, type DcmmklutResult, type Dcmp2pgmOptions, type Dcmp2pgmResult, type DcmprscuOptions, type DcmprscuResult, type DcmpschkOptions, type DcmpschkResult, type DcmpsmkOptions, type DcmpsmkResult, type DcmpsprtOptions, type DcmpsprtResult, type DcmqridxOptions, type DcmqridxResult, type DcmquantOptions, type DcmquantResult, type DcmscaleOptions, type DcmscaleResult, type DcmsendOptions, type DcmsendResult, type Dcod2lumOptions, type Dcod2lumResult, type DconvlumOptions, type DconvlumResult, DicomJsonModel, type DrtdumpOptions, type DrtdumpResult, type Dsr2xmlOptions, type Dsr2xmlResult, type DsrdumpOptions, type DsrdumpResult, type Dump2dcmOptions, type Dump2dcmResult, type EchoscuOptions, type EchoscuResult, type FindscuOptions, type FindscuResult, GetQueryModel, type GetQueryModelValue, type GetscuOptions, type GetscuResult, Img2dcmInputFormat, type Img2dcmInputFormatValue, type Img2dcmOptions, type Img2dcmResult, JplsColorConversion, type JplsColorConversionValue, type Json2dcmOptions, type Json2dcmResult, LutType, type LutTypeValue, MoveQueryModel, type MoveQueryModelValue, type MovescuOptions, type MovescuResult, type Pdf2dcmOptions, type Pdf2dcmResult, ProposedTransferSyntax, type ProposedTransferSyntaxValue, QueryModel, type QueryModelValue, type Stl2dcmOptions, type Stl2dcmResult, type StorescuOptions, type StorescuResult, type TermscuOptions, type TermscuResult, ToolBaseOptions, ToolExecutionError, TransferSyntax, type TransferSyntaxValue, type Xml2dcmOptions, type Xml2dcmResult, type Xml2dsrOptions, type Xml2dsrResult, cda2dcm, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, findscu, getscu, img2dcm, json2dcm, movescu, pdf2dcm, stl2dcm, storescu, termscu, xml2dcm, xml2dsr };
|
|
2378
|
+
export { type Cda2dcmOptions, type Cda2dcmResult, ColorConversion, type ColorConversionValue, type Dcm2cdaOptions, type Dcm2cdaResult, type Dcm2jsonOptions, type Dcm2jsonResult, type Dcm2jsonSource, type Dcm2pdfOptions, type Dcm2pdfResult, type Dcm2pnmOptions, Dcm2pnmOutputFormat, type Dcm2pnmOutputFormatValue, type Dcm2pnmResult, Dcm2xmlCharset, type Dcm2xmlCharsetValue, type Dcm2xmlOptions, type Dcm2xmlResult, type DcmcjpegOptions, type DcmcjpegResult, type DcmcjplsOptions, type DcmcjplsResult, type DcmconvOptions, type DcmconvResult, type DcmcrleOptions, type DcmcrleResult, type DcmdecapOptions, type DcmdecapResult, type DcmdjpegOptions, type DcmdjpegResult, type DcmdjplsOptions, type DcmdjplsResult, type DcmdrleOptions, type DcmdrleResult, type DcmdspfnOptions, type DcmdspfnResult, DcmdumpFormat, type DcmdumpFormatValue, type DcmdumpOptions, type DcmdumpResult, type DcmencapOptions, type DcmencapResult, type DcmftestOptions, type DcmftestResult, type DcmgpdirOptions, type DcmgpdirResult, type Dcmj2pnmOptions, Dcmj2pnmOutputFormat, type Dcmj2pnmOutputFormatValue, type Dcmj2pnmResult, type DcmmkcrvOptions, type DcmmkcrvResult, type DcmmkdirOptions, type DcmmkdirResult, type DcmmklutOptions, type DcmmklutResult, type Dcmp2pgmOptions, type Dcmp2pgmResult, type DcmprscuOptions, type DcmprscuResult, type DcmpschkOptions, type DcmpschkResult, type DcmpsmkOptions, type DcmpsmkResult, type DcmpsprtOptions, type DcmpsprtResult, type DcmqridxOptions, type DcmqridxResult, type DcmquantOptions, type DcmquantResult, type DcmscaleOptions, type DcmscaleResult, type DcmsendOptions, type DcmsendResult, type Dcod2lumOptions, type Dcod2lumResult, type DconvlumOptions, type DconvlumResult, type Dicom2jsonBufferOptions, type Dicom2jsonOptions, type Dicom2jsonResult, type Dicom2jsonSource, DicomJsonModel, type DrtdumpOptions, type DrtdumpResult, type Dsr2xmlOptions, type Dsr2xmlResult, type DsrdumpOptions, type DsrdumpResult, type Dump2dcmOptions, type Dump2dcmResult, type EchoscuOptions, type EchoscuResult, type FindscuOptions, type FindscuResult, GetQueryModel, type GetQueryModelValue, type GetscuOptions, type GetscuResult, Img2dcmInputFormat, type Img2dcmInputFormatValue, type Img2dcmOptions, type Img2dcmResult, JplsColorConversion, type JplsColorConversionValue, type Json2dcmOptions, type Json2dcmResult, LutType, type LutTypeValue, MoveQueryModel, type MoveQueryModelValue, type MovescuOptions, type MovescuResult, type Pdf2dcmOptions, type Pdf2dcmResult, ProposedTransferSyntax, type ProposedTransferSyntaxValue, QueryModel, type QueryModelValue, type Stl2dcmOptions, type Stl2dcmResult, type StorescuOptions, type StorescuResult, type TermscuOptions, type TermscuResult, ToolBaseOptions, ToolExecutionError, TransferSyntax, type TransferSyntaxValue, type Xml2dcmOptions, type Xml2dcmResult, type Xml2dsrOptions, type Xml2dsrResult, cda2dcm, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, dicom2json, dicom2jsonFromBuffer, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, findscu, getscu, img2dcm, json2dcm, movescu, pdf2dcm, stl2dcm, storescu, termscu, xml2dcm, xml2dsr };
|
package/dist/tools.d.ts
CHANGED
|
@@ -108,12 +108,20 @@ interface Dcm2jsonResult {
|
|
|
108
108
|
readonly source: Dcm2jsonSource;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
-
* Converts a DICOM file to the DICOM JSON Model.
|
|
111
|
+
* Converts a DICOM file to the DICOM JSON Model using DCMTK binaries.
|
|
112
112
|
*
|
|
113
113
|
* Uses a two-phase strategy:
|
|
114
114
|
* 1. Primary: dcm2xml → XML-to-JSON conversion (more reliable)
|
|
115
115
|
* 2. Fallback: direct dcm2json binary with JSON repair
|
|
116
116
|
*
|
|
117
|
+
* The fallback only runs when time budget remains; when both paths fail,
|
|
118
|
+
* the returned error includes both failures.
|
|
119
|
+
*
|
|
120
|
+
* @deprecated Use {@link dicom2json} — the pure-JS parser is ~75x faster,
|
|
121
|
+
* needs no DCMTK binaries, and preserves private tags correctly (this
|
|
122
|
+
* binary path renumbers private blocks in its XML output). This function
|
|
123
|
+
* remains available as an escape hatch (see `dcmtkFallback` on dicom2json).
|
|
124
|
+
*
|
|
117
125
|
* @param inputPath - Path to the DICOM input file
|
|
118
126
|
* @param options - Conversion options
|
|
119
127
|
* @returns A Result containing the DICOM JSON Model with source discriminant
|
|
@@ -129,6 +137,87 @@ interface Dcm2jsonResult {
|
|
|
129
137
|
*/
|
|
130
138
|
declare function dcm2json(inputPath: string, options?: Dcm2jsonOptions): Promise<Result<Dcm2jsonResult>>;
|
|
131
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Pure-JS DICOM to JSON conversion — no DCMTK binaries required.
|
|
142
|
+
*
|
|
143
|
+
* Parses DICOM Part-10 files directly in-process (via `dicom-parser`) and
|
|
144
|
+
* produces the same DICOM JSON Model shape as {@link dcm2json}, orders of
|
|
145
|
+
* magnitude faster: no process spawn, no XML intermediate, and bulk pixel
|
|
146
|
+
* data is never loaded.
|
|
147
|
+
*
|
|
148
|
+
* Differences from the dcm2json/dcm2xml output, by design:
|
|
149
|
+
* - File meta group 0002 elements are included, so
|
|
150
|
+
* `DicomDataset.transferSyntaxUID` returns the actual transfer syntax.
|
|
151
|
+
* - Group length elements (gggg,0000) are always omitted.
|
|
152
|
+
*
|
|
153
|
+
* Set `dcmtkFallback: true` to retry with the deprecated {@link dcm2json}
|
|
154
|
+
* binary path when the JS parser fails (e.g. exotic files DCMTK tolerates).
|
|
155
|
+
*
|
|
156
|
+
* @module dicom2json
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
/** Indicates which engine produced the result. 'js' is the pure-JS parser; 'xml' and 'direct' come from the DCMTK fallback. */
|
|
160
|
+
type Dicom2jsonSource = 'js' | 'xml' | 'direct';
|
|
161
|
+
/** Options for {@link dicom2json}. */
|
|
162
|
+
interface Dicom2jsonOptions extends ToolBaseOptions {
|
|
163
|
+
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent. Accepts DICOM defined terms ('ISO_IR 100') or DCMTK-style aliases ('latin-1'). */
|
|
164
|
+
readonly charsetAssume?: string | undefined;
|
|
165
|
+
/** Charset to decode with when the file's specified character set is unsupported. `'latin-1'` recommended — maps every byte to a valid character. */
|
|
166
|
+
readonly charsetFallback?: string | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Decode values detected as mislabeled UTF-8 (high bytes forming valid UTF-8 under a single-byte declared charset)
|
|
169
|
+
* as UTF-8 instead of the declared charset. A `possible UTF-8 mislabel` warning is pushed either way. Defaults to false.
|
|
170
|
+
*/
|
|
171
|
+
readonly utf8MislabelPromote?: boolean | undefined;
|
|
172
|
+
/** Retry with the deprecated dcm2json binary path when the JS parser fails. Defaults to false. */
|
|
173
|
+
readonly dcmtkFallback?: boolean | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Bounded head-read: for files above ~8 MB, read only the metadata and skip bulk value bytes
|
|
176
|
+
* (PixelData and friends), keeping peak memory proportional to the metadata instead of the file.
|
|
177
|
+
* The parse output is identical — bulk VRs are always emitted as bare `{ vr }`. Set false to
|
|
178
|
+
* always read the whole file. Defaults to true.
|
|
179
|
+
*/
|
|
180
|
+
readonly boundedRead?: boolean | undefined;
|
|
181
|
+
}
|
|
182
|
+
/** Options for {@link dicom2jsonFromBuffer} (charset handling only). */
|
|
183
|
+
type Dicom2jsonBufferOptions = Pick<Dicom2jsonOptions, 'charsetAssume' | 'charsetFallback' | 'utf8MislabelPromote'>;
|
|
184
|
+
/** Result of a successful dicom2json conversion. */
|
|
185
|
+
interface Dicom2jsonResult {
|
|
186
|
+
/** The DICOM JSON Model object. */
|
|
187
|
+
readonly data: DicomJsonModel;
|
|
188
|
+
/** Non-fatal parser warnings (empty for DCMTK fallback results). */
|
|
189
|
+
readonly warnings: readonly string[];
|
|
190
|
+
/** Which engine produced this result. */
|
|
191
|
+
readonly source: Dicom2jsonSource;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Converts a DICOM file to the DICOM JSON Model using the pure-JS parser.
|
|
195
|
+
*
|
|
196
|
+
* @param inputPath - Path to the DICOM input file
|
|
197
|
+
* @param options - Conversion options
|
|
198
|
+
* @returns A Result containing the DICOM JSON Model with source discriminant
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* const result = await dicom2json('/path/to/study.dcm');
|
|
203
|
+
* if (result.ok) {
|
|
204
|
+
* console.log(result.value.source); // 'js'
|
|
205
|
+
* console.log(result.value.data['00100010']); // Patient Name
|
|
206
|
+
* }
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
declare function dicom2json(inputPath: string, options?: Dicom2jsonOptions): Promise<Result<Dicom2jsonResult>>;
|
|
210
|
+
/**
|
|
211
|
+
* Converts an in-memory DICOM Part-10 buffer to the DICOM JSON Model.
|
|
212
|
+
*
|
|
213
|
+
* Synchronous — no file I/O, no timeout, no DCMTK fallback.
|
|
214
|
+
*
|
|
215
|
+
* @param buffer - The DICOM file bytes
|
|
216
|
+
* @param options - Charset handling options
|
|
217
|
+
* @returns A Result containing the DICOM JSON Model
|
|
218
|
+
*/
|
|
219
|
+
declare function dicom2jsonFromBuffer(buffer: Uint8Array, options?: Dicom2jsonBufferOptions): Result<Dicom2jsonResult>;
|
|
220
|
+
|
|
132
221
|
/**
|
|
133
222
|
* Dump DICOM metadata as text using the dcmdump binary.
|
|
134
223
|
*
|
|
@@ -2286,4 +2375,4 @@ interface DcmmklutResult {
|
|
|
2286
2375
|
*/
|
|
2287
2376
|
declare function dcmmklut(outputPath: string, options?: DcmmklutOptions): Promise<Result<DcmmklutResult>>;
|
|
2288
2377
|
|
|
2289
|
-
export { type Cda2dcmOptions, type Cda2dcmResult, ColorConversion, type ColorConversionValue, type Dcm2cdaOptions, type Dcm2cdaResult, type Dcm2jsonOptions, type Dcm2jsonResult, type Dcm2jsonSource, type Dcm2pdfOptions, type Dcm2pdfResult, type Dcm2pnmOptions, Dcm2pnmOutputFormat, type Dcm2pnmOutputFormatValue, type Dcm2pnmResult, Dcm2xmlCharset, type Dcm2xmlCharsetValue, type Dcm2xmlOptions, type Dcm2xmlResult, type DcmcjpegOptions, type DcmcjpegResult, type DcmcjplsOptions, type DcmcjplsResult, type DcmconvOptions, type DcmconvResult, type DcmcrleOptions, type DcmcrleResult, type DcmdecapOptions, type DcmdecapResult, type DcmdjpegOptions, type DcmdjpegResult, type DcmdjplsOptions, type DcmdjplsResult, type DcmdrleOptions, type DcmdrleResult, type DcmdspfnOptions, type DcmdspfnResult, DcmdumpFormat, type DcmdumpFormatValue, type DcmdumpOptions, type DcmdumpResult, type DcmencapOptions, type DcmencapResult, type DcmftestOptions, type DcmftestResult, type DcmgpdirOptions, type DcmgpdirResult, type Dcmj2pnmOptions, Dcmj2pnmOutputFormat, type Dcmj2pnmOutputFormatValue, type Dcmj2pnmResult, type DcmmkcrvOptions, type DcmmkcrvResult, type DcmmkdirOptions, type DcmmkdirResult, type DcmmklutOptions, type DcmmklutResult, type Dcmp2pgmOptions, type Dcmp2pgmResult, type DcmprscuOptions, type DcmprscuResult, type DcmpschkOptions, type DcmpschkResult, type DcmpsmkOptions, type DcmpsmkResult, type DcmpsprtOptions, type DcmpsprtResult, type DcmqridxOptions, type DcmqridxResult, type DcmquantOptions, type DcmquantResult, type DcmscaleOptions, type DcmscaleResult, type DcmsendOptions, type DcmsendResult, type Dcod2lumOptions, type Dcod2lumResult, type DconvlumOptions, type DconvlumResult, DicomJsonModel, type DrtdumpOptions, type DrtdumpResult, type Dsr2xmlOptions, type Dsr2xmlResult, type DsrdumpOptions, type DsrdumpResult, type Dump2dcmOptions, type Dump2dcmResult, type EchoscuOptions, type EchoscuResult, type FindscuOptions, type FindscuResult, GetQueryModel, type GetQueryModelValue, type GetscuOptions, type GetscuResult, Img2dcmInputFormat, type Img2dcmInputFormatValue, type Img2dcmOptions, type Img2dcmResult, JplsColorConversion, type JplsColorConversionValue, type Json2dcmOptions, type Json2dcmResult, LutType, type LutTypeValue, MoveQueryModel, type MoveQueryModelValue, type MovescuOptions, type MovescuResult, type Pdf2dcmOptions, type Pdf2dcmResult, ProposedTransferSyntax, type ProposedTransferSyntaxValue, QueryModel, type QueryModelValue, type Stl2dcmOptions, type Stl2dcmResult, type StorescuOptions, type StorescuResult, type TermscuOptions, type TermscuResult, ToolBaseOptions, ToolExecutionError, TransferSyntax, type TransferSyntaxValue, type Xml2dcmOptions, type Xml2dcmResult, type Xml2dsrOptions, type Xml2dsrResult, cda2dcm, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, findscu, getscu, img2dcm, json2dcm, movescu, pdf2dcm, stl2dcm, storescu, termscu, xml2dcm, xml2dsr };
|
|
2378
|
+
export { type Cda2dcmOptions, type Cda2dcmResult, ColorConversion, type ColorConversionValue, type Dcm2cdaOptions, type Dcm2cdaResult, type Dcm2jsonOptions, type Dcm2jsonResult, type Dcm2jsonSource, type Dcm2pdfOptions, type Dcm2pdfResult, type Dcm2pnmOptions, Dcm2pnmOutputFormat, type Dcm2pnmOutputFormatValue, type Dcm2pnmResult, Dcm2xmlCharset, type Dcm2xmlCharsetValue, type Dcm2xmlOptions, type Dcm2xmlResult, type DcmcjpegOptions, type DcmcjpegResult, type DcmcjplsOptions, type DcmcjplsResult, type DcmconvOptions, type DcmconvResult, type DcmcrleOptions, type DcmcrleResult, type DcmdecapOptions, type DcmdecapResult, type DcmdjpegOptions, type DcmdjpegResult, type DcmdjplsOptions, type DcmdjplsResult, type DcmdrleOptions, type DcmdrleResult, type DcmdspfnOptions, type DcmdspfnResult, DcmdumpFormat, type DcmdumpFormatValue, type DcmdumpOptions, type DcmdumpResult, type DcmencapOptions, type DcmencapResult, type DcmftestOptions, type DcmftestResult, type DcmgpdirOptions, type DcmgpdirResult, type Dcmj2pnmOptions, Dcmj2pnmOutputFormat, type Dcmj2pnmOutputFormatValue, type Dcmj2pnmResult, type DcmmkcrvOptions, type DcmmkcrvResult, type DcmmkdirOptions, type DcmmkdirResult, type DcmmklutOptions, type DcmmklutResult, type Dcmp2pgmOptions, type Dcmp2pgmResult, type DcmprscuOptions, type DcmprscuResult, type DcmpschkOptions, type DcmpschkResult, type DcmpsmkOptions, type DcmpsmkResult, type DcmpsprtOptions, type DcmpsprtResult, type DcmqridxOptions, type DcmqridxResult, type DcmquantOptions, type DcmquantResult, type DcmscaleOptions, type DcmscaleResult, type DcmsendOptions, type DcmsendResult, type Dcod2lumOptions, type Dcod2lumResult, type DconvlumOptions, type DconvlumResult, type Dicom2jsonBufferOptions, type Dicom2jsonOptions, type Dicom2jsonResult, type Dicom2jsonSource, DicomJsonModel, type DrtdumpOptions, type DrtdumpResult, type Dsr2xmlOptions, type Dsr2xmlResult, type DsrdumpOptions, type DsrdumpResult, type Dump2dcmOptions, type Dump2dcmResult, type EchoscuOptions, type EchoscuResult, type FindscuOptions, type FindscuResult, GetQueryModel, type GetQueryModelValue, type GetscuOptions, type GetscuResult, Img2dcmInputFormat, type Img2dcmInputFormatValue, type Img2dcmOptions, type Img2dcmResult, JplsColorConversion, type JplsColorConversionValue, type Json2dcmOptions, type Json2dcmResult, LutType, type LutTypeValue, MoveQueryModel, type MoveQueryModelValue, type MovescuOptions, type MovescuResult, type Pdf2dcmOptions, type Pdf2dcmResult, ProposedTransferSyntax, type ProposedTransferSyntaxValue, QueryModel, type QueryModelValue, type Stl2dcmOptions, type Stl2dcmResult, type StorescuOptions, type StorescuResult, type TermscuOptions, type TermscuResult, ToolBaseOptions, ToolExecutionError, TransferSyntax, type TransferSyntaxValue, type Xml2dcmOptions, type Xml2dcmResult, type Xml2dsrOptions, type Xml2dsrResult, cda2dcm, dcm2cda, dcm2json, dcm2pdf, dcm2pnm, dcm2xml, dcmcjpeg, dcmcjpls, dcmconv, dcmcrle, dcmdecap, dcmdjpeg, dcmdjpls, dcmdrle, dcmdspfn, dcmdump, dcmencap, dcmftest, dcmgpdir, dcmj2pnm, dcmmkcrv, dcmmkdir, dcmmklut, dcmp2pgm, dcmprscu, dcmpschk, dcmpsmk, dcmpsprt, dcmqridx, dcmquant, dcmscale, dcmsend, dcod2lum, dconvlum, dicom2json, dicom2jsonFromBuffer, drtdump, dsr2xml, dsrdump, dump2dcm, echoscu, findscu, getscu, img2dcm, json2dcm, movescu, pdf2dcm, stl2dcm, storescu, termscu, xml2dcm, xml2dsr };
|