@radicalimaging/static-wado-creator 1.2.0 → 1.2.2

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/lib/StaticWado.js CHANGED
@@ -73,7 +73,7 @@ class StaticWado {
73
73
  setStudyData,
74
74
  rawDicomWriter: RawDicomWriter(this.options),
75
75
  notificationService: new NotificationService(this.options.notificationDir),
76
- internalGenerateImage
76
+ internalGenerateImage,
77
77
  };
78
78
  }
79
79
 
@@ -115,6 +115,7 @@ class StaticWado {
115
115
  Stats.StudyStats.add("DICOM P10", "Parse DICOM P10 file");
116
116
  } catch (e) {
117
117
  console.error("Couldn't process", file);
118
+ console.verbose("Error", e);
118
119
  }
119
120
  },
120
121
  });
@@ -206,11 +207,11 @@ class StaticWado {
206
207
  }
207
208
 
208
209
  static async getDataSet(dataSet, generator, params) {
209
- return await getDataSet(dataSet, generator, params);
210
+ return getDataSet(dataSet, generator, params);
210
211
  }
211
212
 
212
213
  static internalGenerateImage(originalImageFrame, dataSet, metadata, transferSyntaxUid, doneCallback) {
213
- return internalGenerateImage(originalImageFrame, dataSet, metadata, transferSyntaxUid, doneCallback)
214
+ return internalGenerateImage(originalImageFrame, dataSet, metadata, transferSyntaxUid, doneCallback);
214
215
  }
215
216
 
216
217
  /**
@@ -88,6 +88,11 @@ const { mkdicomwebConfig } = ConfigPoint.register({
88
88
  defaultValue: ["uncompressed"],
89
89
  choices: ["uncompressed", "jpeg", "jp2", "jpeglossless", "rle", "jph", "jls", "true", "none"],
90
90
  },
91
+ {
92
+ key: "-f, --force",
93
+ description: "Force the update even if the SOP exists",
94
+ defaultValue: false,
95
+ },
91
96
  {
92
97
  key: "--recompress-thumb <listvalue...>",
93
98
  description: "List of types to recompress thumb separated by space",
@@ -18,7 +18,7 @@ const extractors = {
18
18
  * and then collects the deduplicate data into a list.
19
19
  * Whenever the study UID changes, a new event is fired to indicate the deduplicated data is ready.
20
20
  */
21
- async function deduplicateSingleInstance(id, imageFrame) {
21
+ async function deduplicateSingleInstance(id, imageFrame, { force }) {
22
22
  if (!imageFrame) return {};
23
23
  const studyData = await this.completeStudy.getCurrentStudyData(this, id);
24
24
  const seriesUID = getValue(imageFrame, Tags.SeriesInstanceUID);
@@ -27,7 +27,7 @@ async function deduplicateSingleInstance(id, imageFrame) {
27
27
  console.warn("No sop instance UID in", imageFrame);
28
28
  return {};
29
29
  }
30
- if (studyData.sopExists(sopUID)) {
30
+ if (!force && studyData.sopExists(sopUID)) {
31
31
  if (this.verbose) console.log("SOP Instance UID", sopUID, "already exists, skipping");
32
32
  // TODO - allow replace as an option
33
33
  // Null value means skip writing this instance
@@ -90,7 +90,7 @@ const InstanceDeduplicate = (options) =>
90
90
  this.verbose = options.verbose;
91
91
  }
92
92
 
93
- const deduppedInstance = await this.deduplicateSingleInstance(id, imageFrame);
93
+ const deduppedInstance = await this.deduplicateSingleInstance(id, imageFrame, options);
94
94
  if (deduppedInstance) {
95
95
  // this refers to callee
96
96
  await this.deduplicated(id, deduppedInstance);
@@ -364,7 +364,7 @@ class StudyData {
364
364
  index: false,
365
365
  });
366
366
  // Write out a series singleton that has just the series response for a single series.
367
- await JSONWriter(seriesPath, "series-singleton.json", [seriesQuery], {gzip:true, index:false});
367
+ await JSONWriter(seriesPath, "series-singleton.json", [seriesQuery], { gzip: true, index: false });
368
368
  await JSONWriter(seriesPath, "instances", instancesQuery);
369
369
  }
370
370
 
@@ -96,7 +96,7 @@ class ThumbnailService {
96
96
  if (pixelData) {
97
97
  const { BulkDataURI } = pixelData;
98
98
  if (BulkDataURI?.indexOf("mp4")) {
99
- const mp4Path = path.join(itemId.sopInstanceRootPath, "pixeldata.mp4");
99
+ const mp4Path = path.join(itemId.sopInstanceRootPath, "rendered/index.mp4");
100
100
  // Generate as rendered, as more back ends support that.
101
101
  const thumbPath = path.join(itemId.sopInstanceRootPath, "rendered");
102
102
  console.log("MP4 - converting video format", mp4Path);
@@ -109,7 +109,7 @@ function getDestinationTranscoder(id) {
109
109
  * @returns
110
110
  */
111
111
  function getTranscoder(transferSyntaxUid, { contentType: greyContentType, colorContentType }, samplesPerPixel) {
112
- const contentType = samplesPerPixel===3 ? colorContentType : greyContentType;
112
+ const contentType = samplesPerPixel === 3 ? colorContentType : greyContentType;
113
113
  const sourceTranscoder = transcodeSourceMap[transferSyntaxUid];
114
114
  const destinationTranscoder = getDestinationTranscoder(contentType);
115
115
  if (!sourceTranscoder || !destinationTranscoder) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radicalimaging/static-wado-creator",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Library to convert DICOMP10 to DICOMweb format. Original upstream: https://github.com/chafey/dicomp10-to-dicomweb-js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -56,8 +56,8 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@cornerstonejs/dicom-codec": ">=0.1.6",
59
- "@radicalimaging/static-cs-lite": ">=1.2.0",
60
- "@radicalimaging/static-wado-util": ">=1.2.0",
59
+ "@radicalimaging/static-cs-lite": ">=1.2.1",
60
+ "@radicalimaging/static-wado-util": ">=1.2.1",
61
61
  "canvas": "^2.11.0",
62
62
  "config-point": ">=0.5.1",
63
63
  "dcmjs": "^0.29.5",