Initial work on Nucleus parity merge

This commit is contained in:
Emanuel F. Oliveira committed 2017-01-29 22:11:17 -02:00
1 parent aa88fe181a
commit 680beb163f
38 files changed
+4353 -1

No files matched your search

@@ -0,0 +1,30 @@
/**
* Helper function to quickly obtain the frameOfReferenceUID
* for a given element from the enabled image's metadata.
*
* If no image, imagePlane, or frameOfReferenceUID is available,
* the function will return undefined.
*
* @param element
* @returns {string}
*/
export function getFrameOfReferenceUID(element) {
var enabledElement;
try {
enabledElement = cornerstone.getEnabledElement(element);
} catch(error) {
return;
}
if (!enabledElement || !enabledElement.image) {
return;
}
var imageId = enabledElement.image.imageId;
var imagePlane = cornerstoneTools.metaData.get('imagePlane', imageId);
if (!imagePlane || !imagePlane.frameOfReferenceUID) {
return;
}
return imagePlane.frameOfReferenceUID;
}