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

SmoothingRecursiveGaussianImageFilter with sharp discontinuity to background produces negative values in output #1425

gdevenyi opened this issue Nov 18, 2019 · 2 comments


Copy link

@gdevenyi gdevenyi commented Nov 18, 2019


SmoothingRecursiveGaussianImageFilter, as for example, implemented in ANTs' SmoothImage produces negative values for images with an object in the foreground surrounded by "0" or some very small value produces negative values after smoothing.

Steps to Reproduce

  1. Grab
  2. ImageMath 3 extracted.nii.gz m mni_icbm152_t1_tal_nlin_sym_09c_mask.nii mni_icbm152_t1_tal_nlin_sym_09c.nii
  3. SmoothImage 3 extracted.nii.gz 5 smooth.nii.gz 1 0
  4. Observe negative values:
    register smooth.nii.gz (set values under zero to be magenta)

Expected behavior

No negative values

Actual behavior

Negative values






Linux Ubuntu 14.04

@gdevenyi gdevenyi added the type:Bug label Nov 18, 2019

This comment has been minimized.

Copy link

@blowekamp blowekamp commented Nov 18, 2019

This may be expected for this implementation of the Gaussian. Here is the referenced paper:
Details of the implementation are described in the technical report: R. Deriche, "Recursively Implementing The Gaussian and Its Derivatives", INRIA, 1993,


This comment has been minimized.

Copy link
Contributor Author

@gdevenyi gdevenyi commented Nov 18, 2019

Thanks, I suspected the implementation details might be the cause.

Unfortunately, I think this may cause some issues with registration, since RecursiveGaussian was set as the default for optimizers as of 569a470 it can create features which aren't actually present.

At least a documentation update is warranted, beyond that I'm not sure what to do about it in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.