diff --git a/Packages/ohif-metadata/client/OHIFInstanceMetadata.js b/Packages/ohif-metadata/client/OHIFInstanceMetadata.js index d4acf9abc..fcc6ddfff 100644 --- a/Packages/ohif-metadata/client/OHIFInstanceMetadata.js +++ b/Packages/ohif-metadata/client/OHIFInstanceMetadata.js @@ -1,6 +1,7 @@ import { Viewerbase } from 'meteor/ohif:viewerbase'; const InstanceMetadata = Viewerbase.metadata.InstanceMetadata; +const DICOMTagDescriptions = Viewerbase.DICOMTagDescriptions; export class OHIFInstanceMetadata extends InstanceMetadata { @@ -105,11 +106,11 @@ export class OHIFInstanceMetadata extends InstanceMetadata { // A possible solution to improve this would be adapt retriveMetadata names to use DICOM standard names as in dicomTagDescriptions.js static getPropertyName(tagOrProperty) { let propertyName; - const tagInfo = InstanceMetadata.getTagInfo(tagOrProperty); + const tagInfo = DICOMTagDescriptions.find(tagOrProperty); - if (tagInfo.propertyName !== null) { + if (tagInfo !== void 0) { // This function tries to translate standard DICOM property names into local naming convention. - propertyName = tagInfo.propertyName.replace(/^SOP/, 'sop').replace(/UID$/, 'Uid').replace(/ID$/, 'Id'); + propertyName = tagInfo.keyword.replace(/^SOP/, 'sop').replace(/UID$/, 'Uid').replace(/ID$/, 'Id'); propertyName = propertyName.charAt(0).toLowerCase() + propertyName.substr(1); } diff --git a/Packages/ohif-viewerbase/client/index.js b/Packages/ohif-viewerbase/client/index.js index 3de4fd603..5a86053d2 100644 --- a/Packages/ohif-viewerbase/client/index.js +++ b/Packages/ohif-viewerbase/client/index.js @@ -165,8 +165,8 @@ import { sopClassDictionary } from './lib/sopClassDictionary'; Viewerbase.sopClassDictionary = sopClassDictionary; // dicomTagDescriptions -import { dicomTagDescriptions } from './lib/dicomTagDescriptions'; -Viewerbase.dicomTagDescriptions = dicomTagDescriptions; +import { DICOMTagDescriptions } from './lib/dicomTagDescriptions'; +Viewerbase.DICOMTagDescriptions = DICOMTagDescriptions; /** * Exported Classes diff --git a/Packages/ohif-viewerbase/client/lib/classes/metadata/InstanceMetadata.js b/Packages/ohif-viewerbase/client/lib/classes/metadata/InstanceMetadata.js index 86c841083..d8cfaf23f 100644 --- a/Packages/ohif-viewerbase/client/lib/classes/metadata/InstanceMetadata.js +++ b/Packages/ohif-viewerbase/client/lib/classes/metadata/InstanceMetadata.js @@ -1,5 +1,4 @@ import { Metadata } from './Metadata'; -import { dicomTagDescriptions } from '../../dicomTagDescriptions'; import { OHIFError } from '../OHIFError'; const UNDEFINED = 'undefined'; @@ -165,38 +164,6 @@ export class InstanceMetadata extends Metadata { * Static Methods */ - static getTagInfo(tagOrProperty) { - let tagName = null, - propertyName = null; - - if (typeof tagOrProperty === NUMBER) { - // if it's a number, build an hexadecimal representation... - tagName = 'x' + ('00000000' + tagOrProperty.toString(16)).substr(-8); - } else if (typeof tagOrProperty === STRING) { - if (REGEX_TAG.test(tagOrProperty)) { - tagName = tagOrProperty; - } else { - propertyName = tagOrProperty; - } - } - - if (propertyName !== null) { - // try to figure out the "tagName" using the provided "propertyName"... - for (let tag in dicomTagDescriptions) { - // No need to check for "hasOwnProperty" here since dicomTagDescriptions is an object with no prototype... - if (dicomTagDescriptions[tag] === propertyName) { - tagName = tag; - break; - } - } - } else if (tagName !== null) { - // try to figure out the "propertyName" using the provided "tagName"... - propertyName = dicomTagDescriptions[tagName] || null; - } - - return { tagName, propertyName }; - } - /** * Get an value based that can be index based. This function is called by all getters. See above functions. * - If value is a String and has indexes: diff --git a/Packages/ohif-viewerbase/client/lib/classes/metadata/StudySummary.js b/Packages/ohif-viewerbase/client/lib/classes/metadata/StudySummary.js new file mode 100644 index 000000000..9a226dda7 --- /dev/null +++ b/Packages/ohif-viewerbase/client/lib/classes/metadata/StudySummary.js @@ -0,0 +1,42 @@ + +class StudySummary { + + constructor(propertyMap) { + + // Define the main immutable "_data" private property. + Object.defineProperty(this, '_data', { + configurable: false, + enumerable: false, + writable: false, + value: Object.create(null) + }); + + const hasOwn = Object.prototype.hasOwnProperty; + const data = this._data; + for (let property in propertyMap) { + if (hasOwn.call(propertyMap, property)) { + data[property] = propertyMap[property]; + } + } + + } + + propertyExists(propertyName) { + const internalPropertyName = this.getInternalPropertyName(propertyName); + return (internalPropertyName in this._data); + } + + getPropertyValue(propertyName) { + const internalPropertyName = this.getInternalPropertyName(propertyName); + return this._data[internalPropertyName]; + } + + /** + * This function is supposed to translate external property names into internal property names. + * By default it implements the simplest translation possible. For + */ + getInternalPropertyName(propertyName) { + return propertyName; + } + +} diff --git a/Packages/ohif-viewerbase/client/lib/dicomTagDescriptions.js b/Packages/ohif-viewerbase/client/lib/dicomTagDescriptions.js index b4c43783f..ebd294eb3 100644 --- a/Packages/ohif-viewerbase/client/lib/dicomTagDescriptions.js +++ b/Packages/ohif-viewerbase/client/lib/dicomTagDescriptions.js @@ -1,6 +1,36 @@ -const dicomTagDescriptions = Object.create(null); // Object with null prototype for fast and safe lookups... -let _dicomTagDescriptions = { +const NUMBER = 'number'; +const STRING = 'string'; + +const DICOMTagDescriptions = Object.create(Object.prototype, { + _descriptions: { + configurable: false, + enumerable: false, + writable: false, + value: Object.create(null) + }, + find: { + configurable: false, + enumerable: true, + writable: false, + value: function find(name) { + let description; // by default, undefined... + if (typeof name === NUMBER) { + // if it's a number, build its hexadecimal representation... + name = 'x' + ('00000000' + name.toString(16)).substr(-8); + } + if (typeof name === STRING) { + description = this._descriptions[name]; + } + return description; + } + } +}); + +/** + * Map with DICOM Tag Descriptions + */ +let initialTagDescriptionMap = { x00020000: 'FileMetaInfoGroupLength', x00020001: 'FileMetaInfoVersion', x00020002: 'MediaStorageSOPClassUID', @@ -92,7 +122,7 @@ let _dicomTagDescriptions = { x00080112: 'CodingSchemeRegistry', x00080114: 'CodingSchemeExternalID', x00080115: 'CodingSchemeName', - x00080116: 'ResponsibleOrganization', + x00080116: 'CodingSchemeResponsibleOrganization', x00080117: 'ContextUID', x00080201: 'TimezoneOffsetFromUTC', x00081000: 'NetworkID', @@ -114,7 +144,7 @@ let _dicomTagDescriptions = { x00081090: 'ManufacturersModelName', x00081100: 'ReferencedResultsSequence', x00081110: 'ReferencedStudySequence', - x00081111: 'ReferencedProcedureStepSequence', + x00081111: 'ReferencedPerformedProcedureStepSequence', x00081115: 'ReferencedSeriesSequence', x00081120: 'ReferencedPatientSequence', x00081125: 'ReferencedVisitSequence', @@ -137,7 +167,7 @@ let _dicomTagDescriptions = { x00081199: 'ReferencedSOPSequence', x00081200: 'OtherReferencedStudiesSequence', x00081250: 'RelatedSeriesSequence', - x00082110: 'LossyImageCompression', + x00082110: 'LossyImageCompressionRetired', x00082111: 'DerivationDescription', x00082112: 'SourceImageSequence', x00082120: 'StageName', @@ -191,16 +221,16 @@ let _dicomTagDescriptions = { x00089458: 'FrameDisplaySequence', x00089459: 'RecommendedDisplayFrameRateInFloat', x00089460: 'SkipFrameRangeFlag', - x00091001: 'FullFidelity', - x00091002: 'SuiteID', - x00091004: 'ProductID', - x00091027: 'ImageActualDate', - x00091030: 'ServiceID', - x00091031: 'MobileLocationNumber', - x000910e3: 'EquipmentUID', - x000910e6: 'GenesisVersionNow', - x000910e7: 'ExamRecordChecksum', - x000910e9: 'ActualSeriesDataTimeStamp', + // x00091001: 'FullFidelity', + // x00091002: 'SuiteID', + // x00091004: 'ProductID', + // x00091027: 'ImageActualDate', + // x00091030: 'ServiceID', + // x00091031: 'MobileLocationNumber', + // x000910e3: 'EquipmentUID', + // x000910e6: 'GenesisVersionNow', + // x000910e7: 'ExamRecordChecksum', + // x000910e9: 'ActualSeriesDataTimeStamp', x00100000: 'PatientGroupLength', x00100010: 'PatientName', x00100020: 'PatientID', @@ -911,149 +941,149 @@ let _dicomTagDescriptions = { x0018a001: 'ContributingEquipmentSequence', x0018a002: 'ContributionDateTime', x0018a003: 'ContributionDescription', - x00191002: 'NumberOfCellsIInDetector', - x00191003: 'CellNumberAtTheta', - x00191004: 'CellSpacing', - x0019100f: 'HorizFrameOfRef', - x00191011: 'SeriesContrast', - x00191012: 'LastPseq', - x00191013: 'StartNumberForBaseline', - x00191014: 'EndNumberForBaseline', - x00191015: 'StartNumberForEnhancedScans', - x00191016: 'EndNumberForEnhancedScans', - x00191017: 'SeriesPlane', - x00191018: 'FirstScanRas', - x00191019: 'FirstScanLocation', - x0019101a: 'LastScanRas', - x0019101b: 'LastScanLoc', - x0019101e: 'DisplayFieldOfView', - x00191023: 'TableSpeed', - x00191024: 'MidScanTime', - x00191025: 'MidScanFlag', - x00191026: 'DegreesOfAzimuth', - x00191027: 'GantryPeriod', - x0019102a: 'XRayOnPosition', - x0019102b: 'XRayOffPosition', - x0019102c: 'NumberOfTriggers', - x0019102e: 'AngleOfFirstView', - x0019102f: 'TriggerFrequency', - x00191039: 'ScanFOVType', - x00191040: 'StatReconFlag', - x00191041: 'ComputeType', - x00191042: 'SegmentNumber', - x00191043: 'TotalSegmentsRequested', - x00191044: 'InterscanDelay', - x00191047: 'ViewCompressionFactor', - x0019104a: 'TotalNoOfRefChannels', - x0019104b: 'DataSizeForScanData', - x00191052: 'ReconPostProcflag', - x00191057: 'CTWaterNumber', - x00191058: 'CTBoneNumber', - x0019105a: 'AcquisitionDuration', - x0019105e: 'NumberOfChannels', - x0019105f: 'IncrementBetweenChannels', - x00191060: 'StartingView', - x00191061: 'NumberOfViews', - x00191062: 'IncrementBetweenViews', - x0019106a: 'DependantOnNoViewsProcessed', - x0019106b: 'FieldOfViewInDetectorCells', - x00191070: 'ValueOfBackProjectionButton', - x00191071: 'SetIfFatqEstimatesWereUsed', - x00191072: 'ZChanAvgOverViews', - x00191073: 'AvgOfLeftRefChansOverViews', - x00191074: 'MaxLeftChanOverViews', - x00191075: 'AvgOfRightRefChansOverViews', - x00191076: 'MaxRightChanOverViews', - x0019107d: 'SecondEcho', - x0019107e: 'NumberOfEchoes', - x0019107f: 'TableDelta', - x00191081: 'Contiguous', - x00191084: 'PeakSAR', - x00191085: 'MonitorSAR', - x00191087: 'CardiacRepetitionTime', - x00191088: 'ImagesPerCardiacCycle', - x0019108a: 'ActualReceiveGainAnalog', - x0019108b: 'ActualReceiveGainDigital', - x0019108d: 'DelayAfterTrigger', - x0019108f: 'Swappf', - x00191090: 'PauseInterval', - x00191091: 'PulseTime', - x00191092: 'SliceOffsetOnFreqAxis', - x00191093: 'CenterFrequency', - x00191094: 'TransmitGain', - x00191095: 'AnalogReceiverGain', - x00191096: 'DigitalReceiverGain', - x00191097: 'BitmapDefiningCVs', - x00191098: 'CenterFreqMethod', - x0019109b: 'PulseSeqMode', - x0019109c: 'PulseSeqName', - x0019109d: 'PulseSeqDate', - x0019109e: 'InternalPulseSeqName', - x0019109f: 'TransmittingCoil', - x001910a0: 'SurfaceCoilType', - x001910a1: 'ExtremityCoilFlag', - x001910a2: 'RawDataRunNumber', - x001910a3: 'CalibratedFieldStrength', - x001910a4: 'SATFatWaterBone', - x001910a5: 'ReceiveBandwidth', - x001910a7: 'UserData01', - x001910a8: 'UserData02', - x001910a9: 'UserData03', - x001910aa: 'UserData04', - x001910ab: 'UserData05', - x001910ac: 'UserData06', - x001910ad: 'UserData07', - x001910ae: 'UserData08', - x001910af: 'UserData09', - x001910b0: 'UserData10', - x001910b1: 'UserData11', - x001910b2: 'UserData12', - x001910b3: 'UserData13', - x001910b4: 'UserData14', - x001910b5: 'UserData15', - x001910b6: 'UserData16', - x001910b7: 'UserData17', - x001910b8: 'UserData18', - x001910b9: 'UserData19', - x001910ba: 'UserData20', - x001910bb: 'UserData21', - x001910bc: 'UserData22', - x001910bd: 'UserData23', - x001910be: 'ProjectionAngle', - x001910c0: 'SaturationPlanes', - x001910c1: 'SurfaceCoilIntensity', - x001910c2: 'SATLocationR', - x001910c3: 'SATLocationL', - x001910c4: 'SATLocationA', - x001910c5: 'SATLocationP', - x001910c6: 'SATLocationH', - x001910c7: 'SATLocationF', - x001910c8: 'SATThicknessR-L', - x001910c9: 'SATThicknessA-P', - x001910ca: 'SATThicknessH-F', - x001910cb: 'PrescribedFlowAxis', - x001910cc: 'VelocityEncoding', - x001910cd: 'ThicknessDisclaimer', - x001910ce: 'PrescanType', - x001910cf: 'PrescanStatus', - x001910d0: 'RawDataType', - x001910d2: 'ProjectionAlgorithm', - x001910d3: 'ProjectionAlgorithm', - x001910d5: 'FractionalEcho', - x001910d6: 'PrepPulse', - x001910d7: 'CardiacPhases', - x001910d8: 'VariableEchoflag', - x001910d9: 'ConcatenatedSAT', - x001910da: 'ReferenceChannelUsed', - x001910db: 'BackProjectorCoefficient', - x001910dc: 'PrimarySpeedCorrectionUsed', - x001910dd: 'OverrangeCorrectionUsed', - x001910de: 'DynamicZAlphaValue', - x001910df: 'UserData', - x001910e0: 'UserData', - x001910e2: 'VelocityEncodeScale', - x001910f2: 'FastPhases', - x001910f9: 'TransmissionGain', + // x00191002: 'NumberOfCellsIInDetector', + // x00191003: 'CellNumberAtTheta', + // x00191004: 'CellSpacing', + // x0019100f: 'HorizFrameOfRef', + // x00191011: 'SeriesContrast', + // x00191012: 'LastPseq', + // x00191013: 'StartNumberForBaseline', + // x00191014: 'EndNumberForBaseline', + // x00191015: 'StartNumberForEnhancedScans', + // x00191016: 'EndNumberForEnhancedScans', + // x00191017: 'SeriesPlane', + // x00191018: 'FirstScanRas', + // x00191019: 'FirstScanLocation', + // x0019101a: 'LastScanRas', + // x0019101b: 'LastScanLoc', + // x0019101e: 'DisplayFieldOfView', + // x00191023: 'TableSpeed', + // x00191024: 'MidScanTime', + // x00191025: 'MidScanFlag', + // x00191026: 'DegreesOfAzimuth', + // x00191027: 'GantryPeriod', + // x0019102a: 'XRayOnPosition', + // x0019102b: 'XRayOffPosition', + // x0019102c: 'NumberOfTriggers', + // x0019102e: 'AngleOfFirstView', + // x0019102f: 'TriggerFrequency', + // x00191039: 'ScanFOVType', + // x00191040: 'StatReconFlag', + // x00191041: 'ComputeType', + // x00191042: 'SegmentNumber', + // x00191043: 'TotalSegmentsRequested', + // x00191044: 'InterscanDelay', + // x00191047: 'ViewCompressionFactor', + // x0019104a: 'TotalNoOfRefChannels', + // x0019104b: 'DataSizeForScanData', + // x00191052: 'ReconPostProcflag', + // x00191057: 'CTWaterNumber', + // x00191058: 'CTBoneNumber', + // x0019105a: 'AcquisitionDuration', + // x0019105e: 'NumberOfChannels', + // x0019105f: 'IncrementBetweenChannels', + // x00191060: 'StartingView', + // x00191061: 'NumberOfViews', + // x00191062: 'IncrementBetweenViews', + // x0019106a: 'DependantOnNoViewsProcessed', + // x0019106b: 'FieldOfViewInDetectorCells', + // x00191070: 'ValueOfBackProjectionButton', + // x00191071: 'SetIfFatqEstimatesWereUsed', + // x00191072: 'ZChanAvgOverViews', + // x00191073: 'AvgOfLeftRefChansOverViews', + // x00191074: 'MaxLeftChanOverViews', + // x00191075: 'AvgOfRightRefChansOverViews', + // x00191076: 'MaxRightChanOverViews', + // x0019107d: 'SecondEcho', + // x0019107e: 'NumberOfEchoes', + // x0019107f: 'TableDelta', + // x00191081: 'Contiguous', + // x00191084: 'PeakSAR', + // x00191085: 'MonitorSAR', + // x00191087: 'CardiacRepetitionTime', + // x00191088: 'ImagesPerCardiacCycle', + // x0019108a: 'ActualReceiveGainAnalog', + // x0019108b: 'ActualReceiveGainDigital', + // x0019108d: 'DelayAfterTrigger', + // x0019108f: 'Swappf', + // x00191090: 'PauseInterval', + // x00191091: 'PulseTime', + // x00191092: 'SliceOffsetOnFreqAxis', + // x00191093: 'CenterFrequency', + // x00191094: 'TransmitGain', + // x00191095: 'AnalogReceiverGain', + // x00191096: 'DigitalReceiverGain', + // x00191097: 'BitmapDefiningCVs', + // x00191098: 'CenterFreqMethod', + // x0019109b: 'PulseSeqMode', + // x0019109c: 'PulseSeqName', + // x0019109d: 'PulseSeqDate', + // x0019109e: 'InternalPulseSeqName', + // x0019109f: 'TransmittingCoil', + // x001910a0: 'SurfaceCoilType', + // x001910a1: 'ExtremityCoilFlag', + // x001910a2: 'RawDataRunNumber', + // x001910a3: 'CalibratedFieldStrength', + // x001910a4: 'SATFatWaterBone', + // x001910a5: 'ReceiveBandwidth', + // x001910a7: 'UserData01', + // x001910a8: 'UserData02', + // x001910a9: 'UserData03', + // x001910aa: 'UserData04', + // x001910ab: 'UserData05', + // x001910ac: 'UserData06', + // x001910ad: 'UserData07', + // x001910ae: 'UserData08', + // x001910af: 'UserData09', + // x001910b0: 'UserData10', + // x001910b1: 'UserData11', + // x001910b2: 'UserData12', + // x001910b3: 'UserData13', + // x001910b4: 'UserData14', + // x001910b5: 'UserData15', + // x001910b6: 'UserData16', + // x001910b7: 'UserData17', + // x001910b8: 'UserData18', + // x001910b9: 'UserData19', + // x001910ba: 'UserData20', + // x001910bb: 'UserData21', + // x001910bc: 'UserData22', + // x001910bd: 'UserData23', + // x001910be: 'ProjectionAngle', + // x001910c0: 'SaturationPlanes', + // x001910c1: 'SurfaceCoilIntensity', + // x001910c2: 'SATLocationR', + // x001910c3: 'SATLocationL', + // x001910c4: 'SATLocationA', + // x001910c5: 'SATLocationP', + // x001910c6: 'SATLocationH', + // x001910c7: 'SATLocationF', + // x001910c8: 'SATThicknessR-L', + // x001910c9: 'SATThicknessA-P', + // x001910ca: 'SATThicknessH-F', + // x001910cb: 'PrescribedFlowAxis', + // x001910cc: 'VelocityEncoding', + // x001910cd: 'ThicknessDisclaimer', + // x001910ce: 'PrescanType', + // x001910cf: 'PrescanStatus', + // x001910d0: 'RawDataType', + // x001910d2: 'ProjectionAlgorithm', + // x001910d3: 'ProjectionAlgorithm', + // x001910d5: 'FractionalEcho', + // x001910d6: 'PrepPulse', + // x001910d7: 'CardiacPhases', + // x001910d8: 'VariableEchoflag', + // x001910d9: 'ConcatenatedSAT', + // x001910da: 'ReferenceChannelUsed', + // x001910db: 'BackProjectorCoefficient', + // x001910dc: 'PrimarySpeedCorrectionUsed', + // x001910dd: 'OverrangeCorrectionUsed', + // x001910de: 'DynamicZAlphaValue', + // x001910df: 'UserData', + // x001910e0: 'UserData', + // x001910e2: 'VelocityEncodeScale', + // x001910f2: 'FastPhases', + // x001910f9: 'TransmissionGain', x00200000: 'RelationshipGroupLength', x0020000d: 'StudyInstanceUID', x0020000e: 'SeriesInstanceUID', @@ -1157,41 +1187,41 @@ let _dicomTagDescriptions = { x00209518: 'AcquisitionIndex', x00209529: 'ContributingSOPInstancesRefSeq', x00209536: 'ReconstructionIndex', - x00211003: 'SeriesFromWhichPrescribed', - x00211005: 'GenesisVersionNow', - x00211007: 'SeriesRecordChecksum', - x00211018: 'GenesisVersionNow', - x00211019: 'AcqreconRecordChecksum', - x00211020: 'TableStartLocation', - x00211035: 'SeriesFromWhichPrescribed', - x00211036: 'ImageFromWhichPrescribed', - x00211037: 'ScreenFormat', - x0021104a: 'AnatomicalReferenceForScout', - x0021104f: 'LocationsInAcquisition', - x00211050: 'GraphicallyPrescribed', - x00211051: 'RotationFromSourceXRot', - x00211052: 'RotationFromSourceYRot', - x00211053: 'RotationFromSourceZRot', - x00211054: 'ImagePosition', - x00211055: 'ImageOrientation', - x00211056: 'IntegerSlop', - x00211057: 'IntegerSlop', - x00211058: 'IntegerSlop', - x00211059: 'IntegerSlop', - x0021105a: 'IntegerSlop', - x0021105b: 'FloatSlop', - x0021105c: 'FloatSlop', - x0021105d: 'FloatSlop', - x0021105e: 'FloatSlop', - x0021105f: 'FloatSlop', - x00211081: 'AutoWindowLevelAlpha', - x00211082: 'AutoWindowLevelBeta', - x00211083: 'AutoWindowLevelWindow', - x00211084: 'ToWindowLevelLevel', - x00211090: 'TubeFocalSpotPosition', - x00211091: 'BiopsyPosition', - x00211092: 'BiopsyTLocation', - x00211093: 'BiopsyRefLocation', + // x00211003: 'SeriesFromWhichPrescribed', + // x00211005: 'GenesisVersionNow', + // x00211007: 'SeriesRecordChecksum', + // x00211018: 'GenesisVersionNow', + // x00211019: 'AcqreconRecordChecksum', + // x00211020: 'TableStartLocation', + // x00211035: 'SeriesFromWhichPrescribed', + // x00211036: 'ImageFromWhichPrescribed', + // x00211037: 'ScreenFormat', + // x0021104a: 'AnatomicalReferenceForScout', + // x0021104f: 'LocationsInAcquisition', + // x00211050: 'GraphicallyPrescribed', + // x00211051: 'RotationFromSourceXRot', + // x00211052: 'RotationFromSourceYRot', + // x00211053: 'RotationFromSourceZRot', + // x00211054: 'ImagePosition', + // x00211055: 'ImageOrientation', + // x00211056: 'IntegerSlop', + // x00211057: 'IntegerSlop', + // x00211058: 'IntegerSlop', + // x00211059: 'IntegerSlop', + // x0021105a: 'IntegerSlop', + // x0021105b: 'FloatSlop', + // x0021105c: 'FloatSlop', + // x0021105d: 'FloatSlop', + // x0021105e: 'FloatSlop', + // x0021105f: 'FloatSlop', + // x00211081: 'AutoWindowLevelAlpha', + // x00211082: 'AutoWindowLevelBeta', + // x00211083: 'AutoWindowLevelWindow', + // x00211084: 'ToWindowLevelLevel', + // x00211090: 'TubeFocalSpotPosition', + // x00211091: 'BiopsyPosition', + // x00211092: 'BiopsyTLocation', + // x00211093: 'BiopsyRefLocation', x00220001: 'LightPathFilterPassThroughWavelen', x00220002: 'LightPathFilterPassBand', x00220003: 'ImagePathFilterPassThroughWavelen', @@ -1240,58 +1270,58 @@ let _dicomTagDescriptions = { x00220056: 'IlluminationPower', x00220057: 'IlluminationBandwidth', x00220058: 'MydriaticAgentSequence', - x00231001: 'NumberOfSeriesInStudy', - x00231002: 'NumberOfUnarchivedSeries', - x00231010: 'ReferenceImageField', - x00231050: 'SummaryImage', - x00231070: 'StartTimeSecsInFirstAxial', - x00231074: 'NoofUpdatesToHeader', - x0023107d: 'IndicatesIfTheStudyHasCompleteInfo', - x00251006: 'LastPulseSequenceUsed', - x00251007: 'ImagesInSeries', - x00251010: 'LandmarkCounter', - x00251011: 'NumberOfAcquisitions', - x00251014: 'IndicatesNoofUpdatesToHeader', - x00251017: 'SeriesCompleteFlag', - x00251018: 'NumberOfImagesArchived', - x00251019: 'LastImageNumberUsed', - x0025101a: 'PrimaryReceiverSuiteAndHost', - x00271006: 'ImageArchiveFlag', - x00271010: 'ScoutType', - x0027101c: 'VmaMamp', - x0027101d: 'VmaPhase', - x0027101e: 'VmaMod', - x0027101f: 'VmaClip', - x00271020: 'SmartScanOnOffFlag', - x00271030: 'ForeignImageRevision', - x00271031: 'ImagingMode', - x00271032: 'PulseSequence', - x00271033: 'ImagingOptions', - x00271035: 'PlaneType', - x00271036: 'ObliquePlane', - x00271040: 'RASLetterOfImageLocation', - x00271041: 'ImageLocation', - x00271042: 'CenterRCoordOfPlaneImage', - x00271043: 'CenterACoordOfPlaneImage', - x00271044: 'CenterSCoordOfPlaneImage', - x00271045: 'NormalRCoord', - x00271046: 'NormalACoord', - x00271047: 'NormalSCoord', - x00271048: 'RCoordOfTopRightCorner', - x00271049: 'ACoordOfTopRightCorner', - x0027104a: 'SCoordOfTopRightCorner', - x0027104b: 'RCoordOfBottomRightCorner', - x0027104c: 'ACoordOfBottomRightCorner', - x0027104d: 'SCoordOfBottomRightCorner', - x00271050: 'TableStartLocation', - x00271051: 'TableEndLocation', - x00271052: 'RASLetterForSideOfImage', - x00271053: 'RASLetterForAnteriorPosterior', - x00271054: 'RASLetterForScoutStartLoc', - x00271055: 'RASLetterForScoutEndLoc', - x00271060: 'ImageDimensionX', - x00271061: 'ImageDimensionY', - x00271062: 'NumberOfExcitations', + // x00231001: 'NumberOfSeriesInStudy', + // x00231002: 'NumberOfUnarchivedSeries', + // x00231010: 'ReferenceImageField', + // x00231050: 'SummaryImage', + // x00231070: 'StartTimeSecsInFirstAxial', + // x00231074: 'NoofUpdatesToHeader', + // x0023107d: 'IndicatesIfTheStudyHasCompleteInfo', + // x00251006: 'LastPulseSequenceUsed', + // x00251007: 'ImagesInSeries', + // x00251010: 'LandmarkCounter', + // x00251011: 'NumberOfAcquisitions', + // x00251014: 'IndicatesNoofUpdatesToHeader', + // x00251017: 'SeriesCompleteFlag', + // x00251018: 'NumberOfImagesArchived', + // x00251019: 'LastImageNumberUsed', + // x0025101a: 'PrimaryReceiverSuiteAndHost', + // x00271006: 'ImageArchiveFlag', + // x00271010: 'ScoutType', + // x0027101c: 'VmaMamp', + // x0027101d: 'VmaPhase', + // x0027101e: 'VmaMod', + // x0027101f: 'VmaClip', + // x00271020: 'SmartScanOnOffFlag', + // x00271030: 'ForeignImageRevision', + // x00271031: 'ImagingMode', + // x00271032: 'PulseSequence', + // x00271033: 'ImagingOptions', + // x00271035: 'PlaneType', + // x00271036: 'ObliquePlane', + // x00271040: 'RASLetterOfImageLocation', + // x00271041: 'ImageLocation', + // x00271042: 'CenterRCoordOfPlaneImage', + // x00271043: 'CenterACoordOfPlaneImage', + // x00271044: 'CenterSCoordOfPlaneImage', + // x00271045: 'NormalRCoord', + // x00271046: 'NormalACoord', + // x00271047: 'NormalSCoord', + // x00271048: 'RCoordOfTopRightCorner', + // x00271049: 'ACoordOfTopRightCorner', + // x0027104a: 'SCoordOfTopRightCorner', + // x0027104b: 'RCoordOfBottomRightCorner', + // x0027104c: 'ACoordOfBottomRightCorner', + // x0027104d: 'SCoordOfBottomRightCorner', + // x00271050: 'TableStartLocation', + // x00271051: 'TableEndLocation', + // x00271052: 'RASLetterForSideOfImage', + // x00271053: 'RASLetterForAnteriorPosterior', + // x00271054: 'RASLetterForScoutStartLoc', + // x00271055: 'RASLetterForScoutEndLoc', + // x00271060: 'ImageDimensionX', + // x00271061: 'ImageDimensionY', + // x00271062: 'NumberOfExcitations', x00280000: 'ImagePresentationGroupLength', x00280002: 'SamplesPerPixel', x00280003: 'SamplesPerPixelUsed', @@ -1469,21 +1499,21 @@ let _dicomTagDescriptions = { x00289507: 'LUTFrameRange', x00289520: 'ImageToEquipmentMappingMatrix', x00289537: 'EquipmentCoordinateSystemID', - x00291004: 'LowerRangeOfPixels1a', - x00291005: 'LowerRangeOfPixels1b', - x00291006: 'LowerRangeOfPixels1c', - x00291007: 'LowerRangeOfPixels1d', - x00291008: 'LowerRangeOfPixels1e', - x00291009: 'LowerRangeOfPixels1f', - x0029100a: 'LowerRangeOfPixels1g', - x00291015: 'LowerRangeOfPixels1h', - x00291016: 'LowerRangeOfPixels1i', - x00291017: 'LowerRangeOfPixels2', - x00291018: 'UpperRangeOfPixels2', - x0029101a: 'LenOfTotHdrInBytes', - x00291026: 'VersionOfTheHdrStruct', - x00291034: 'AdvantageCompOverflow', - x00291035: 'AdvantageCompUnderflow', + // x00291004: 'LowerRangeOfPixels1a', + // x00291005: 'LowerRangeOfPixels1b', + // x00291006: 'LowerRangeOfPixels1c', + // x00291007: 'LowerRangeOfPixels1d', + // x00291008: 'LowerRangeOfPixels1e', + // x00291009: 'LowerRangeOfPixels1f', + // x0029100a: 'LowerRangeOfPixels1g', + // x00291015: 'LowerRangeOfPixels1h', + // x00291016: 'LowerRangeOfPixels1i', + // x00291017: 'LowerRangeOfPixels2', + // x00291018: 'UpperRangeOfPixels2', + // x0029101a: 'LenOfTotHdrInBytes', + // x00291026: 'VersionOfTheHdrStruct', + // x00291034: 'AdvantageCompOverflow', + // x00291035: 'AdvantageCompUnderflow', x00320000: 'StudyGroupLength', x0032000a: 'StudyStatusID', x0032000c: 'StudyPriorityID', @@ -1678,8 +1708,8 @@ let _dicomTagDescriptions = { x00402001: 'ReasonForImagingServiceRequest', x00402004: 'IssueDateOfImagingServiceRequest', x00402005: 'IssueTimeOfImagingServiceRequest', - x00402006: 'PlacerOrderNum-ImagingServiceReq', - x00402007: 'FillerOrderNum-ImagingServiceReq', + x00402006: 'PlacerOrderNumberImagingServiceRequestRetired', + x00402007: 'FillerOrderNumberImagingServiceRequestRetired', x00402008: 'OrderEnteredBy', x00402009: 'OrderEntererLocation', x00402010: 'OrderCallbackPhoneNumber', @@ -1799,79 +1829,79 @@ let _dicomTagDescriptions = { x00420012: 'MIMETypeOfEncapsulatedDocument', x00420013: 'SourceInstanceSequence', x00420014: 'ListOfMIMETypes', - x00431001: 'BitmapOfPrescanOptions', - x00431002: 'GradientOffsetInX', - x00431003: 'GradientOffsetInY', - x00431004: 'GradientOffsetInZ', - x00431005: 'ImgIsOriginalOrUnoriginal', - x00431006: 'NumberOfEPIShots', - x00431007: 'ViewsPerSegment', - x00431008: 'RespiratoryRateBpm', - x00431009: 'RespiratoryTriggerPoint', - x0043100a: 'TypeOfReceiverUsed', - x0043100b: 'PeakRateOfChangeOfGradientField', - x0043100c: 'LimitsInUnitsOfPercent', - x0043100d: 'PSDEstimatedLimit', - x0043100e: 'PSDEstimatedLimitInTeslaPerSecond', - x0043100f: 'Saravghead', - x00431010: 'WindowValue', - x00431011: 'TotalInputViews', - x00431012: 'X-RayChain', - x00431013: 'DeconKernelParameters', - x00431014: 'CalibrationParameters', - x00431015: 'TotalOutputViews', - x00431016: 'NumberOfOverranges', - x00431017: 'IBHImageScaleFactors', - x00431018: 'BBHCoefficients', - x00431019: 'NumberOfBBHChainsToBlend', - x0043101a: 'StartingChannelNumber', - x0043101b: 'PpscanParameters', - x0043101c: 'GEImageIntegrity', - x0043101d: 'LevelValue', - x0043101e: 'DeltaStartTime', - x0043101f: 'MaxOverrangesInAView', - x00431020: 'AvgOverrangesAllViews', - x00431021: 'CorrectedAfterGlowTerms', - x00431025: 'ReferenceChannels', - x00431026: 'NoViewsRefChansBlocked', - x00431027: 'ScanPitchRatio', - x00431028: 'UniqueImageIden', - x00431029: 'HistogramTables', - x0043102a: 'UserDefinedData', - x0043102b: 'PrivateScanOptions', - x0043102c: 'EffectiveEchoSpacing', - x0043102d: 'StringSlopField1', - x0043102e: 'StringSlopField2', - x0043102f: 'RawDataType', - x00431030: 'RawDataType', - x00431031: 'RACordOfTargetReconCenter', - x00431032: 'RawDataType', - x00431033: 'NegScanspacing', - x00431034: 'OffsetFrequency', - x00431035: 'UserUsageTag', - x00431036: 'UserFillMapMSW', - x00431037: 'UserFillMapLSW', - x00431038: 'User25-48', - x00431039: 'SlopInt6-9', - x00431040: 'TriggerOnPosition', - x00431041: 'DegreeOfRotation', - x00431042: 'DASTriggerSource', - x00431043: 'DASFpaGain', - x00431044: 'DASOutputSource', - x00431045: 'DASAdInput', - x00431046: 'DASCalMode', - x00431047: 'DASCalFrequency', - x00431048: 'DASRegXm', - x00431049: 'DASAutoZero', - x0043104a: 'StartingChannelOfView', - x0043104b: 'DASXmPattern', - x0043104c: 'TGGCTriggerMode', - x0043104d: 'StartScanToXrayOnDelay', - x0043104e: 'DurationOfXrayOn', - x00431060: 'SlopInt10-17', - x00431061: 'ScannerStudyEntityUID', - x00431062: 'ScannerStudyID', - x0043106f: 'ScannerTableEntry', + // x00431001: 'BitmapOfPrescanOptions', + // x00431002: 'GradientOffsetInX', + // x00431003: 'GradientOffsetInY', + // x00431004: 'GradientOffsetInZ', + // x00431005: 'ImgIsOriginalOrUnoriginal', + // x00431006: 'NumberOfEPIShots', + // x00431007: 'ViewsPerSegment', + // x00431008: 'RespiratoryRateBpm', + // x00431009: 'RespiratoryTriggerPoint', + // x0043100a: 'TypeOfReceiverUsed', + // x0043100b: 'PeakRateOfChangeOfGradientField', + // x0043100c: 'LimitsInUnitsOfPercent', + // x0043100d: 'PSDEstimatedLimit', + // x0043100e: 'PSDEstimatedLimitInTeslaPerSecond', + // x0043100f: 'Saravghead', + // x00431010: 'WindowValue', + // x00431011: 'TotalInputViews', + // x00431012: 'X-RayChain', + // x00431013: 'DeconKernelParameters', + // x00431014: 'CalibrationParameters', + // x00431015: 'TotalOutputViews', + // x00431016: 'NumberOfOverranges', + // x00431017: 'IBHImageScaleFactors', + // x00431018: 'BBHCoefficients', + // x00431019: 'NumberOfBBHChainsToBlend', + // x0043101a: 'StartingChannelNumber', + // x0043101b: 'PpscanParameters', + // x0043101c: 'GEImageIntegrity', + // x0043101d: 'LevelValue', + // x0043101e: 'DeltaStartTime', + // x0043101f: 'MaxOverrangesInAView', + // x00431020: 'AvgOverrangesAllViews', + // x00431021: 'CorrectedAfterGlowTerms', + // x00431025: 'ReferenceChannels', + // x00431026: 'NoViewsRefChansBlocked', + // x00431027: 'ScanPitchRatio', + // x00431028: 'UniqueImageIden', + // x00431029: 'HistogramTables', + // x0043102a: 'UserDefinedData', + // x0043102b: 'PrivateScanOptions', + // x0043102c: 'EffectiveEchoSpacing', + // x0043102d: 'StringSlopField1', + // x0043102e: 'StringSlopField2', + // x0043102f: 'RawDataType', + // x00431030: 'RawDataType', + // x00431031: 'RACordOfTargetReconCenter', + // x00431032: 'RawDataType', + // x00431033: 'NegScanspacing', + // x00431034: 'OffsetFrequency', + // x00431035: 'UserUsageTag', + // x00431036: 'UserFillMapMSW', + // x00431037: 'UserFillMapLSW', + // x00431038: 'User25-48', + // x00431039: 'SlopInt6-9', + // x00431040: 'TriggerOnPosition', + // x00431041: 'DegreeOfRotation', + // x00431042: 'DASTriggerSource', + // x00431043: 'DASFpaGain', + // x00431044: 'DASOutputSource', + // x00431045: 'DASAdInput', + // x00431046: 'DASCalMode', + // x00431047: 'DASCalFrequency', + // x00431048: 'DASRegXm', + // x00431049: 'DASAutoZero', + // x0043104a: 'StartingChannelOfView', + // x0043104b: 'DASXmPattern', + // x0043104c: 'TGGCTriggerMode', + // x0043104d: 'StartScanToXrayOnDelay', + // x0043104e: 'DurationOfXrayOn', + // x00431060: 'SlopInt10-17', + // x00431061: 'ScannerStudyEntityUID', + // x00431062: 'ScannerStudyID', + // x0043106f: 'ScannerTableEntry', x00440001: 'ProductPackageIdentifier', x00440002: 'SubstanceAdministrationApproval', x00440003: 'ApprovalStatusFurtherDescription', @@ -1886,40 +1916,40 @@ let _dicomTagDescriptions = { x00440012: 'SubstanceAdministrationDeviceID', x00440013: 'ProductParameterSequence', x00440019: 'SubstanceAdminParameterSeq', - x00451001: 'NumberOfMacroRowsInDetector', - x00451002: 'MacroWidthAtISOCenter', - x00451003: 'DASType', - x00451004: 'DASGain', - x00451005: 'DASTemperature', - x00451006: 'TableDirectionInOrOut', - x00451007: 'ZSmoothingFactor', - x00451008: 'ViewWeightingMode', - x00451009: 'SigmaRowNumberWhichRowsWereUsed', - x0045100a: 'MinimumDasValueFoundInTheScanData', - x0045100b: 'MaximumOffsetShiftValueUsed', - x0045100c: 'NumberOfViewsShifted', - x0045100d: 'ZTrackingFlag', - x0045100e: 'MeanZError', - x0045100f: 'ZTrackingMaximumError', - x00451010: 'StartingViewForRow2a', - x00451011: 'NumberOfViewsInRow2a', - x00451012: 'StartingViewForRow1a', - x00451013: 'SigmaMode', - x00451014: 'NumberOfViewsInRow1a', - x00451015: 'StartingViewForRow2b', - x00451016: 'NumberOfViewsInRow2b', - x00451017: 'StartingViewForRow1b', - x00451018: 'NumberOfViewsInRow1b', - x00451019: 'AirFilterCalibrationDate', - x0045101a: 'AirFilterCalibrationTime', - x0045101b: 'PhantomCalibrationDate', - x0045101c: 'PhantomCalibrationTime', - x0045101d: 'ZSlopeCalibrationDate', - x0045101e: 'ZSlopeCalibrationTime', - x0045101f: 'CrosstalkCalibrationDate', - x00451020: 'CrosstalkCalibrationTime', - x00451021: 'IterboneOptionFlag', - x00451022: 'PeristalticFlagOption', + // x00451001: 'NumberOfMacroRowsInDetector', + // x00451002: 'MacroWidthAtISOCenter', + // x00451003: 'DASType', + // x00451004: 'DASGain', + // x00451005: 'DASTemperature', + // x00451006: 'TableDirectionInOrOut', + // x00451007: 'ZSmoothingFactor', + // x00451008: 'ViewWeightingMode', + // x00451009: 'SigmaRowNumberWhichRowsWereUsed', + // x0045100a: 'MinimumDasValueFoundInTheScanData', + // x0045100b: 'MaximumOffsetShiftValueUsed', + // x0045100c: 'NumberOfViewsShifted', + // x0045100d: 'ZTrackingFlag', + // x0045100e: 'MeanZError', + // x0045100f: 'ZTrackingMaximumError', + // x00451010: 'StartingViewForRow2a', + // x00451011: 'NumberOfViewsInRow2a', + // x00451012: 'StartingViewForRow1a', + // x00451013: 'SigmaMode', + // x00451014: 'NumberOfViewsInRow1a', + // x00451015: 'StartingViewForRow2b', + // x00451016: 'NumberOfViewsInRow2b', + // x00451017: 'StartingViewForRow1b', + // x00451018: 'NumberOfViewsInRow1b', + // x00451019: 'AirFilterCalibrationDate', + // x0045101a: 'AirFilterCalibrationTime', + // x0045101b: 'PhantomCalibrationDate', + // x0045101c: 'PhantomCalibrationTime', + // x0045101d: 'ZSlopeCalibrationDate', + // x0045101e: 'ZSlopeCalibrationTime', + // x0045101f: 'CrosstalkCalibrationDate', + // x00451020: 'CrosstalkCalibrationTime', + // x00451021: 'IterboneOptionFlag', + // x00451022: 'PeristalticFlagOption', x00460012: 'LensDescription', x00460014: 'RightLensSequence', x00460015: 'LeftLensSequence', @@ -2423,7 +2453,7 @@ let _dicomTagDescriptions = { x20400082: 'OverlayBackgroundDensity', x20400090: 'OverlayMode', x20400100: 'ThresholdDensity', - x20400500: 'ReferencedImageBoxSequence', + x20400500: 'ReferencedImageBoxSequenceRetired', x20500010: 'PresentationLUTSequence', x20500020: 'PresentationLUTShape', x20500500: 'ReferencedPresentationLUTSequence', @@ -2436,7 +2466,7 @@ let _dicomTagDescriptions = { x21000140: 'DestinationAE', x21000160: 'OwnerID', x21000170: 'NumberOfFilms', - x21000500: 'ReferencedPrintJobSequence', + x21000500: 'ReferencedPrintJobSequencePullStoredPrint', x21100010: 'PrinterStatus', x21100020: 'PrinterStatusInfo', x21100030: 'PrinterName', @@ -3081,7 +3111,7 @@ let _dicomTagDescriptions = { x50xx200c: 'AudioSampleData', x50xx200e: 'AudioComments', x50xx2500: 'CurveLabel', - x50xx2600: 'ReferencedOverlaySequence', + x50xx2600: 'CurveReferencedOverlaySequence', x50xx2610: 'ReferencedOverlayGroup', x50xx3000: 'CurveData', x52009229: 'SharedFunctionalGroupsSequence', @@ -3149,17 +3179,43 @@ let _dicomTagDescriptions = { xfffee0dd: 'EndOfSequence' }; -// Safely copy tag descriptions to exported objects... -(function(_dicomTagDescriptions) { +// Safely populate DICOMTagDescriptions object +(function(initialTagDescriptionMap) { const _hasOwn = Object.prototype.hasOwnProperty; - for (let tag in _dicomTagDescriptions) { - if (_hasOwn.call(_dicomTagDescriptions, tag)) { - dicomTagDescriptions[tag] = _dicomTagDescriptions[tag]; + const descriptionMap = DICOMTagDescriptions._descriptions; + for (let tag in initialTagDescriptionMap) { + if (_hasOwn.call(initialTagDescriptionMap, tag)) { + if (tag in descriptionMap) { + // Skip in case the tag is duplicated... + console.info(`DICOMTagDescriptions: Duplicated tag ${tag}...`); + continue; + } + // Save keyword... + const keyword = initialTagDescriptionMap[tag]; + // Create a description entry and freeze it... + const entry = Object.create(null); + entry.tag = tag; + entry.keyword = keyword; + Object.freeze(entry); + // Add tag references to entry... + descriptionMap[tag] = entry; + // Add keyword references to entry (if not present already)... + if (keyword in descriptionMap) { + const currentEntry = descriptionMap[keyword]; + console.info(`DICOMTagDescriptions: Using <${currentEntry.tag},${currentEntry.keyword}> instead of <${entry.tag},${entry.keyword}> for keyword "${keyword}"...`); + } else { + descriptionMap[keyword] = entry; + } } } -}(_dicomTagDescriptions)); + // Freeze internal description map (nothing should be changed in this object afterwords)... + Object.freeze(descriptionMap); +}(initialTagDescriptionMap)); -// Discard original object... -_dicomTagDescriptions = null; +// Freeze exported object... +Object.freeze(DICOMTagDescriptions); -export { dicomTagDescriptions }; +// Discard original map... +initialTagDescriptionMap = null; + +export { DICOMTagDescriptions };