@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
|
@@ -460,10 +460,28 @@ interface FileIOOptions {
|
|
|
460
460
|
}
|
|
461
461
|
/** Options for opening a DICOM file. Extends FileIOOptions with read-specific settings. */
|
|
462
462
|
interface DicomOpenOptions extends FileIOOptions {
|
|
463
|
-
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent.
|
|
463
|
+
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent. Accepts DICOM defined terms ('ISO_IR 100') or DCMTK-style aliases ('latin-1'). */
|
|
464
464
|
readonly charsetAssume?: string | undefined;
|
|
465
|
-
/** Fallback charset to
|
|
465
|
+
/** Fallback charset to decode with when the file's character set is unsupported or conversion fails. `'latin-1'` is recommended — it maps every byte 0x00-0xFF to a valid character, so decoding never fails. */
|
|
466
466
|
readonly charsetFallback?: string | undefined;
|
|
467
|
+
/**
|
|
468
|
+
* Decode values detected as mislabeled UTF-8 (high bytes forming valid UTF-8 under a single-byte declared charset)
|
|
469
|
+
* as UTF-8 instead of the declared charset. A `possible UTF-8 mislabel` warning is surfaced either way via
|
|
470
|
+
* `DicomInstance.warnings`. JS engine only. Defaults to false.
|
|
471
|
+
*/
|
|
472
|
+
readonly utf8MislabelPromote?: boolean | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* Bounded head-read: for files above ~8 MB, read only the metadata and skip bulk value bytes.
|
|
475
|
+
* Output is identical; peak memory scales with metadata instead of file size. JS engine only.
|
|
476
|
+
* Defaults to true.
|
|
477
|
+
*/
|
|
478
|
+
readonly boundedRead?: boolean | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* Parse engine. `'js'` (default) parses in-process via {@link dicom2json}
|
|
481
|
+
* and automatically falls back to the DCMTK binaries when the JS parser
|
|
482
|
+
* fails; `'dcmtk'` uses the deprecated dcm2json binary path exclusively.
|
|
483
|
+
*/
|
|
484
|
+
readonly engine?: 'js' | 'dcmtk' | undefined;
|
|
467
485
|
}
|
|
468
486
|
|
|
469
487
|
/**
|
|
@@ -499,7 +517,10 @@ declare class DicomInstance {
|
|
|
499
517
|
private readonly changeSet;
|
|
500
518
|
private readonly filepath;
|
|
501
519
|
private readonly meta;
|
|
520
|
+
private readonly warningList;
|
|
502
521
|
private constructor();
|
|
522
|
+
/** Creates a copy with the given fields replaced. */
|
|
523
|
+
private derive;
|
|
503
524
|
/**
|
|
504
525
|
* Opens a DICOM file and creates a DicomInstance.
|
|
505
526
|
*
|
|
@@ -524,6 +545,13 @@ declare class DicomInstance {
|
|
|
524
545
|
get hasUnsavedChanges(): boolean;
|
|
525
546
|
/** The file path, or undefined if this instance has no associated file. */
|
|
526
547
|
get filePath(): string | undefined;
|
|
548
|
+
/**
|
|
549
|
+
* Non-fatal parser warnings from opening the file (e.g. `possible UTF-8 mislabel: <tag>`).
|
|
550
|
+
*
|
|
551
|
+
* Empty for instances created via {@link DicomInstance.fromDataset} or opened with
|
|
552
|
+
* `engine: 'dcmtk'`. Preserved across fluent modifications.
|
|
553
|
+
*/
|
|
554
|
+
get warnings(): readonly string[];
|
|
527
555
|
/** Patient's Name (0010,0010). */
|
|
528
556
|
get patientName(): string;
|
|
529
557
|
/** Patient ID (0010,0020). */
|
|
@@ -460,10 +460,28 @@ interface FileIOOptions {
|
|
|
460
460
|
}
|
|
461
461
|
/** Options for opening a DICOM file. Extends FileIOOptions with read-specific settings. */
|
|
462
462
|
interface DicomOpenOptions extends FileIOOptions {
|
|
463
|
-
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent.
|
|
463
|
+
/** Assume the specified character set when SpecificCharacterSet (0008,0005) is absent. Accepts DICOM defined terms ('ISO_IR 100') or DCMTK-style aliases ('latin-1'). */
|
|
464
464
|
readonly charsetAssume?: string | undefined;
|
|
465
|
-
/** Fallback charset to
|
|
465
|
+
/** Fallback charset to decode with when the file's character set is unsupported or conversion fails. `'latin-1'` is recommended — it maps every byte 0x00-0xFF to a valid character, so decoding never fails. */
|
|
466
466
|
readonly charsetFallback?: string | undefined;
|
|
467
|
+
/**
|
|
468
|
+
* Decode values detected as mislabeled UTF-8 (high bytes forming valid UTF-8 under a single-byte declared charset)
|
|
469
|
+
* as UTF-8 instead of the declared charset. A `possible UTF-8 mislabel` warning is surfaced either way via
|
|
470
|
+
* `DicomInstance.warnings`. JS engine only. Defaults to false.
|
|
471
|
+
*/
|
|
472
|
+
readonly utf8MislabelPromote?: boolean | undefined;
|
|
473
|
+
/**
|
|
474
|
+
* Bounded head-read: for files above ~8 MB, read only the metadata and skip bulk value bytes.
|
|
475
|
+
* Output is identical; peak memory scales with metadata instead of file size. JS engine only.
|
|
476
|
+
* Defaults to true.
|
|
477
|
+
*/
|
|
478
|
+
readonly boundedRead?: boolean | undefined;
|
|
479
|
+
/**
|
|
480
|
+
* Parse engine. `'js'` (default) parses in-process via {@link dicom2json}
|
|
481
|
+
* and automatically falls back to the DCMTK binaries when the JS parser
|
|
482
|
+
* fails; `'dcmtk'` uses the deprecated dcm2json binary path exclusively.
|
|
483
|
+
*/
|
|
484
|
+
readonly engine?: 'js' | 'dcmtk' | undefined;
|
|
467
485
|
}
|
|
468
486
|
|
|
469
487
|
/**
|
|
@@ -499,7 +517,10 @@ declare class DicomInstance {
|
|
|
499
517
|
private readonly changeSet;
|
|
500
518
|
private readonly filepath;
|
|
501
519
|
private readonly meta;
|
|
520
|
+
private readonly warningList;
|
|
502
521
|
private constructor();
|
|
522
|
+
/** Creates a copy with the given fields replaced. */
|
|
523
|
+
private derive;
|
|
503
524
|
/**
|
|
504
525
|
* Opens a DICOM file and creates a DicomInstance.
|
|
505
526
|
*
|
|
@@ -524,6 +545,13 @@ declare class DicomInstance {
|
|
|
524
545
|
get hasUnsavedChanges(): boolean;
|
|
525
546
|
/** The file path, or undefined if this instance has no associated file. */
|
|
526
547
|
get filePath(): string | undefined;
|
|
548
|
+
/**
|
|
549
|
+
* Non-fatal parser warnings from opening the file (e.g. `possible UTF-8 mislabel: <tag>`).
|
|
550
|
+
*
|
|
551
|
+
* Empty for instances created via {@link DicomInstance.fromDataset} or opened with
|
|
552
|
+
* `engine: 'dcmtk'`. Preserved across fluent modifications.
|
|
553
|
+
*/
|
|
554
|
+
get warnings(): readonly string[];
|
|
527
555
|
/** Patient's Name (0010,0010). */
|
|
528
556
|
get patientName(): string;
|
|
529
557
|
/** Patient ID (0010,0020). */
|