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

Image / UniformGrid Padding #2201

Closed
njneeteson opened this issue Feb 12, 2022 · 1 comment · Fixed by #6051
Closed

Image / UniformGrid Padding #2201

njneeteson opened this issue Feb 12, 2022 · 1 comment · Fixed by #6051
Labels
feature-request Please add this cool feature!

Comments

@njneeteson
Copy link
Contributor

VTK has three image padding filters that all derive from the same image pad superclass:

https://vtk.org/doc/nightly/html/classvtkImageConstantPad.html
https://vtk.org/doc/nightly/html/classvtkImageMirrorPad.html
https://vtk.org/doc/nightly/html/classvtkImageWrapPad.html

The underlying VTK objects are pretty simple to work with. You set a constant value (if applicable), you get the "whole extents" of your input image and you set how much to pad by setting an output "whole extent" that is smaller/larger on the min/max for each dimension.

I propose to create a new method for uniform_grid datasets called "image_pad" which takes a "mode" parameter (to choose from "constant", "mirror", or "wrap"), a "value" parameter to set the pad value in constant mode, and a "pad size" parameter that could be either a single int, a length 3 tuple of ints, or a length 6 tuple of ints, to control how much to pad on the various sides of the image.

I don't work much with non-3D image data but I believe it could be 1D/2D compatible if you set the pad width to 0 in the unused dimension(s).

@njneeteson njneeteson added the feature-request Please add this cool feature! label Feb 12, 2022
@RichardScottOZ
Copy link
Contributor

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Please add this cool feature!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants