feat(ecg): add DICOM ECG waveform extension#5856
feat(ecg): add DICOM ECG waveform extension#5856TFRadicalImaging wants to merge 3 commits intoOHIF:masterfrom
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
| renderingEngineRef.current = null; | ||
| } | ||
| }; | ||
| }, [imageId, viewportId]); |
There was a problem hiding this comment.
Missing instance in dependency array — effect uses it but won't re-run if it changes
| }, [imageId, viewportId]); | |
| }, [imageId, viewportId, instance]); |
There was a problem hiding this comment.
Fixed — the custom OHIFCornerstoneEcgViewport component has been removed entirely, so this is no longer applicable.
Introduce @ohif/extension-dicom-ecg for rendering DICOM waveform (ECG) data. Register the extension in the basic mode and pluginConfig.json, and remove ECG from NON_IMAGE_MODALITIES so waveform display sets are handled by the new viewport.
1889f0f to
453b51a
Compare
There was a problem hiding this comment.
You shouldn't need a new OHIFCornerstoneEcgViewport type - you can use the existing OHIFCornerstoneViewport base instance, and just treat it like video or other types that just render with a base viewport.
There was a problem hiding this comment.
Removed OHIFCornerstoneEcgViewport. ECG now uses OHIFCornerstoneViewport — CornerstoneViewportService detects ECGViewport instances and calls setEcg(imageId) directly.
There was a problem hiding this comment.
This should go into the existing metadata provider that OHIF is using - eventually it is going into @cornerstonejs/metadata providers, but right now it should go in the OHIF provider.
There was a problem hiding this comment.
Moved to extensions/cornerstone/src/utils/ecgMetadata.ts. The ECG module is now registered via genericMetadataProvider.addRaw() in the SOP class handler when the display set is created, so Cornerstone can find it through the standard metaData.get() lookup.
There was a problem hiding this comment.
This can go alongside the cornerstone extension so you don't need a custom extension - again, once @cornerstonejs/metadata is released, this will get added as a customization module with configuration values, but right now it can just live alongside the cornerstone viewport types - probably the video should move there too.
There was a problem hiding this comment.
Not asking or saying you to move the video - that is a longer term change.
There was a problem hiding this comment.
Done. The dicom-ecg extension has been removed. The ECG SOP class handler (DicomEcgSopClassHandler) now lives in extensions/cornerstone/src/getSopClassHandlerModule.js alongside the microscopy handler.
… feedback - Remove standalone dicom-ecg extension; fold all ECG functionality into the cornerstone extension as requested by reviewer - Add ECG SOP class handler (DicomEcgSopClassHandler) to the cornerstone extension getSopClassHandlerModule, registering ECG waveform metadata via genericMetadataProvider on display set creation - Move ECG helpers (buildEcgModule, decodeInt16Multiplex, base64ToArrayBuffer) into extensions/cornerstone/src/utils/ecgMetadata.ts - Handle ECGViewport in CornerstoneViewportService._setDisplaySets by detecting ECGViewport instanceof and calling setEcg(imageId) directly, so OHIFCornerstoneViewport can be used without a custom ECG viewport component - Add ECG support to getCornerstoneViewportType utility - Update basic mode to reference the cornerstone extension's ECG SOP handler and use the base cornerstone viewport for ECG display sets - Migrate ecgMetadata and getCornerstoneViewportType tests
4cf4602 to
997fd2b
Compare
There was a problem hiding this comment.
Revert this in favour of upstream origin/master version - you should not commit lock files unless you have specific updates.
There was a problem hiding this comment.
Done, reverted to upstream origin/master version.
Context
This PR adds DICOM ECG/waveform rendering support to the OHIF viewer. Previously, ECG studies were listed in
NON_IMAGE_MODALITIESand not rendered. ECG support is now integrated directly into the cornerstone extension rather than as a separate package.Changes & Results
DicomEcgSopClassHandlertoextensions/cornerstone/src/getSopClassHandlerModule.jsalongside the existing microscopy handlerbuildEcgModule,decodeInt16Multiplex,base64ToArrayBuffer) inextensions/cornerstone/src/utils/ecgMetadata.ts; ECG metadata registered viagenericMetadataProviderat display set creation timeECGViewportinCornerstoneViewportService._setDisplaySets— detects the viewport type and callssetEcg(imageId)so the standardOHIFCornerstoneViewportworks without a custom componentgetCornerstoneViewportTypeECGfromNON_IMAGE_MODALITIESBefore: ECG studies were skipped/not rendered.
After: ECG studies are routed through the cornerstone extension and displayed as waveforms using the standard viewport infrastructure.
Testing
https://viewer-dev.ohif.org/viewer?StudyInstanceUIDs=2.25.209974489360710696739324151261716440238)Checklist
PR
Code
Tested Environment