Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function wadoUriMetaDataProvider(type, imageId) {
const {
parseImageId,
dataSetCacheManager,
} = cornerstoneWADOImageLoader.wadouri;
const parsedImageId = parseImageId(imageId);
const dataSet = dataSetCacheManager.get(parsedImageId.url);
if (!dataSet) {
return;
}
if (type === 'generalImageModule') {
return {
instanceNumber: dataSet.intString('x00200013'),
lossyImageCompression: dataSet.string('x00282110'),
lossyImageCompressionRatio: dataSet.string('x00282112'),
lossyImageCompressionMethod: dataSet.string('x00282114'),
};
}
_checkCachedData() {
const dataSet = cornerstoneWADOImageLoader.wadouri.dataSetCacheManager.get(
this._dataSetUrl
);
if (dataSet) {
const dataSetLength = dataSet.byteArray.length;
this._updateProgress({
percentComplete: 100,
loaded: dataSetLength,
total: dataSetLength,
});
}
}