larvitar 1.5.6 → 1.5.7
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 +2 -2
- package/imaging/imageUtils.js +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## Dicom Image Toolkit for CornerstoneJS
|
|
8
8
|
|
|
9
|
-
### Current version: 1.5.
|
|
9
|
+
### Current version: 1.5.7
|
|
10
10
|
|
|
11
|
-
### Latest Published Release: 1.5.
|
|
11
|
+
### Latest Published Release: 1.5.7
|
|
12
12
|
|
|
13
13
|
This library provides common DICOM functionalities to be used in web-applications: it's wrapper that simplifies the use of cornerstone-js environment.
|
|
14
14
|
Orthogonal multiplanar reformat is included as well as custom loader/exporter for nrrd files and [Vuex](https://vuex.vuejs.org/) custom integration.
|
package/imaging/imageUtils.js
CHANGED
|
@@ -861,7 +861,16 @@ export const parseTag = function (dataSet, propertyName, element) {
|
|
|
861
861
|
*/
|
|
862
862
|
export const getImageMetadata = function (seriesId, instanceUID) {
|
|
863
863
|
const seriesData = getSeriesDataFromLarvitarManager(seriesId);
|
|
864
|
+
if (seriesData === undefined || seriesData === null) {
|
|
865
|
+
console.log(`Invalid Series ID: ${seriesId}`);
|
|
866
|
+
return [];
|
|
867
|
+
}
|
|
864
868
|
const imageId = seriesData.instanceUIDs[instanceUID];
|
|
869
|
+
if (imageId === undefined) {
|
|
870
|
+
console.log(`Invalid InstanceUID ID: ${instanceUID}`);
|
|
871
|
+
return [];
|
|
872
|
+
}
|
|
873
|
+
|
|
865
874
|
let metadata = seriesData.instances[imageId].metadata;
|
|
866
875
|
// get elements from metadata where the key starts with x and is length 7
|
|
867
876
|
let metadata_keys = filter(keys(metadata), function (key) {
|
|
@@ -870,7 +879,8 @@ export const getImageMetadata = function (seriesId, instanceUID) {
|
|
|
870
879
|
// loop metadata using metadata_keys and return list of key value pairs
|
|
871
880
|
let metadata_list = map(metadata_keys, function (key) {
|
|
872
881
|
// if value is a dictionary return empty string
|
|
873
|
-
const value =
|
|
882
|
+
const value =
|
|
883
|
+
metadata[key] && metadata[key].constructor == Object ? "" : metadata[key];
|
|
874
884
|
// convert key removing x and adding comma at position 4
|
|
875
885
|
const tagKey = (
|
|
876
886
|
"(" +
|
package/package.json
CHANGED