feat(STOW-RS) Save DICOM Structured Reports from Measurement Table back to archive (#236)
* Small refactor into Table Class setting events as static object into class * feature(STOW-SR) : Initial changes to stow when we have Server. * Improvements into requests and small fix into style * Small fix for jumpToRow without refheshing page * Handling STOW-SR once we don't have server * feature(STOW-SR) Refactor * Merge request with makeRequest and delete old file * Expose wadoproxy to client and update measurement-table to start using wadoproxy.getServerUrl * Move WADOProxy.getServerUrl to Measurement-table package. Fix querystring issue. * Remove proxy:enabled in favour of requestOptions.requestFromBrowser * Bcrypt 2.0.0 to fix Travis
This commit is contained in:
1 parent
13e4dc25e1
commit
26b14f1dab
26 files changed
+1079
-179
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { dcmjs } from 'meteor/ohif:cornerstone';
|
||||
import getLengthMeasurementData from './getLengthMeasurementData';
|
||||
import { toArray, codeMeaningEquals, getAllDisplaySets } from './srUtils'
|
||||
|
||||
const imagingMeasurementsToMeasurementData = (dataset, displaySets) => {
|
||||
// Identify the Imaging Measurements
|
||||
const imagingMeasurementContent = toArray(dataset.ContentSequence).find(codeMeaningEquals("Imaging Measurements"));
|
||||
|
||||
// Retrieve the Measurements themselves
|
||||
const measurementGroupContent = toArray(imagingMeasurementContent.ContentSequence).find(codeMeaningEquals("Measurement Group"));
|
||||
|
||||
// For now, bail out if the dataset is not a TID1500 SR with length measurements
|
||||
// TODO: generalize to the various kinds of report
|
||||
// TODO: generalize to the kinds of measurements the Viewer supports
|
||||
if (dataset.ContentTemplateSequence.TemplateIdentifier !== "1500") {
|
||||
OHIF.log.warn("This package can currently only interpret DICOM SR TID 1500");
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// Filter to find Length measurements in the Structured Report
|
||||
const lengthMeasurementContent = toArray(measurementGroupContent.ContentSequence).filter(codeMeaningEquals("Length"));
|
||||
|
||||
// Retrieve Length Measurement Data
|
||||
return getLengthMeasurementData(lengthMeasurementContent, displaySets);
|
||||
};
|
||||
|
||||
export default retrieveDataFromSR = (Part10SRArrayBuffer) => {
|
||||
const allDisplaySets = getAllDisplaySets();
|
||||
|
||||
// get the dicom data as an Object
|
||||
let dicomData = dcmjs.data.DicomMessage.readFile(Part10SRArrayBuffer);
|
||||
let dataset = dcmjs.data.DicomMetaDictionary.naturalizeDataset(dicomData.dict);
|
||||
|
||||
// Convert the SR into the kind of object the Measurements package is expecting
|
||||
return imagingMeasurementsToMeasurementData(dataset, allDisplaySets);
|
||||
};
|
||||
Reference in new issue
Block a user