refactor(tools): resolve targetsFilter through annotationTargetFilter metadata providers#2802
Closed
sedghi wants to merge 1 commit into
Closed
Conversation
… metadata providers
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Implements the review suggestion on #2557: the measurement target-selection helpers should not live as static API on the tool classes (
CircleROITool.targetFilters.forModality('PT')etc.). Instead, target selection is resolved through the existing metadata-provider system. This PR targets thefeat/add-multiple-resultsbranch so the diff shows only the architecture change.Changes & Results
BaseTool.targetFiltersandBaseTool.NON_PIXEL_DATA_MODALITIES- no tool class carries a copy of the target-selection API anymore.targetsFiltertool configuration is now a declarative spec naming a provider key and its options:BaseToolresolves the spec through the metadata provider chain:getMetaDatarather thanget:get(type, ...queries)treats extra arguments as alternative queries and would drop the options, whilegetMetaData(type, query, options)forwards them to the providers.utilities.annotationTargetFilterProvider, registered once byinit(), answering the keysfirst,all,allPixelData(still the ROI tools' default, now{ key: 'allPixelData' }),modality(string or array) andid. It is registered below the default priority, so an application provider registered at the default priority overrides the built-in keys, and unknown keys fall through the chain - applications add target-selection behavior through their existing metadata providers without a new registry concept.metaData.removeAllProviders(), which the test harness and applications call after init),BaseToolconsults the built-in provider directly, so the built-in keys always resolve. A key unknown to both warns once and falls back to the viewport's single default target.targetsFilterfor one-off cases; it adds no registry or tool-class API. Easy to drop if provider-only is preferred.tmtvandpetCtexamples, exportedMeasurementTargetsFilterSpec, and rewrote themeasurementTargetsdocs page around the provider architecture (built-in key table, custom provider registration, priority/override semantics).Testing
packages/toolstypecheck and oxlint clean.CircleROI_test.js(from feat: add results for different viewports on the fusion view for rectangle/circle ROI #2557) exercises the provider resolution path end-to-end via the default{ key: 'allPixelData' }configuration.tmtvexample; the "Circle ROI (PT SUV only)" / "Rectangle ROI (CT HU only)" dropdown entries behave as on the base branch.Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment