fix(multiframe): metadata handling of NM studies and loading order (#4554)
This commit is contained in:
1 parent
6729534a1a
commit
7624ccb5e4
57 files changed
+482
-662
No files matched your search
@@ -8,7 +8,6 @@ import toNumber from '../utils/toNumber';
|
||||
import combineFrameInstance from '../utils/combineFrameInstance';
|
||||
|
||||
class MetadataProvider {
|
||||
private readonly studies: Map<string, any> = new Map();
|
||||
private readonly imageURIToUIDs: Map<string, any> = new Map();
|
||||
private readonly imageUIDsByImageId: Map<string, any> = new Map();
|
||||
// Can be used to store custom metadata for a specific type.
|
||||
@@ -17,6 +16,10 @@ class MetadataProvider {
|
||||
private readonly customMetadata: Map<string, any> = new Map();
|
||||
|
||||
addImageIdToUIDs(imageId, uids) {
|
||||
if (!imageId) {
|
||||
throw new Error('MetadataProvider::Empty imageId');
|
||||
}
|
||||
|
||||
// This method is a fallback for when you don't have WADO-URI or WADO-RS.
|
||||
// You can add instances fetched by any method by calling addInstance, and hook an imageId to point at it here.
|
||||
// An example would be dicom hosted at some random site.
|
||||
@@ -35,6 +38,10 @@ class MetadataProvider {
|
||||
}
|
||||
|
||||
_getInstance(imageId) {
|
||||
if (!imageId) {
|
||||
throw new Error('MetadataProvider::Empty imageId');
|
||||
}
|
||||
|
||||
const uids = this.getUIDsFromImageID(imageId);
|
||||
|
||||
if (!uids) {
|
||||
@@ -455,17 +462,6 @@ class MetadataProvider {
|
||||
}
|
||||
|
||||
getUIDsFromImageID(imageId) {
|
||||
if (!imageId) {
|
||||
throw new Error('MetadataProvider::Empty imageId');
|
||||
}
|
||||
// TODO: adding csiv here is not really correct. Probably need to use
|
||||
// metadataProvider.addImageIdToUIDs(imageId, {
|
||||
// StudyInstanceUID,
|
||||
// SeriesInstanceUID,
|
||||
// SOPInstanceUID,
|
||||
// })
|
||||
// somewhere else
|
||||
|
||||
const cachedUIDs = this.imageUIDsByImageId.get(imageId);
|
||||
if (cachedUIDs) {
|
||||
return cachedUIDs;
|
||||
|
||||
Reference in new issue
Block a user