Repository navigation
Explorer hooks for plugins: context-menu contributor, thumbnail badges, DICOMweb origin of a study - #950
Explorer hooks for plugins: context-menu contributor, thumbnail badges, DICOMweb origin of a study#950nroduit wants to merge 3 commits into
Conversation
ExplorerMenuContributor is the extension point, ExplorerMenuContributors the registry (no framework import, so the pf4j port only changes who registers). The popup of the DICOM explorer asks the contributors after its built-in items, below a separator added only when something was contributed; a failing contributor is logged and skipped. The explorer activator tracks the registered services. First consumer: the UPS-RS "AI tasks" submenu (discussion #925, PR #944).
SeriesBadgeProvider services, tracked by the core activator into UICore.getSeriesBadgeProviders(), are consulted by SeriesThumbnail when it paints the special-element icons: their icons follow the PR/KO/SEG ones, without duplicates, and a failing provider never blanks a thumbnail. Two badges for the AI workflow (OtherIcon.AI_TASK and AI_RESULT): a task is pending on the study, or its results are ready to open. They live in the shared resources because badges resolve from weasis.resources.path.
A study loaded through DICOMweb kept no trace of its server: the dicom:rs path stores an empty base URL in the series WadoParameters and keeps the real one in the query properties. DicomWebOrigin (base URL, authentication method uid, node id) is now written under TagW.DicomWebOrigin by dicom:rs, the WADO-RS manifests and the DICOMweb retrieve of the Q/R dialog; the first origin of a study wins. It can be recovered from a series, matched back to a configured DicomWebNode (by id, else longest URL prefix) and gives the WADO-RS study, series and instance URLs. Needed by the UPS-RS plugin (workitems of the study's server, Input Information Sequence) and by the FHIR viewer evaluation.
|
Thanks for the explorer hooks - exactly the three extension points phase 2 needs (context-menu contributor, thumbnail badges, DICOMweb origin). Here is how we see phase 2 on top of them: Clarus as the origin, clinfer as the performer, one patient 1. Availability. The badge is an availability indicator, not decoration: only the chest series carries it, because the catalogue task targets 2. Done. Run (Create, RAD-80) -> clinfer claims -> COMPLETED. The badge flips to the result state, and "Show tasks" names the derived object by its own SOP Class UID (Secondary Capture), not a hard-coded one. 3. Cancel. While a task is queued or running, the menu offers Cancel (Request Cancellation, 11.8). Two questions on the menu behaviour:
The workitem codes are minted under the private scheme |
|
Thanks, this is close to the target. Two principles first, then some suggestions. I have not tested the plugin against a real Task Manager and performer, so take the five points below as proposals to discuss, not as review requests; you know the Clarus and clinfer behaviour better than I do. The plugin implements the IHE AIW-I roles as they are written: Weasis is the Task Requestor (Create UPS Workitem, RAD-80) grouped with a Watcher (Manage Subscription RAD-86, Open Event Channel RAD-109, Get Workitem RAD-83). Everything the UI shows should come from the workitem itself, Procedure Step State, Scheduled Workitem Code Sequence, Input and Output Information Sequences, so that the same menu works with any Task Manager and any performer. Deployment choices stay in the per-node catalog, which is what RAD-80 asks of a requestor ("sites configure the codes"); nothing in the plugin should need to know about a vendor, a modality or a body part.
On the hooks and the roadmap: PR #950 is a minimal implementation, enough for this submenu and the badge on the current master, and I do not plan to extend it further. Weasis 5 brings big changes in the architecture (pf4j extension points, command-first design) and in the explorer UI (see #947: modes by context, smart filters, objects as items), and the AI tasks integration will be designed against that explorer, not against the current popup. So I would rather focus on the final integration in Weasis 5 (#947) than refine the master version. The interfaces of #950 remain the contract: the service, the catalog and the menu logic of your plugin carry over as they are, and the port will be limited to the registration class and the command class. |
|
Dear Nicolas, Thank you for the review. The two principles settle the architecture, and they
Here is where I land on each point, and the one place Clarus differs from Badge: workitem state, not availabilityAgreed. The availability badge (and the body-part check behind it) came out of
The body-part rule moves to the catalog as an applicability filter that decides Run after COMPLETED, and create-if-noneYour reading matches Clarus: a completed task is history, and Run creates a new On create-if-none, to be precise because you asked: Clarus keys it on the Study My recommendation is to leave input-set comparison out of the baseline Results: the standard pathAgreed. Build RsQueryParams from the study's DicomWebOrigin (base URL + auth Menu rows instead of the dialogAgreed. One row per workitem, labelled by Code Meaning: Queued / Running / Input scopeI will add the two scopes (whole study / selected series), with the selection Weasis 5 and #950Understood: #950 stays a minimal contract and you will not extend it; the final Two questions so I can plan that port:
I am not blocked by the 5.0 release date - the #950 master implementation is The orange dotYou asked about the orange dot at the top-left of the thumbnail. That is Best regards, |
|
Thanks for the feedback.
|



Three small core extension points so a plugin can integrate in the DICOM explorer without patching it. First consumer: the UPS-RS User Agent of discussion #925 (phase 2 of PR #944, the "AI tasks" submenu and the pending-task badge).
What is added
weasis-dicom-explorer):ExplorerMenuContributorservice,ExplorerMenuContributorsregistry. The thumbnail popup asks the contributors after its built-in items, below a separator added only when something was contributed; a contributor that throws is logged and skipped. There is no study-level menu by design: the series knows its study through the model, as "Remove study" already does.weasis-core):SeriesBadgeProviderservices, listed inUICore.getSeriesBadgeProviders(), merged bySeriesThumbnailafter the PR / KO / SEG icons, without duplicates. Two icons for the AI workflow,OtherIcon.AI_TASK(task pending) andOtherIcon.AI_RESULT(results ready), in the shared resources since badges resolve fromweasis.resources.path.weasis-dicom-explorer,weasis-dicom-qr):DicomWebOrigin(base URL, authentication method uid, node id) underTagW.DicomWebOrigin, written by$dicom:rs, the WADO-RS manifests and the DICOMweb retrieve of the Q/R dialog. The$dicom:rspath kept an empty base URL in the seriesWadoParameters, so a plugin had no way to know which server to ask. The record can be recovered from a series, matched back to a configuredDicomWebNode(by id, else longest URL prefix) and gives WADO-RS study / series / instance URLs. Also needed by the FHIR viewer evaluation.The registries and the record carry no OSGi import; only the two activators track services, so the port to the 5.0 plugin framework is the registration only.
Validation
ExplorerMenuContributorsTest,SeriesBadgeProviderTest,DicomWebOriginTest.weasis-core(1162),weasis-dicom-explorer(173) andweasis-dicom-qr(31) green; full reactor build green.