larvitar 1.2.7 → 1.2.10
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/README.md +3 -3
- package/imaging/imageIo.js +10 -3
- package/imaging/imageLoading.js +4 -0
- package/imaging/imageParsing.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
## Dicom Image Toolkit for CornestoneJS
|
|
8
8
|
|
|
9
|
-
### Current version: 1.2.
|
|
9
|
+
### Current version: 1.2.10
|
|
10
10
|
|
|
11
|
-
### Latest Stable version: 1.2.
|
|
11
|
+
### Latest Stable version: 1.2.10
|
|
12
12
|
|
|
13
|
-
### Latest Published Release: 1.2.
|
|
13
|
+
### Latest Published Release: 1.2.10
|
|
14
14
|
|
|
15
15
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornestone-js environment.
|
|
16
16
|
Orthogonal multiplanar reformat is included as well as custom loader/exporter for nrrd files and [Vuex](https://vuex.vuejs.org/) custom integration.
|
package/imaging/imageIo.js
CHANGED
|
@@ -122,18 +122,25 @@ export const buildData = function (series, useSeriesData) {
|
|
|
122
122
|
data.set(sliceData, offsetData);
|
|
123
123
|
offsetData += sliceData.length;
|
|
124
124
|
});
|
|
125
|
+
let t1 = performance.now();
|
|
126
|
+
console.log(`Call to buildData took ${t1 - t0} milliseconds.`);
|
|
127
|
+
return data;
|
|
125
128
|
} else {
|
|
126
129
|
larvitar_store.addSeriesIds(series.seriesUID, series.imageIds);
|
|
130
|
+
let image_counter = 0;
|
|
127
131
|
forEach(series.imageIds, function (imageId) {
|
|
128
132
|
getCachedPixelData(imageId).then(sliceData => {
|
|
129
133
|
data.set(sliceData, offsetData);
|
|
130
134
|
offsetData += sliceData.length;
|
|
135
|
+
image_counter += 1;
|
|
136
|
+
if (image_counter == series.imageIds.length) {
|
|
137
|
+
let t1 = performance.now();
|
|
138
|
+
console.log(`Call to buildData took ${t1 - t0} milliseconds.`);
|
|
139
|
+
return data;
|
|
140
|
+
}
|
|
131
141
|
});
|
|
132
142
|
});
|
|
133
143
|
}
|
|
134
|
-
let t1 = performance.now();
|
|
135
|
-
console.log(`Call to buildData took ${t1 - t0} milliseconds.`);
|
|
136
|
-
return data;
|
|
137
144
|
} else {
|
|
138
145
|
throw new Error("Data has not been builded: not enough memory");
|
|
139
146
|
}
|
package/imaging/imageLoading.js
CHANGED
|
@@ -139,6 +139,9 @@ export const updateLoadedStack = function (
|
|
|
139
139
|
let ssid = seriesData.metadata.studyUID;
|
|
140
140
|
let iid = seriesData.metadata.instanceUID;
|
|
141
141
|
let seriesDescription = seriesData.metadata.seriesDescription;
|
|
142
|
+
let numberOfSlices = seriesData.metadata["x00540081"]
|
|
143
|
+
? seriesData.metadata["x00540081"]
|
|
144
|
+
: seriesData.metadata["x00201002"];
|
|
142
145
|
let numberOfFrames = seriesData.metadata["x00280008"];
|
|
143
146
|
let modality = seriesData.metadata["x00080060"];
|
|
144
147
|
let isMultiframe = numberOfFrames > 1 ? true : false;
|
|
@@ -158,6 +161,7 @@ export const updateLoadedStack = function (
|
|
|
158
161
|
seriesUID: sid,
|
|
159
162
|
studyUID: ssid,
|
|
160
163
|
numberOfImages: 0,
|
|
164
|
+
numberOfSlices: numberOfSlices,
|
|
161
165
|
numberOfFrames: numberOfFrames,
|
|
162
166
|
isMultiframe: isMultiframe,
|
|
163
167
|
modality: modality,
|
package/imaging/imageParsing.js
CHANGED
|
@@ -155,7 +155,7 @@ let parseNextFile = function (parsingQueue, allSeriesStack, resolve, reject) {
|
|
|
155
155
|
let t1 = performance.now();
|
|
156
156
|
console.log(`Call to readFiles took ${t1 - t0} milliseconds.`);
|
|
157
157
|
file = null;
|
|
158
|
-
reject(
|
|
158
|
+
reject("Available memory is not enough");
|
|
159
159
|
return;
|
|
160
160
|
} else {
|
|
161
161
|
// parse the file and wait for results
|
|
@@ -292,7 +292,7 @@ let parseFile = function (file) {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
} catch (err) {
|
|
295
|
-
console.
|
|
295
|
+
console.warn(err);
|
|
296
296
|
reject("can not read this file");
|
|
297
297
|
}
|
|
298
298
|
};
|
package/package.json
CHANGED