fix(measurements): read displayName in SplineROI and PlanarFreehandROI reports#5908
Open
GhadeerAlbattarni wants to merge 1 commit intoOHIF:masterfrom
Open
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
Related to issue #5588
getColumnValueReportinPlanarFreehandROI.tsandSplineROI.tswas destructuring{ name, value }from each report config item, but thecornerstone.measurementscustomization schema definesdisplayName, notname.Changes & Results
PlanarFreehandROI.ts— changed{ name, value }→{ displayName, value }ingetColumnValueReportSplineROI.ts— same fixBefore
The report were missing some entries like:
AreaandUnitfor SplineROIMean,Max,AreaandUnitfor PlanarFreehandROIAfter
The report has all the missing fields above.
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
This PR fixes a bug where
getColumnValueReportinPlanarFreehandROI.tsandSplineROI.tsdestructured{ name, value }from customization report config items, but thecornerstone.measurementscustomization schema (defined inmeasurementsCustomization.ts) usesdisplayName, notname. Becausenamewas alwaysundefined, thedownloadCSVReportlogic inplatform/core/src/utils/downloadCSVReport.jswas collapsing all measurement-specific columns (Mean, Max, Area, Unit) into a single column namedundefined— with each subsequent value overwriting the previous one. The fix correctly aligns the destructuring key todisplayName, so each statistic gets its own properly labelled CSV column.PlanarFreehandROI.tsandSplineROI.tsnow destructure{ displayName, value }ingetColumnValueReport, consistent with thecornerstone.measurementsschema.CircleROI.ts) build their column lists.if( !cachedStats )→if (!cachedStats)) is included inPlanarFreehandROI.ts.Confidence Score: 5/5
displayName, notname) is clearly confirmed bymeasurementsCustomization.ts. The downstreamdownloadCSVReport.jslogic relies on column names being meaningful strings forArray.includes/Array.indexOflookups, so the fix unblocks the correct CSV output. No new logic is introduced and no regressions are expected.Important Files Changed
name→displayNameingetColumnValueReportto match thecornerstone.measurementscustomization schema. Includes a minor whitespace cleanup (if( !cachedStats )→if (!cachedStats)).name→displayNameingetColumnValueReport, mirroring the same fix applied to PlanarFreehandROI.ts.Sequence Diagram
sequenceDiagram participant User participant MeasurementsPanel participant downloadCSVReport participant getColumnValueReport participant measurementsCustomization User->>MeasurementsPanel: Click "Download CSV" MeasurementsPanel->>downloadCSVReport: measurementData[] loop For each measurement downloadCSVReport->>getColumnValueReport: annotation, customizationService getColumnValueReport->>measurementsCustomization: getCustomization('cornerstone.measurements') measurementsCustomization-->>getColumnValueReport: report: [{ displayName, value }] Note over getColumnValueReport: Before fix: destructured { name } → undefined<br/>After fix: destructured { displayName } → 'Mean','Max','Area','Unit' getColumnValueReport-->>downloadCSVReport: { columns: ['AnnotationType','Mean',...], values: [...] } end downloadCSVReport->>downloadCSVReport: Build column index map downloadCSVReport->>User: MeasurementReport.csv with correct headersLast reviewed commit: "fix(measurements): r..."