Creating ohif:metadata package with metadata classes and adding it to the viewers
This commit is contained in:
1 parent
30a50c7ade
commit
660b828f4b
24 files changed
+242
-28
No files matched your search
@@ -163,6 +163,10 @@ Viewerbase.helpers = helpers;
|
||||
import { sopClassDictionary } from './lib/sopClassDictionary';
|
||||
Viewerbase.sopClassDictionary = sopClassDictionary;
|
||||
|
||||
// dicomTagDescriptions
|
||||
import { dicomTagDescriptions } from './lib/dicomTagDescriptions';
|
||||
Viewerbase.dicomTagDescriptions = dicomTagDescriptions;
|
||||
|
||||
/**
|
||||
* Exported Classes
|
||||
*/
|
||||
|
||||
@@ -30,10 +30,10 @@ function createAndAddStack(stackMap, study, displaySet) {
|
||||
imageIndex: imageIndex + 1
|
||||
};
|
||||
|
||||
const numFrames = image.numFrames;
|
||||
if (numFrames > 1) {
|
||||
const numberOfFrames = image.numberOfFrames;
|
||||
if (numberOfFrames > 1) {
|
||||
OHIF.log.info('Multiframe image detected');
|
||||
for (let i = 0; i < numFrames; i++) {
|
||||
for (let i = 0; i < numberOfFrames; i++) {
|
||||
metaData.frame = i;
|
||||
imageId = getImageId(image, i);
|
||||
imageIds.push(imageId);
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Metadata } from './Metadata';
|
||||
import { dicomTagDescriptions } from '../../dicomTagDescriptions';
|
||||
|
||||
const UNDEFINED = 'undefined';
|
||||
const NUMBER = 'number';
|
||||
const STRING = 'string';
|
||||
const REGEX_TAG = /^x[0-9a-f]{8}$/;
|
||||
const REGEX_TAG = /^x[0-9a-fx]{8}$/;
|
||||
|
||||
export class InstanceMetadata extends Metadata {
|
||||
|
||||
@@ -132,7 +133,17 @@ export class InstanceMetadata extends Metadata {
|
||||
propertyName = tagOrProperty;
|
||||
}
|
||||
|
||||
// @TODO: map tagName to propertyName and vice versa
|
||||
// It's a property
|
||||
if (tagName === null) {
|
||||
for (let tag in dicomTagDescriptions) {
|
||||
if (dicomTagDescriptions[tag] === propertyName) {
|
||||
tagName = tag;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (propertyName === null) {
|
||||
propertyName = dicomTagDescriptions[tagName] || null;
|
||||
}
|
||||
|
||||
return { tagName, propertyName };
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function createStacks(study) {
|
||||
displaySet.setAttributes({
|
||||
isClip: true,
|
||||
studyInstanceUid: study.studyInstanceUid, // Include the study instance Uid for drag/drop purposes
|
||||
numImageFrames: instance.numFrames, // Override the default value of instances.length
|
||||
numImageFrames: instance.numberOfFrames, // Override the default value of instances.length
|
||||
instanceNumber: instance.instanceNumber, // Include the instance number
|
||||
acquisitionDatetime: instance.acquisitionDatetime // Include the acquisition datetime
|
||||
});
|
||||
@@ -110,7 +110,7 @@ function isSingleImageModality(modality) {
|
||||
}
|
||||
|
||||
function isMultiFrame(instance) {
|
||||
return instance.numFrames > 1;
|
||||
return instance.numberOfFrames > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -126,7 +126,6 @@ const stackOfInstancesToDisplaySets = (sopInstances, seriesView) => {
|
||||
const groups = _.groupBy(sopInstances, sopInstance => {
|
||||
// Create an empty string to store our key
|
||||
let result = '';
|
||||
const instanceView = sopInstance.getData();
|
||||
|
||||
// For each rule, find out if the tag exists
|
||||
seriesSplittingRules.forEach(rule => {
|
||||
@@ -134,8 +133,8 @@ const stackOfInstancesToDisplaySets = (sopInstances, seriesView) => {
|
||||
result += ';'
|
||||
|
||||
// If the tag exists, concatenate its value to our key
|
||||
if (instanceView.exists(rule.tag)) {
|
||||
result += instanceView.raw(rule.tag);
|
||||
if (sopInstance.tagExists(rule.tag)) {
|
||||
result += sopInstance.getRawValue(rule.tag);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user