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 pad_image filter generating closed surfaces #6051

Merged
merged 11 commits into from May 11, 2024

Conversation

user27182
Copy link
Contributor

@user27182 user27182 commented May 7, 2024

Add new ImageDataFilter pad_image.

Partly Fully resolves #2201

Image padding will be used by #5968 to enable generating "closed" surfaces at the edges of images (otherwise regions at the edges are left open by vtkSurfaceNets).

For now the filter only implements constant padding. I'll try adding wrap and mirror but may not if those filters don't behave nicely with the current implementation. The wrap and mirror options have been added.

@tkoyama010 tkoyama010 changed the title Add pad_image filter Add pad_image filter generating closed surfaces May 7, 2024
@user27182
Copy link
Contributor Author

Additional info: This filter simply adds padding to the image. It can used for many applications where padding is needed.

One such use, which is a bit of a workaround in this case, is to enable generating closed surfaces as part of #5968. There, the image padding is implicit, i.e. setting image_boundaries=True will cause the input to be padded before generating the surface. It's a workaround because it's arguable this kind of functionality should be builit into the filter. See https://gitlab.kitware.com/vtk/vtk/-/issues/19170

@user27182 user27182 marked this pull request as draft May 7, 2024 21:02
@pyvista-bot pyvista-bot added the enhancement Changes that enhance the library label May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.97%. Comparing base (06e7a8f) to head (0458bdd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6051      +/-   ##
==========================================
+ Coverage   96.96%   96.97%   +0.01%     
==========================================
  Files         141      141              
  Lines       24532    24624      +92     
==========================================
+ Hits        23788    23880      +92     
  Misses        744      744              

@user27182
Copy link
Contributor Author

@pyvista-bot preview

@user27182 user27182 marked this pull request as ready for review May 8, 2024 07:49
@pyvista-bot
Copy link
Contributor

@user27182
Copy link
Contributor Author

@pyvista-bot preview

@pyvista-bot
Copy link
Contributor

user27182 added a commit to user27182/pyvista that referenced this pull request May 9, 2024
@tkoyama010
Copy link
Member

@pyvista-bot preview

@pyvista-bot
Copy link
Contributor

@tkoyama010
Copy link
Member

Interesting filter. Please give me some time so I can understand the filter specs and test code.
image

Copy link
Member

@tkoyama010 tkoyama010 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@tkoyama010 tkoyama010 enabled auto-merge (squash) May 11, 2024 03:26
@tkoyama010 tkoyama010 merged commit 2552dc5 into pyvista:main May 11, 2024
27 checks passed
@user27182 user27182 deleted the feat/pad_image branch May 11, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Changes that enhance the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image / UniformGrid Padding
3 participants