Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 59 additions & 19 deletions packages/static-wado-creator/lib/mkdicomwebConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const { mkdicomwebConfig } = ConfigPoint.register({
},
{
key: "--clean",
description: "Clean the outputs before generating/starting to write new values.",
description:
"Clean the outputs before generating/starting to write new values.",
defaultValue: false,
},
{
key: "-d, --deployments <listvalue...>",
description: "List of deployments from configuration to deploy to. Separated by space.",
description:
"List of deployments from configuration to deploy to. Separated by space.",
defaultValue: undefined,
},
{
Expand All @@ -52,7 +54,8 @@ const { mkdicomwebConfig } = ConfigPoint.register({
},
{
key: "--alternate <type>",
description: "Generates an alternate representaton of the image generally in the /lossy sub-directory",
description:
"Generates an alternate representaton of the image generally in the /lossy sub-directory",
choices: ["jhc", "jls", "jhcLossless", "jlsLossless"],
},
{
Expand All @@ -76,17 +79,20 @@ const { mkdicomwebConfig } = ConfigPoint.register({
},
{
key: "-t, --content-type <type>",
description: 'Destination type to compress to (choices: "jpeg", "jls", "lei", "jls-lossy", "jhc", "jxl" or DICOM Transfer Syntax UID - default: "jls")',
description:
'Destination type to compress to (choices: "jpeg", "jls", "lei", "jls-lossy", "jhc", "jxl" or DICOM Transfer Syntax UID - default: "jls")',
defaultValue: "jls",
customParser: compressionOptionParser,
},
{
key: "--encapsulated-image",
description: "Avoid encapsulating the image frame. Writes with the extension and without multipart",
description:
"Avoid encapsulating the image frame. Writes with the extension and without multipart",
},
{
key: "-e, --no-encapsulated-image",
description: "Avoid encapsulating the image frame. Writes with the extension and without multipart",
description:
"Avoid encapsulating the image frame. Writes with the extension and without multipart",
},
{
key: "--single-part-image",
Expand All @@ -109,14 +115,37 @@ const { mkdicomwebConfig } = ConfigPoint.register({
{
key: "-r, --recompress <listvalue...>",
description: "List of types to recompress separated by space",
defaultValue: ["uncompressed", "jp2", "jls", "jll"],
choices: ["uncompressed", "jp2", "jpeg", "jpeglossless", "rle", "jph", "jls", "true", "none"],
defaultValue: ["uncompressed", "jp2"],
choices: [
"uncompressed",
"jp2",
"jxl",
"jpeg",
"jpeglossless",
"rle",
"jph",
"jls",
"true",
"none",
],
},
{
key: "--recompress-color <listvalue...>",
description: "List of types to recompress for color images, separated by space",
description:
"List of types to recompress for color images, separated by space",
defaultValue: ["uncompressed"],
choices: ["uncompressed", "jpeg", "jp2", "jpeglossless", "rle", "jph", "jls", "true", "none"],
choices: [
"uncompressed",
"jpeg",
"jp2",
"jxl",
"jpeglossless",
"rle",
"jph",
"jls",
"true",
"none",
],
},
{
key: "-f, --force",
Expand All @@ -127,7 +156,7 @@ const { mkdicomwebConfig } = ConfigPoint.register({
key: "--recompress-thumb <listvalue...>",
description: "List of types to recompress thumb separated by space",
defaultValue: ["uncompressed", "jp2"],
choices: ["uncompressed", "jp2", "jpeglossless", "rle", "none"],
choices: ["uncompressed", "jp2", "jpeglossless", "jxl", "rle", "none"],
},
{
key: "--no-recompress",
Expand Down Expand Up @@ -160,7 +189,8 @@ const { mkdicomwebConfig } = ConfigPoint.register({
},
{
key: "--path-deduplicated <path>",
description: "Set the deduplicate data directory path (relative to dir)",
description:
"Set the deduplicate data directory path (relative to dir)",
defaultValue: "deduplicated",
},
{
Expand All @@ -175,18 +205,24 @@ const { mkdicomwebConfig } = ConfigPoint.register({
},
{
key: "--prepend-bulk-data-uri <value>",
description: "Prepend bulkdata uri (ex. to use absolute Uri like http://host:3000/dicomweb)",
description:
"Prepend bulkdata uri (ex. to use absolute Uri like http://host:3000/dicomweb)",
defaultValue: "",
},
{
key: "--expand-bulk-data-uri",
description: "expand bulkdata relative uri to use full relative path (should also be set when using --prepend-bulk-data-uri)",
description:
"expand bulkdata relative uri to use full relative path (should also be set when using --prepend-bulk-data-uri)",
defaultValue: false,
},
{
key: "-o, --dir <value>",
description: "Set output directory",
defaultValue: { configOperation: "reference", source: "staticWadoConfig", reference: "rootDir" },
defaultValue: {
configOperation: "reference",
source: "staticWadoConfig",
reference: "rootDir",
},
},
],
programs: [
Expand Down Expand Up @@ -215,24 +251,28 @@ const { mkdicomwebConfig } = ConfigPoint.register({
command: "instance",
arguments: ["input"],
main: instanceMain,
helpDescription: "Make instance level DICOMweb metadata and bulkdata, but don't group or write series metadata",
helpDescription:
"Make instance level DICOMweb metadata and bulkdata, but don't group or write series metadata",
},
{
command: "group",
arguments: ["input"],
main: groupMain,
helpDescription: "Group instance level metadata into deduplicated data.\nDeletes instance level deduplicated information once it is confirmed written.",
helpDescription:
"Group instance level metadata into deduplicated data.\nDeletes instance level deduplicated information once it is confirmed written.",
},
{
command: "metadata",
arguments: ["input"],
main: metadataMain,
helpDescription: "Write the metadata object (series and study details) from the grouped deduplicated data.",
helpDescription:
"Write the metadata object (series and study details) from the grouped deduplicated data.",
},
{
command: "delete",
main: deleteMain,
helpDescription: "Delete the given study, series or instance (not yet implemented)",
helpDescription:
"Delete the given study, series or instance (not yet implemented)",
},
{
command: "reject <studyUID...>",
Expand Down
34 changes: 19 additions & 15 deletions packages/static-wado-creator/lib/model/uids.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
const octetStream = "application/octet-stream";
const octetStream = "application/octet-stream"
const uncompressed = {
uncompressed: true,
gzip: true,
contentType: octetStream,
};
}

/**
* @see {@link https://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_8.7.3.3.2.html}
*/
const jpeg = "image/jpeg";
const jls = "image/jls";
const jll = "image/jll";
const jxl = "image/x-jxl";
const htj2k = "image/jphc";
const jp2 = "image/jp2";
const rle = "image/dicom-rle";
const jpeg = "image/jpeg"
const jls = "image/jls"
const jll = "image/jll"
const jxl = "image/jxl"
const htj2k = "image/jphc"
const jp2 = "image/jp2"
const rle = "image/dicom-rle"

const uids = {
"1.2.840.10008.1.2": uncompressed,
"1.2.840.10008.1.2.1": uncompressed,
"1.2.840.10008.1.2.1.99": uncompressed,
"1.2.840.10008.1.2.2": uncompressed,
"1.2.840.10008.1.2.4.50": { contentType: jpeg, lossy: true, extension: ".jpeg" },
"1.2.840.10008.1.2.4.50": {
contentType: jpeg,
lossy: true,
extension: ".jpeg",
},
"1.2.840.10008.1.2.4.51": { contentType: jpeg, lossy: true },
"1.2.840.10008.1.2.4.57": { contentType: jpeg },
"1.2.840.10008.1.2.4.70": { contentType: jll, extension: ".jll" },
"1.2.840.10008.1.2.4.140": { contentType: jxl, extension: ".jxl" },
"1.2.840.10008.1.2.4.110": { contentType: jxl, extension: ".jxl" },
// Lossy, original JPEG reconstruction mode
"1.2.840.10008.1.2.4.141": { contentType: jxl, lossy: true },
"1.2.840.10008.1.2.4.142": { contentType: jxl, lossy: true },
"1.2.840.10008.1.2.4.111": { contentType: jxl, lossy: true },
"1.2.840.10008.1.2.4.112": { contentType: jxl, lossy: true },
"1.2.840.10008.1.2.4.80": { contentType: jls, extension: ".jls" },
"1.2.840.10008.1.2.4.81": { contentType: jls, lossy: true },
"1.2.840.10008.1.2.4.90": { contentType: jp2, extension: ".jp2" },
Expand All @@ -40,6 +44,6 @@ const uids = {
"1.2.840.10008.1.2.4.203": { contentType: htj2k, lossy: true },
"1.2.840.10008.1.2.5": { contentType: rle },
default: {},
};
}

module.exports = uids;
module.exports = uids
Loading