@ubercode/dcmtk 0.7.3 → 0.8.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/dist/tools.d.cts CHANGED
@@ -1364,10 +1364,24 @@ interface DcmsendOptions extends ToolBaseOptions {
1364
1364
  readonly calledAETitle?: string | undefined;
1365
1365
  /** Scan input directory recursively for DICOM files. Defaults to false. */
1366
1366
  readonly scanDirectory?: boolean | undefined;
1367
+ /** Recurse into subdirectories (requires scanDirectory). Maps to `+r`. */
1368
+ readonly recurse?: boolean | undefined;
1369
+ /** Scan pattern for filename filtering (only with scanDirectory). Maps to `--scan-pattern`. */
1370
+ readonly scanPattern?: string | undefined;
1367
1371
  /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
1368
1372
  readonly verbosity?: 'verbose' | 'debug' | undefined;
1369
1373
  /** Disable UID validity checking. Maps to `--no-uid-checks`. */
1370
1374
  readonly noUidChecks?: boolean | undefined;
1375
+ /** Do not halt on first invalid input file. Maps to `--no-halt`. */
1376
+ readonly noHalt?: boolean | undefined;
1377
+ /** Do not propose illegal presentation contexts. Maps to `--no-illegal-proposal`. */
1378
+ readonly noIllegalProposal?: boolean | undefined;
1379
+ /** Decompression mode. Maps to `--decompress-never` / `--decompress-lossless` / `--decompress-lossy`. */
1380
+ readonly decompress?: 'never' | 'lossless' | 'lossy' | undefined;
1381
+ /** Use multiple associations (one after the other). Maps to `+ma`. False maps to `-ma`. */
1382
+ readonly multiAssociations?: boolean | undefined;
1383
+ /** Create a detailed report file on the transfer. Maps to `--create-report-file`. */
1384
+ readonly createReportFile?: string | undefined;
1371
1385
  /** Maximum receive PDU size in bytes (4096–131072). Maps to `--max-pdu`. */
1372
1386
  readonly maxPduReceive?: number | undefined;
1373
1387
  /** Maximum send PDU size in bytes (4096–131072). Maps to `--max-send-pdu`. */
package/dist/tools.d.ts CHANGED
@@ -1364,10 +1364,24 @@ interface DcmsendOptions extends ToolBaseOptions {
1364
1364
  readonly calledAETitle?: string | undefined;
1365
1365
  /** Scan input directory recursively for DICOM files. Defaults to false. */
1366
1366
  readonly scanDirectory?: boolean | undefined;
1367
+ /** Recurse into subdirectories (requires scanDirectory). Maps to `+r`. */
1368
+ readonly recurse?: boolean | undefined;
1369
+ /** Scan pattern for filename filtering (only with scanDirectory). Maps to `--scan-pattern`. */
1370
+ readonly scanPattern?: string | undefined;
1367
1371
  /** Verbosity level for diagnostic output. `'verbose'` maps to `-v`, `'debug'` maps to `-d`. */
1368
1372
  readonly verbosity?: 'verbose' | 'debug' | undefined;
1369
1373
  /** Disable UID validity checking. Maps to `--no-uid-checks`. */
1370
1374
  readonly noUidChecks?: boolean | undefined;
1375
+ /** Do not halt on first invalid input file. Maps to `--no-halt`. */
1376
+ readonly noHalt?: boolean | undefined;
1377
+ /** Do not propose illegal presentation contexts. Maps to `--no-illegal-proposal`. */
1378
+ readonly noIllegalProposal?: boolean | undefined;
1379
+ /** Decompression mode. Maps to `--decompress-never` / `--decompress-lossless` / `--decompress-lossy`. */
1380
+ readonly decompress?: 'never' | 'lossless' | 'lossy' | undefined;
1381
+ /** Use multiple associations (one after the other). Maps to `+ma`. False maps to `-ma`. */
1382
+ readonly multiAssociations?: boolean | undefined;
1383
+ /** Create a detailed report file on the transfer. Maps to `--create-report-file`. */
1384
+ readonly createReportFile?: string | undefined;
1371
1385
  /** Maximum receive PDU size in bytes (4096–131072). Maps to `--max-pdu`. */
1372
1386
  readonly maxPduReceive?: number | undefined;
1373
1387
  /** Maximum send PDU size in bytes (4096–131072). Maps to `--max-send-pdu`. */
package/dist/tools.js CHANGED
@@ -2198,6 +2198,30 @@ async function echoscu(options) {
2198
2198
  return ok({ success: true, stderr: result.value.stderr });
2199
2199
  }
2200
2200
  var VERBOSITY_FLAGS19 = { verbose: "-v", debug: "-d" };
2201
+ var DECOMPRESS_FLAGS = {
2202
+ never: "--decompress-never",
2203
+ lossless: "--decompress-lossless",
2204
+ lossy: "--decompress-lossy"
2205
+ };
2206
+ function pushSendModeArgs(args, options) {
2207
+ if (options.noHalt === true) {
2208
+ args.push("--no-halt");
2209
+ }
2210
+ if (options.noIllegalProposal === true) {
2211
+ args.push("--no-illegal-proposal");
2212
+ }
2213
+ if (options.decompress !== void 0) {
2214
+ args.push(DECOMPRESS_FLAGS[options.decompress]);
2215
+ }
2216
+ if (options.multiAssociations === true) {
2217
+ args.push("+ma");
2218
+ } else if (options.multiAssociations === false) {
2219
+ args.push("-ma");
2220
+ }
2221
+ if (options.createReportFile !== void 0) {
2222
+ args.push("--create-report-file", options.createReportFile);
2223
+ }
2224
+ }
2201
2225
  var DcmsendOptionsSchema = z.object({
2202
2226
  timeoutMs: z.number().int().positive().optional(),
2203
2227
  signal: z.instanceof(AbortSignal).optional(),
@@ -2207,8 +2231,15 @@ var DcmsendOptionsSchema = z.object({
2207
2231
  callingAETitle: z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
2208
2232
  calledAETitle: z.string().min(1).max(16).refine(isValidAETitle, { message: "AE Title contains invalid characters" }).optional(),
2209
2233
  scanDirectory: z.boolean().optional(),
2234
+ recurse: z.boolean().optional(),
2235
+ scanPattern: z.string().min(1).optional(),
2210
2236
  verbosity: z.enum(["verbose", "debug"]).optional(),
2211
2237
  noUidChecks: z.boolean().optional(),
2238
+ noHalt: z.boolean().optional(),
2239
+ noIllegalProposal: z.boolean().optional(),
2240
+ decompress: z.enum(["never", "lossless", "lossy"]).optional(),
2241
+ multiAssociations: z.boolean().optional(),
2242
+ createReportFile: z.string().min(1).optional(),
2212
2243
  maxPduReceive: z.number().int().min(4096).max(131072).optional(),
2213
2244
  maxPduSend: z.number().int().min(4096).max(131072).optional(),
2214
2245
  noHostnameLookup: z.boolean().optional(),
@@ -2254,6 +2285,13 @@ function buildArgs33(options) {
2254
2285
  if (options.scanDirectory === true) {
2255
2286
  args.push("--scan-directories");
2256
2287
  }
2288
+ if (options.recurse === true) {
2289
+ args.push("+r");
2290
+ }
2291
+ if (options.scanPattern !== void 0) {
2292
+ args.push("--scan-pattern", options.scanPattern);
2293
+ }
2294
+ pushSendModeArgs(args, options);
2257
2295
  args.push(options.host, String(options.port));
2258
2296
  args.push(...options.files);
2259
2297
  return args;