Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add example of OrientImageFilter #4963

Merged

Conversation

blowekamp
Copy link
Member

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:Examples Demonstration of the use of classes labels Nov 19, 2024
@blowekamp
Copy link
Member Author

blowekamp commented Nov 20, 2024

Sample output:

$ bin/OrientImageFilter ExternalData/Testing/Data/Input/HeadMRVolume.mha test.mha RAS
Input image direction: 
  Matrix (3x3)
    1 0 0 
    0 1 0 
    0 0 1 
The input image has the following orientation: 
	right-to-left anterior-to-posterior inferior-to-superior
The re-orienting to approximately the desired orientation: 
	left-to-right posterior-to-anterior inferior-to-superior

Do we have any existing testing data that is 3D with an interesting matrix?

Copy link
Member

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

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

@blowekamp I am approving as is because this represents a sufficiently beneficial example.

I agree that it would be better to have a test case with an interesting matrix.

Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

Good even as-is.

orienter->SetDesiredCoordinateOrientation(desiredCoordinateOrientation);


// Create and set up a writer
Copy link
Member

Choose a reason for hiding this comment

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

We could simplify this by using itk::WriteImage(orienter->GetOutput());


// Create and set up an OrientImageFilter
using OrientImageFilterType = itk::OrientImageFilter<ImageType, ImageType>;
OrientImageFilterType::Pointer orienter = OrientImageFilterType::New();
Copy link
Contributor

Choose a reason for hiding this comment

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

@hjmjohnson hjmjohnson merged commit d3a8a1f into InsightSoftwareConsortium:master Nov 20, 2024
17 checks passed
@thewtex
Copy link
Member

thewtex commented Nov 22, 2024

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Examples Demonstration of the use of classes type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants