3.9 KiB
| sidebar_position | sidebar_label | summary |
|---|---|---|
| 4 | Commands | Migration guide for OHIF 3.11's different commands |
updateStoredPositionPresentation
now uses displaySetInstanceUIDs instead of displaySetInstanceUID as a parameter.
loadSRMeasurements Command
Key Changes:
- The
loadSRMeasurementscommand, previously part of the@ohif/extension-cornerstone-dicom-srextension, has been removed. - Its functionality of hydrating a Structured Report (SR) and displaying its referenced series in a viewport is now primarily handled by the new
hydrateSecondaryDisplaySetcommand available in the@ohif/extension-cornerstoneextension. - The
hydrateStructuredReportcommand (from@ohif/extension-cornerstone-dicom-sr) now solely focuses on hydrating the SR and returning its data, without directly manipulating viewports.
Migration Steps:
If you were previously using the loadSRMeasurements command to load and display SR measurements, you should update your code to use the hydrateSecondaryDisplaySet command.
-
Identify
loadSRMeasurementsUsage: Locate where your code callscommandsManager.runCommand('loadSRMeasurements', ...). -
Update to
hydrateSecondaryDisplaySet: Replace the call toloadSRMeasurementswithhydrateSecondaryDisplaySet. You will need to pass the fulldisplaySetobject for the SR and the targetviewportId.- // Old way: using loadSRMeasurements - commandsManager.runCommand('loadSRMeasurements', { - displaySetInstanceUID: srDisplaySetInstanceUID, - // viewportId was implicitly the active one or not directly specifiable here - }); - + // New way: using hydrateSecondaryDisplaySet + const { displaySetService, viewportGridService } = servicesManager.services; + + // 1. Get the SR displaySet object + const srDisplaySet = displaySetService.getDisplaySetByUID(srDisplaySetInstanceUID); + + // 2. Determine the target viewportId (e.g., active viewport) + const viewportId = viewportGridService.getActiveViewportId(); // Or your specific viewportId + + if (srDisplaySet && viewportId) { + commandsManager.runCommand('hydrateSecondaryDisplaySet', { + displaySet: srDisplaySet, + viewportId: viewportId, + }); + } else { + console.warn('SR DisplaySet or ViewportId not found, cannot hydrate.'); + }
Explanation:
- The
loadSRMeasurementscommand was responsible for both hydrating the SR (getting its measurement data and referenced series UIDs) and then updating the viewport to show the referenced series. - The new
hydrateSecondaryDisplaySetcommand, when given an SRdisplaySet(displaySet.Modality === 'SR'), will:- Internally call the
hydrateStructuredReportcommand to parse the SR and get its details (includingSeriesInstanceUIDsof referenced images). - Then, it will automatically find the corresponding image display sets for those
SeriesInstanceUIDs. - Finally, it will update the specified
viewportIdto display the primary referenced image series.
- Internally call the
- This change centralizes the logic for hydrating secondary display sets (like SR, SEG, RTSTRUCT) and updating viewports into the
hydrateSecondaryDisplaySetcommand within the core Cornerstone extension.
Note on UI/Button Changes: The UI button typically associated with "Load SR" (often seen in viewport corners or specific contexts) has also been refactored. The hydration of SRs is now often triggered by:
- The
TrackedMeasurementsContextif the@ohif/extension-measurement-trackingis in use. - The new
ModalityLoadBadgecomponent, which can appear in viewports containing SR, SEG, or RTSTRUCT display sets, offering a "LOAD" action that callshydrateSecondaryDisplaySet.
If you had custom UI invoking loadSRMeasurements, you'll need to adapt it to call hydrateSecondaryDisplaySet as described above.