larvitar 1.2.7 → 1.2.8

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 CHANGED
@@ -6,11 +6,11 @@
6
6
 
7
7
  ## Dicom Image Toolkit for CornestoneJS
8
8
 
9
- ### Current version: 1.2.7
9
+ ### Current version: 1.2.8
10
10
 
11
- ### Latest Stable version: 1.2.7
11
+ ### Latest Stable version: 1.2.8
12
12
 
13
- ### Latest Published Release: 1.2.7
13
+ ### Latest Published Release: 1.2.8
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.
@@ -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/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "medical",
7
7
  "cornerstone"
8
8
  ],
9
- "version": "1.2.7",
9
+ "version": "1.2.8",
10
10
  "description": "javascript library for parsing, loading, rendering and interacting with DICOM images",
11
11
  "repository": {
12
12
  "url": "https://github.com/dvisionlab/Larvitar.git",