Skip to content

Conversation

@arul-trenser
Copy link
Contributor

@arul-trenser arul-trenser commented Nov 4, 2025

Context

Changes & Results

This PR introduces axis-based image stretching using camera projection matrix manipulation.

Usage Example

Stretch along the X-axis:

const { aspectRatio }  = viewport.getCamera()
viewport.setCamera({
    acpectRatio: [2, aspectRatio[1]]
})

Stretch along the X-axis:

const { aspectRatio }  = viewport.getCamera()
viewport.setCamera({
    acpectRatio: [aspectRatio[0], 2]
})

Testing

Basic Stretching along X and Y axis:

axialBasedStretching.mp4

Segmentation Brush Tool Behavior in Stretched Viewport:

brushWorkingWithStretch.mp4

Circle ROI Tool Behavior in Stretched Viewport

circleAnnotationInStretch.mp4

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: Windows 11
  • "Node version: 22.19.0
  • "Browser: Chrome 141.0.7390.123

@arul-trenser arul-trenser marked this pull request as draft November 4, 2025 05:36
@arul-trenser arul-trenser marked this pull request as ready for review November 4, 2025 05:37
@arul-trenser arul-trenser marked this pull request as draft November 10, 2025 04:50
@arul-trenser arul-trenser marked this pull request as ready for review November 10, 2025 08:25
@arul-trenser
Copy link
Contributor Author

@sedghi when you have a moment, could you kindly review this PR at your earliest convenience?
Thanks!

@sedghi
Copy link
Member

sedghi commented Nov 10, 2025

how we can test it?

@arul-trenser
Copy link
Contributor Author

how we can test it?

@sedghi Added an example demonstrating the stretch behavior in axialBasedImageStretching
Also attached videos in the PR description

@sedghi
Copy link
Member

sedghi commented Nov 11, 2025

Are you aware of other viewers how they do this feature? i'm trying to evaluate the result at least to some other library or product that has this feature

@jmannau
Copy link
Contributor

jmannau commented Nov 12, 2025

Hi,
We work with systems that have different vertical/horizontal scales. For example, with Optical Coherence Topography (https://eyewiki.org/Optical_Coherence_Tomography) scans, it is common to display the image at 2:1 (vertical/horizontal) aspect ration. The scans often have 2x->4x vertical resolution compared to the horizontal scale. This allows better visualisation of pathology in the vertical/depth axis. We also allow users to change the aspect ratio between 1:1 and 4:1 to account for different vendor devices and scan types.
Below are 2 images that demonstrate this.

1:1 Aspect Ratio
Screenshot 2025-11-12 at 11 23 17 am

the same scan at 2:1 Aspect Ratio
Screenshot 2025-11-12 at 11 23 30 am

@sedghi
Copy link
Member

sedghi commented Nov 12, 2025

@jmannau lovely, would you be able to test this PR against the viewer you have?

@jmannau
Copy link
Contributor

jmannau commented Nov 12, 2025

Happy to. But we’re very short on time until the new year. I’ll see what we can do

@sen-trenser
Copy link

@jmannau We are aiming to include this change along with the CS3D dependent version of the upcoming OHIF 3.12 release, which is expected to be released later this year.
When you have the opportunity, could you please prioritize reviewing this MR and share any feedback? Your input would be greatly appreciated and help us to timely include it in the next release.

Thank you!

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.

4 participants