@ubercode/dcmtk 0.7.2 → 0.7.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/tools.d.cts CHANGED
@@ -1433,6 +1433,17 @@ declare const ProposedTransferSyntax: {
1433
1433
  readonly J2K_LOSSY: "j2kLossy";
1434
1434
  readonly JLS_LOSSLESS: "jlsLossless";
1435
1435
  readonly JLS_LOSSY: "jlsLossy";
1436
+ readonly MPEG2: "mpeg2";
1437
+ readonly MPEG2_HIGH: "mpeg2High";
1438
+ readonly MPEG4: "mpeg4";
1439
+ readonly MPEG4_BD: "mpeg4Bd";
1440
+ readonly MPEG4_2_2D: "mpeg4_2_2d";
1441
+ readonly MPEG4_2_3D: "mpeg4_2_3d";
1442
+ readonly MPEG4_2_ST: "mpeg4_2_st";
1443
+ readonly HEVC: "hevc";
1444
+ readonly HEVC10: "hevc10";
1445
+ readonly RLE: "rle";
1446
+ readonly DEFLATED: "deflated";
1436
1447
  };
1437
1448
  type ProposedTransferSyntaxValue = (typeof ProposedTransferSyntax)[keyof typeof ProposedTransferSyntax];
1438
1449
  /** Options for {@link storescu}. */
@@ -1451,8 +1462,10 @@ interface StorescuOptions extends ToolBaseOptions {
1451
1462
  readonly scanDirectories?: boolean | undefined;
1452
1463
  /** Recurse into subdirectories (requires scanDirectories). */
1453
1464
  readonly recurse?: boolean | undefined;
1454
- /** Proposed transfer syntax for the association. */
1455
- readonly proposedTransferSyntax?: ProposedTransferSyntaxValue | undefined;
1465
+ /** Proposed transfer syntax(es) for the association. Pass an array to propose multiple. */
1466
+ readonly proposedTransferSyntax?: ProposedTransferSyntaxValue | readonly ProposedTransferSyntaxValue[] | undefined;
1467
+ /** Combine proposed transfer syntaxes into fewer presentation contexts. Maps to `+C`/`--combine`. */
1468
+ readonly combineProposedTransferSyntaxes?: boolean | undefined;
1456
1469
  /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
1457
1470
  readonly verbosity?: 'verbose' | 'debug' | undefined;
1458
1471
  /** Maximum receive PDU size in bytes (4096–131072). Maps to `--max-pdu`. */
package/dist/tools.d.ts CHANGED
@@ -1433,6 +1433,17 @@ declare const ProposedTransferSyntax: {
1433
1433
  readonly J2K_LOSSY: "j2kLossy";
1434
1434
  readonly JLS_LOSSLESS: "jlsLossless";
1435
1435
  readonly JLS_LOSSY: "jlsLossy";
1436
+ readonly MPEG2: "mpeg2";
1437
+ readonly MPEG2_HIGH: "mpeg2High";
1438
+ readonly MPEG4: "mpeg4";
1439
+ readonly MPEG4_BD: "mpeg4Bd";
1440
+ readonly MPEG4_2_2D: "mpeg4_2_2d";
1441
+ readonly MPEG4_2_3D: "mpeg4_2_3d";
1442
+ readonly MPEG4_2_ST: "mpeg4_2_st";
1443
+ readonly HEVC: "hevc";
1444
+ readonly HEVC10: "hevc10";
1445
+ readonly RLE: "rle";
1446
+ readonly DEFLATED: "deflated";
1436
1447
  };
1437
1448
  type ProposedTransferSyntaxValue = (typeof ProposedTransferSyntax)[keyof typeof ProposedTransferSyntax];
1438
1449
  /** Options for {@link storescu}. */
@@ -1451,8 +1462,10 @@ interface StorescuOptions extends ToolBaseOptions {
1451
1462
  readonly scanDirectories?: boolean | undefined;
1452
1463
  /** Recurse into subdirectories (requires scanDirectories). */
1453
1464
  readonly recurse?: boolean | undefined;
1454
- /** Proposed transfer syntax for the association. */
1455
- readonly proposedTransferSyntax?: ProposedTransferSyntaxValue | undefined;
1465
+ /** Proposed transfer syntax(es) for the association. Pass an array to propose multiple. */
1466
+ readonly proposedTransferSyntax?: ProposedTransferSyntaxValue | readonly ProposedTransferSyntaxValue[] | undefined;
1467
+ /** Combine proposed transfer syntaxes into fewer presentation contexts. Maps to `+C`/`--combine`. */
1468
+ readonly combineProposedTransferSyntaxes?: boolean | undefined;
1456
1469
  /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
1457
1470
  readonly verbosity?: 'verbose' | 'debug' | undefined;
1458
1471
  /** Maximum receive PDU size in bytes (4096–131072). Maps to `--max-pdu`. */
package/dist/tools.js CHANGED
@@ -2292,7 +2292,18 @@ var ProposedTransferSyntax = {
2292
2292
  J2K_LOSSLESS: "j2kLossless",
2293
2293
  J2K_LOSSY: "j2kLossy",
2294
2294
  JLS_LOSSLESS: "jlsLossless",
2295
- JLS_LOSSY: "jlsLossy"
2295
+ JLS_LOSSY: "jlsLossy",
2296
+ MPEG2: "mpeg2",
2297
+ MPEG2_HIGH: "mpeg2High",
2298
+ MPEG4: "mpeg4",
2299
+ MPEG4_BD: "mpeg4Bd",
2300
+ MPEG4_2_2D: "mpeg4_2_2d",
2301
+ MPEG4_2_3D: "mpeg4_2_3d",
2302
+ MPEG4_2_ST: "mpeg4_2_st",
2303
+ HEVC: "hevc",
2304
+ HEVC10: "hevc10",
2305
+ RLE: "rle",
2306
+ DEFLATED: "deflated"
2296
2307
  };
2297
2308
  var PROPOSED_TS_FLAG_MAP = {
2298
2309
  [ProposedTransferSyntax.UNCOMPRESSED]: "-x=",
@@ -2305,8 +2316,20 @@ var PROPOSED_TS_FLAG_MAP = {
2305
2316
  [ProposedTransferSyntax.J2K_LOSSLESS]: "-xv",
2306
2317
  [ProposedTransferSyntax.J2K_LOSSY]: "-xw",
2307
2318
  [ProposedTransferSyntax.JLS_LOSSLESS]: "-xt",
2308
- [ProposedTransferSyntax.JLS_LOSSY]: "-xu"
2319
+ [ProposedTransferSyntax.JLS_LOSSY]: "-xu",
2320
+ [ProposedTransferSyntax.MPEG2]: "-xm",
2321
+ [ProposedTransferSyntax.MPEG2_HIGH]: "-xh",
2322
+ [ProposedTransferSyntax.MPEG4]: "-xn",
2323
+ [ProposedTransferSyntax.MPEG4_BD]: "-xl",
2324
+ [ProposedTransferSyntax.MPEG4_2_2D]: "-x2",
2325
+ [ProposedTransferSyntax.MPEG4_2_3D]: "-x3",
2326
+ [ProposedTransferSyntax.MPEG4_2_ST]: "-xo",
2327
+ [ProposedTransferSyntax.HEVC]: "-x4",
2328
+ [ProposedTransferSyntax.HEVC10]: "-x5",
2329
+ [ProposedTransferSyntax.RLE]: "-xr",
2330
+ [ProposedTransferSyntax.DEFLATED]: "-xd"
2309
2331
  };
2332
+ var PROPOSED_TS_VALUES = Object.values(ProposedTransferSyntax);
2310
2333
  var StorescuOptionsSchema = z.object({
2311
2334
  timeoutMs: z.number().int().positive().optional(),
2312
2335
  signal: z.instanceof(AbortSignal).optional(),
@@ -2325,20 +2348,18 @@ var StorescuOptionsSchema = z.object({
2325
2348
  dimseTimeout: z.number().int().positive().optional(),
2326
2349
  noHostnameLookup: z.boolean().optional(),
2327
2350
  required: z.boolean().optional(),
2328
- proposedTransferSyntax: z.enum([
2329
- "uncompressed",
2330
- "littleEndian",
2331
- "bigEndian",
2332
- "implicitVR",
2333
- "jpegLossless",
2334
- "jpeg8Bit",
2335
- "jpeg12Bit",
2336
- "j2kLossless",
2337
- "j2kLossy",
2338
- "jlsLossless",
2339
- "jlsLossy"
2340
- ]).optional()
2351
+ proposedTransferSyntax: z.union([z.enum(PROPOSED_TS_VALUES), z.array(z.enum(PROPOSED_TS_VALUES)).min(1)]).optional(),
2352
+ combineProposedTransferSyntaxes: z.boolean().optional()
2341
2353
  }).strict();
2354
+ function pushProposedTsArgs(args, ts) {
2355
+ if (typeof ts === "string") {
2356
+ args.push(PROPOSED_TS_FLAG_MAP[ts]);
2357
+ } else {
2358
+ for (let i = 0; i < ts.length; i++) {
2359
+ args.push(PROPOSED_TS_FLAG_MAP[ts[i]]);
2360
+ }
2361
+ }
2362
+ }
2342
2363
  var VERBOSITY_FLAGS20 = { verbose: "-v", debug: "-d" };
2343
2364
  var DIMSE_ERROR_PATTERN = /^E:.*(?:DIMSE Failed|Store Failed)/m;
2344
2365
  function pushNetworkArgs3(args, options) {
@@ -2380,7 +2401,10 @@ function buildArgs34(options) {
2380
2401
  args.push("+r");
2381
2402
  }
2382
2403
  if (options.proposedTransferSyntax !== void 0) {
2383
- args.push(PROPOSED_TS_FLAG_MAP[options.proposedTransferSyntax]);
2404
+ pushProposedTsArgs(args, options.proposedTransferSyntax);
2405
+ }
2406
+ if (options.combineProposedTransferSyntaxes === true) {
2407
+ args.push("+C");
2384
2408
  }
2385
2409
  if (options.required === true) {
2386
2410
  args.push("-R");