Fix contour annotations RTSS saving (#5545)

* [WIP] Fix contour annotations RTSS saving

* fix: Export image sop image reference provider

* Fixes for download with filename

* Updates to fix metadata issues with CS3D

* Updates to save menu

* Fixing some additional re-save metadata

* Add support for saving with predecessor image sequence

* PR comment fixes

* fix: Load RTSS after save

* fix segmentation save

* fix load of mixed seg/rt studies

* Use frame module to get information on the frame shown

* Fix study browser to use instances.length when numImageFrames not present

* fix: Load of display set split from multiple non-FOR referenes

* Fix RT and SEG applying to wrong series because of using
referenced series sequence without checkout sop instances

* Fix save seg

* Update to released CS3D versions

* test: Add revokeObjectURL to test download blob

* Add hard dependency on mode-basic to fix build order issues

* fix: build

* Try to fix build segmentation

* PR comments

* PR comment update
This commit is contained in:
Bill Wallace authored and GitHub committed 2025-11-21 13:07:26 -05:00
1 parent 9c5043ca2c
commit 57205703bb
68 files changed
+962 -648

No files matched your search

@@ -44,6 +44,13 @@ export function addProxyFields(instance) {
enumerable: true,
get: () => {
return instance._parentInstance?.[fieldProxy] ?? instance._parentInstance?._shared?.[fieldProxy];
},
set: (value) => {
Object.defineProperty(instance,fieldProxy, {
writable: true,
enumerable: true,
value,
})
}
});
}
+36
View File
@@ -0,0 +1,36 @@
/**
* Converts a blob to a URL and downloads immediate
*/
export function downloadBlob(content, options?) {
const url = URL.createObjectURL(content);
downloadUrl(url, options);
URL.revokeObjectURL(url);
}
/**
* Trigger file download from an array buffer
* @param buffer
* @param filename
*/
export function downloadDicom(buffer: ArrayBuffer, options) {
const blob = new Blob([buffer], { type: 'application/dicom' });
downloadBlob(blob, options);
}
/**
* Downloads a URL
*/
export function downloadUrl(url, options?) {
const link = document.createElement('a');
link.setAttribute('href', url);
const filename = options?.filename || 'file.dcm';
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
export function downloadCsv(csvString: string, options?) {
const blob = new Blob([csvString], { type: 'text/csv;charset=utf-8;' });
downloadBlob(blob, options);
}
+2 -6
View File
@@ -1,3 +1,4 @@
import { downloadUrl } from './downloadBlob';
import { DicomMetadataStore } from '../services/DicomMetadataStore/DicomMetadataStore';
import formatPN from './formatPN';
@@ -97,10 +98,5 @@ function _getCommonRowItems(measurement, seriesMetadata) {
function _createAndDownloadFile(csvContent) {
const encodedUri = encodeURI(csvContent);
const link = document.createElement('a');
link.setAttribute('href', encodedUri);
link.setAttribute('download', 'MeasurementReport.csv');
document.body.appendChild(link);
link.click();
downloadUrl(encodedUri, { filename: 'MeasurementReport.csv' });
}
+10
View File
@@ -48,6 +48,8 @@ import areAllImageOrientationsEqual from './areAllImageOrientationsEqual';
import { structuredCloneWithFunctions } from './structuredCloneWithFunctions';
import { buildButtonCommands } from './buildButtonCommands';
import { downloadBlob, downloadUrl, downloadCsv, downloadDicom } from './downloadBlob';
// Commented out unused functionality.
// Need to implement new mechanism for derived displaySets using the displaySetManager.
@@ -99,6 +101,10 @@ const utils = {
getClosestOrientationFromIOP,
calculateScanAxisNormal,
areAllImageOrientationsEqual,
downloadBlob,
downloadUrl,
downloadCsv,
downloadDicom,
};
export {
@@ -137,6 +143,10 @@ export {
MeasurementFilters,
getClosestOrientationFromIOP,
buildButtonCommands,
downloadBlob,
downloadUrl,
downloadCsv,
downloadDicom,
};
export default utils;