Address SliceThickness.toFixed TypeError #3510
Merged
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
Fixes Issue 3465. This error resulted from the
SliceThickness
variable inextensions/cornerstone-dicom-seg/src/viewports/OHIFCornerstoneSEGViewport.tsx
having a string value and being unable to call toFixed.Changes & Results
I added
parseFloat
to a couple of lines inextensions/cornerstone-dicom-seg/src/viewports/OHIFCornerstoneSEGViewport.tsx
and it seems to have fixed the problem I was having before and renders segmentations. These are my changes (starting at line 346):Before adding these changes, I was faced with a 'Something Went Wrong' warning screen as depicted in Issue 3465. After applying them, I was successfully able to view segmentations, as shown here:
Testing
To test my changes, use OHIF in combination with a DCM4CHEE archive. Select a SEG/MR study from the main page and launch the basic viewer. Click on the segmentation to open it. It should now be visible even in cases where SliceThickness has a string value.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment