@cornerstonejs/adapters 3.7.5 → 3.7.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.
@@ -3,7 +3,7 @@ import ndarray from 'ndarray';
3
3
  import getDatasetsFromImages from '../helpers/getDatasetsFromImages.js';
4
4
  import checkOrientation from '../helpers/checkOrientation.js';
5
5
  import compareArrays from '../helpers/compareArrays.js';
6
- import Events from '../enums/Events.js';
6
+ import { Events } from '../enums/Events.js';
7
7
 
8
8
  const {
9
9
  rotateDirectionCosinesInPlane,
@@ -893,7 +893,14 @@ function getImageIdOfSourceImageBySourceImageSequence(SourceImageSequence, sopUI
893
893
  ReferencedSOPInstanceUID,
894
894
  ReferencedFrameNumber
895
895
  } = SourceImageSequence;
896
- return ReferencedFrameNumber ? getImageIdOfReferencedFrame(ReferencedSOPInstanceUID, ReferencedFrameNumber, sopUIDImageIdIndexMap) : sopUIDImageIdIndexMap[ReferencedSOPInstanceUID];
896
+ const imageId = sopUIDImageIdIndexMap[ReferencedSOPInstanceUID];
897
+ if (imageId) {
898
+ return imageId;
899
+ }
900
+ if (ReferencedFrameNumber) {
901
+ return getImageIdOfReferencedFrame(ReferencedSOPInstanceUID, ReferencedFrameNumber, sopUIDImageIdIndexMap);
902
+ }
903
+ return undefined;
897
904
  }
898
905
 
899
906
  /**
@@ -39,7 +39,10 @@ export default class MeasurementReport {
39
39
  vr: string;
40
40
  };
41
41
  };
42
- static generateDerivationSourceDataset: (instance: any) => any;
42
+ static generateDerivationSourceDataset: (instance: any) => {
43
+ _meta: any;
44
+ _vrMap: any;
45
+ };
43
46
  static getSetupMeasurementData(MeasurementGroup: any, sopInstanceUIDToImageIdMap: any, metadata: any, toolType: any): {
44
47
  defaultState: {
45
48
  description: any;
@@ -3,6 +3,7 @@ import CORNERSTONE_3D_TAG from './cornerstone3DTag.js';
3
3
  import { toArray } from '../helpers/toArray.js';
4
4
  import { codeMeaningEquals } from '../helpers/codeMeaningEquals.js';
5
5
  import 'buffer';
6
+ import { copyStudyTags } from '../helpers/copyStudyTags.js';
6
7
  import CodingScheme from './CodingScheme.js';
7
8
 
8
9
  var _MeasurementReport;
@@ -282,15 +283,8 @@ _MeasurementReport.codeValueMatch = (group, code, oldCode) => {
282
283
  return CodingSchemeDesignator == code.CodingSchemeDesignator && CodeValue == code.CodeValue || oldCode && CodingSchemeDesignator == oldCode.CodingSchemeDesignator && CodeValue == oldCode.CodeValue;
283
284
  };
284
285
  _MeasurementReport.generateDerivationSourceDataset = instance => {
285
- const _vrMap = {
286
- PixelData: "OW"
287
- };
288
- const _meta = _MeasurementReport.generateDatasetMeta();
289
- const derivationSourceDataset = {
290
- ...instance,
291
- _meta: _meta,
292
- _vrMap: _vrMap
293
- };
286
+ _MeasurementReport.generateDatasetMeta();
287
+ const derivationSourceDataset = copyStudyTags(instance);
294
288
  return derivationSourceDataset;
295
289
  };
296
290
 
@@ -5,7 +5,7 @@ import ndarray from 'ndarray';
5
5
  import checkOrientation from '../../helpers/checkOrientation.js';
6
6
  import { getValidOrientations, getSegmentMetadata, unpackPixelData, calculateCentroid, readFromUnpackedChunks, alignPixelDataWithSourceData, getSegmentIndex, findReferenceSourceImageId } from '../../Cornerstone/Segmentation_4X.js';
7
7
  import { compactMergeSegmentDataWithoutInformationLoss } from './compactMergeSegData.js';
8
- import Events from '../../enums/Events.js';
8
+ import { Events } from '../../enums/Events.js';
9
9
 
10
10
  const {
11
11
  DicomMessage,
@@ -1,4 +1,4 @@
1
- declare enum Events {
1
+ export declare enum Events {
2
2
  SEGMENTATION_LOAD_PROGRESS = "CORNERSTONE_ADAPTER_SEGMENTATION_LOAD_PROGRESS"
3
3
  }
4
4
  export default Events;
@@ -2,6 +2,5 @@ var Events;
2
2
  (function (Events) {
3
3
  Events["SEGMENTATION_LOAD_PROGRESS"] = "CORNERSTONE_ADAPTER_SEGMENTATION_LOAD_PROGRESS";
4
4
  })(Events || (Events = {}));
5
- var Events$1 = Events;
6
5
 
7
- export { Events$1 as default };
6
+ export { Events };
@@ -1,2 +1 @@
1
- import Events from "./Events";
2
- export { Events };
1
+ export * from "./Events";
@@ -1 +1 @@
1
- export { default as Events } from './Events.js';
1
+ export { Events } from './Events.js';
@@ -0,0 +1,7 @@
1
+ export declare const patientTags: string[];
2
+ export declare const studyTags: string[];
3
+ export declare const patientStudyTags: string[];
4
+ export declare function copyStudyTags(src: any): {
5
+ _meta: any;
6
+ _vrMap: any;
7
+ };
@@ -0,0 +1,19 @@
1
+ const patientTags = ["PatientName", "PatientID", "PatientBirthDate", "PatientBirthTime", "PatientID", "IssuerOfPatientID", "OtherPatientIDs", "OtherPatientIDsSequence", "PatientSex", "PatientIdentityRemoved", "DeidentificationMethodCodeSequence"];
2
+ const studyTags = ["StudyDate", "StudyTime", "StudyStatusID", "StudyPriorityID", "StudyInstanceUID", "StudyDescription", "AccessionNumber", "StudyID", "ReferringPhysicianName", "BodyPartExamined", "TimezoneOffsetFromUTC"];
3
+ const patientStudyTags = [...patientTags, ...studyTags];
4
+ function copyStudyTags(src) {
5
+ const study = {
6
+ _meta: src._meta,
7
+ _vrMap: src._vrMap
8
+ };
9
+ for (const tagKey of patientStudyTags) {
10
+ const value = src[tagKey];
11
+ if (value === undefined) {
12
+ continue;
13
+ }
14
+ study[tagKey] = value;
15
+ }
16
+ return study;
17
+ }
18
+
19
+ export { copyStudyTags, patientStudyTags, patientTags, studyTags };
@@ -2,4 +2,5 @@ import { toArray } from "./toArray";
2
2
  import { codeMeaningEquals } from "./codeMeaningEquals";
3
3
  import { graphicTypeEquals } from "./graphicTypeEquals";
4
4
  import { downloadDICOMData } from "./downloadDICOMData";
5
+ export { copyStudyTags } from "./copyStudyTags";
5
6
  export { toArray, codeMeaningEquals, graphicTypeEquals, downloadDICOMData };
@@ -2,3 +2,4 @@ export { toArray } from './toArray.js';
2
2
  export { codeMeaningEquals } from './codeMeaningEquals.js';
3
3
  export { graphicTypeEquals } from './graphicTypeEquals.js';
4
4
  export { downloadDICOMData } from './downloadDICOMData.js';
5
+ export { copyStudyTags } from './copyStudyTags.js';
@@ -1,2 +1 @@
1
- import { Enums, adaptersSR, adaptersSEG, adaptersPMAP, adaptersRT, helpers } from "./adapters";
2
- export { adaptersSR, adaptersSEG, adaptersPMAP, adaptersRT, Enums, helpers };
1
+ export * from "./adapters";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/adapters",
3
- "version": "3.7.5",
3
+ "version": "3.7.7",
4
4
  "description": "Adapters for Cornerstone3D to/from formats including DICOM SR and others",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/esm/index.d.ts",
@@ -84,8 +84,8 @@
84
84
  "ndarray": "^1.0.19"
85
85
  },
86
86
  "peerDependencies": {
87
- "@cornerstonejs/core": "^3.7.5",
88
- "@cornerstonejs/tools": "^3.7.5"
87
+ "@cornerstonejs/core": "^3.7.7",
88
+ "@cornerstonejs/tools": "^3.7.7"
89
89
  },
90
- "gitHead": "81632a9aae1c17f5de5d3a6c59d448960c4f7804"
90
+ "gitHead": "7ed61217915130914035998986ae22e05af1a4ea"
91
91
  }