Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 67x | import FileLoaderService from './fileLoaderService';
import { DicomMetadataStore } from '@ohif/core';
const processFile = async file => {
try {
const fileLoaderService = new FileLoaderService(file);
const imageId = fileLoaderService.addFile(file);
const image = await fileLoaderService.loadFile(file, imageId);
const dicomJSONDataset = await fileLoaderService.getDataset(image, imageId);
DicomMetadataStore.addInstance(dicomJSONDataset);
} catch (error) {
console.log(error.name, ':Error when trying to load and process local files:', error.message);
}
};
export default async function filesToStudies(files) {
const processFilesPromises = files.map(processFile);
await Promise.all(processFilesPromises);
return DicomMetadataStore.getStudyInstanceUIDs();
}
|