Skip to content

ENH: Add method for flipping image and orientations.#29

Merged
aylward merged 5 commits intomainfrom
flip_images
Feb 19, 2026
Merged

ENH: Add method for flipping image and orientations.#29
aylward merged 5 commits intomainfrom
flip_images

Conversation

@aylward
Copy link
Copy Markdown
Collaborator

@aylward aylward commented Feb 19, 2026

ITK images have orientation information, but VTK images do not. So, when images are passed to VTK and VTK returns objects (polydata), that polydata will have been created from the image without consideration of the image's orientation, so the polydata will not align with the original (oriented) image.

This function allows an image to be flipped into a neutral (identity) orientation before passing to VTK.

Copilot AI review requested due to automatic review settings February 19, 2026 14:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a generalized image/mask flipping utility to help normalize ITK images into an identity (VTK-friendly) orientation before downstream processing.

Changes:

  • Replaces the prior identity-direction flip method with a more configurable flip_image(...) API (per-axis flips + optional identity-direction reset).
  • Adds support for flipping an optional mask in lockstep with the image.
  • Optionally resets the output direction matrix to identity after flipping (intended for ITK↔VTK interoperability).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py Outdated
Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py
Copilot AI review requested due to automatic review settings February 19, 2026 15:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py Outdated
Comment thread tests/test_image_tools.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 19, 2026 15:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/physiomotion4d/image_tools.py
Comment thread src/physiomotion4d/image_tools.py
Comment thread tests/test_image_tools.py
@aylward aylward merged commit 1a6db7b into main Feb 19, 2026
11 checks passed
@aylward aylward deleted the flip_images branch February 19, 2026 16:05
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.

2 participants