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

Add I and J slicing to vtkImageMarchingSquares filter #2905

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

ty-ler
Copy link
Contributor

@ty-ler ty-ler commented Aug 28, 2023

Context

The vtkImageMarchingSquares filter currently only supports K slicing.

I and J slicing has been discussed before, but has not been implemented yet:
Apply Marching Squares to ImageSlices

Results

These changes enable using I and J slicing modes so it is now possible to run the vtkImageMarchingSquares filter in all IJK directions.

Changes

The vtkImageMarchingSquares class has been changed to dynamically select IJK/XYZ indices based on the provided slicingMode. This enables slicing in all IJK directions.

Added new method:

(set/get)SlicingMode - Set/Get the slicing mode (IJK) which determines the direction to slice. By
default the slicingMode = 2.

Documentation of the vtkImageMarchingSquares class has been updated to include this new method and to correct sliceNumber to the actual model name slice. The documentation also no longer implies that K-slicing is the only slicing mode available.

  • Documentation and TypeScript definitions were updated to match those changes

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js: 28.7.0
    • OS: macOS 13.1
    • Browser: Chrome 116.0.5845.96

@floryst
Copy link
Collaborator

floryst commented Aug 28, 2023

LGTM at a high level. I haven't verified functionality yet; have you tried integrating slicingMode into the ImageMarchingSquares example?

@ty-ler
Copy link
Contributor Author

ty-ler commented Aug 28, 2023

I have not updated the example, but will do so now so that it's easier to verify functionality.

@floryst floryst requested a review from finetjul August 28, 2023 19:52
Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

LGTM

Sources/Filters/General/ImageMarchingSquares/index.js Outdated Show resolved Hide resolved
…gSquares filter

docs(vtkimagemarchingsquares): "sliceNumber" should be "slice", document new IJK "slicingMode"

refactor(vtkimagemarchingsquares): prettier formatting run on vtkImageMarchingSquares

refactor(vtkimagemarchingsquares): update vtkImageMarchingSquares example with slicing mode dropdown

perf(vtkimagemarchingsquares): only instantiate ijk array once before for loops, and reuse

docs(vtkimagemarchingsquares): document method parameters
@floryst floryst added this pull request to the merge queue Sep 5, 2023
Merged via the queue into Kitware:master with commit 0e8b095 Sep 5, 2023
4 checks passed
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

🎉 This PR is included in version 28.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Automated label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants