fix(HistoryMemo): Segmentation delete wasn't remembered#5775
fix(HistoryMemo): Segmentation delete wasn't remembered#5775wayfarer3130 merged 4 commits intomasterfrom
Conversation
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Viewers
|
||||||||||||||||||||||||||||
| Project |
Viewers
|
| Branch Review |
fix/OHIF-2461-OHIF-2460-segmentation-history-fix
|
| Run status |
|
| Run duration | 02m 17s |
| Commit |
|
| Committer | Bill Wallace |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
37
|
| View all changes introduced in this branch ↗︎ | |
|
Testing Notes:
ScreenHunter.Feb.04.11.37.mp4
|
|
@aimee-ferreira - the test build for this has the remaining issues for OHIF 3.12 RC2 OHIF-2461: [Bug] Toast message on redo of contours I have tested all 4 issues, plus Joe's navigation issue in combination with these. The only remaining bugs I've found are: |
| @@ -1,5 +1,6 @@ | |||
| { | |||
| "lockfileVersion": 1, | |||
| "configVersion": 0, | |||
There was a problem hiding this comment.
What version of bun are you running? Mine does not add this in to the lock file.
There was a problem hiding this comment.
1.3.8 is what I run. I don't think it is a big deal to have this added unless it causes problems in earlier versions. The bun.lock is not hte official lockfile, but is for faster dev testing.
| Object.entries(stats).forEach(([segmentIndex, segmentStats]) => { | ||
| const index = parseInt(segmentIndex); | ||
|
|
||
| if (!updatedSegmentation.segments[index]) { |
There was a problem hiding this comment.
Perhaps safest to do if (!updatedSegmentation?.segments?.[index]) {?
| */ | ||
| public removeSegment(segmentationId: string, segmentIndex: number): void { | ||
| cstSegmentation.removeSegment(segmentationId, segmentIndex); | ||
| public removeSegment( |
There was a problem hiding this comment.
So why doesn't SegmentationService.addSegment memo/record its actions? Is it worth mentioning somewhere in the code comments?
There was a problem hiding this comment.
Because I only implemented the delete operation as I was trying to minimize how many changes we have at this point. If we want, we can go ahead and fix all the remaining issues we've seen, but I specifically created a secondary issue to track things like the addSegment not adding the memo.
There was a problem hiding this comment.
Ok. Then maybe add a ToDo or something?
jbocce
left a comment
There was a problem hiding this comment.
Just some minor comments. See my testing notes #5775 (comment). I added @aimee-ferreira as a reviewer for testing purposes.
|
Added cornerstonejs/cornerstone3D#2599 to describe Joe's issue. |
aimee-ferreira
left a comment
There was a problem hiding this comment.
Verification has passed.
- Tested undo/redo with both label map and contours + mixture - all deleted segments are added back to both the image and panel successfully
- Tested when segment is hidden, delete and undo returns the segment in the hidden state, the segment can be re-displayed successfully
jbocce
left a comment
There was a problem hiding this comment.
Approving even though there are pending comments.
Context
The delete of segment index wasn't being remembered for the history.
This requires cornerstonejs/cornerstone3D#2593 to be linked to work.
Note: Undo of a delete restores the segment index, and redo of a delete removes it.
Changes & Results
Adds a history memo for delete/restore of the segment index.
Does not add support for remembering other changes on segment index like rename.
Testing
Test for segment index for labelmap and contour indexes
Create segmentation (not undo create segmentation is NOT supported)
Draw a segment
Create a new segment index
Draw a segment
Create a new segment index
Draw a segment
Delete segment #1, then #2 then #3
Undo 6 times to remove all segment indices on screen
Segment indexes should appear as the 3 deletes are undone, AND the segment data should reappear.
Segments drawn should disappear as remaining 3 deletes are done.
NOTE: Segment index add is not recorded, so undoing it does nothing
Redo 6 times
Segments drawn should reappear in first 3 redo
Segments drawn should disappear as redo of next 3 deletes. This should remove the segment index from the table.
Test the whole kittencaboodle with a contours after doing labelmaps.
Maybe test undo/redo of multi frames of segmentations - this should delete all the single segment index on all frames at once.
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment