Skip to content

fix: Livewire interpolation is weird#2541

Merged
wayfarer3130 merged 4 commits intomainfrom
fix/livewire-interpolation
Jan 14, 2026
Merged

fix: Livewire interpolation is weird#2541
wayfarer3130 merged 4 commits intomainfrom
fix/livewire-interpolation

Conversation

@wayfarer3130
Copy link
Copy Markdown
Collaborator

Context

Fixes [#5641]

Livewire interpolation currently interpolates the contour closure, which is a straight line originally. That causes display issues.

Changes & Results

Don't interpolate closure

Testing

Open segmentation mode on a volume
Active livewire with interpolation on (see 5641)
Draw contours around the outside of a body or other hard defined object separated by several slices
View the intermediate slices - the contour closure should be a straight line if the original contour was closed by a straight line and livewire if it was clsoed by clicking on the starting point.

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

@wayfarer3130 wayfarer3130 requested a review from jbocce January 7, 2026 17:05
Copy link
Copy Markdown
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wayfarer3130 the code changes look fine. However, I tried testing it locally both with the contour interpolation example (i.e. bun run example interpolationcontoursegmentation) and locally linking OHIF to your branch. I still see the weird behaviour.

If and when you decide to make further changes, please consider adding @aimee-ferreira and at the very least she can test the live example.

ScreenHunter.Jan.07.13.29.mp4

@wayfarer3130
Copy link
Copy Markdown
Collaborator Author

@jbocce - my test cases were a little too consistent - when I vary the number of control points more it seems that it doesn't always interpolate between the control points correctly to lave a straight line across the end. The current change improves things, but I will need to think if there is a solution generally or not.

@wayfarer3130 wayfarer3130 requested a review from jbocce January 14, 2026 18:31
Copy link
Copy Markdown
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look fine. I did a bit of testing and it seems good too. Great job. Please consider adding @aimee-ferreira for more thorough testing.

@wayfarer3130 wayfarer3130 merged commit 7c5079d into main Jan 14, 2026
9 of 10 checks passed
@wayfarer3130 wayfarer3130 deleted the fix/livewire-interpolation branch January 14, 2026 21:07
@wayfarer3130
Copy link
Copy Markdown
Collaborator Author

@aimee-ferreira - I just merged this PR into CS3D. The test class to use is interpolationcontoursegmentation.
You need to use the livewire interpolation tool. If you close by double click, with the tool showing a straight line (isUShapedOpenContour 'lineSegment'), then you need to match that with another contour several images away ALSO with a straight line segment.
If you close by clicking on the first point, then you need to match with another contour also clicking on the same point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants