An image filter for anisotropic diffusion smoothing (i.e., edge preserving). The options are


In [1]:
medpy_anisotropic_diffusion.py -h


usage: medpy_anisotropic_diffusion.py [-h] [-i ITERATIONS] [-k KAPPA]
                                      [-g GAMMA] [-v] [-d] [-f]
                                      input output

Executes gradient anisotropic diffusion filter over an image. This smoothing
algorithm is edges preserving. Note that the images voxel-spacing will be
taken into account. Copyright (C) 2013 Oskar Maier This program comes with
ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to
redistribute it under certain conditions; see the LICENSE file or
<http://www.gnu.org/licenses/> for details.

positional arguments:
  input                 Source volume.
  output                Target volume.

optional arguments:
  -h, --help            show this help message and exit
  -i ITERATIONS, --iterations ITERATIONS
                        The number of smoothing iterations. Strong parameter.
  -k KAPPA, --kappa KAPPA
                        The algorithms kappa parameter. The higher the more
                        edges are smoothed over.
  -g GAMMA, --gamma GAMMA
                        The algorithms gamma parameter. The higher, the
                        stronger the plateaus between edges are smeared.
  -v                    Display more information.
  -d                    Display debug information.
  -f                    Silently override existing output images.

Let's pick some unrealisitc high values and run the script on our test image.


In [4]:
medpy_anisotropic_diffusion.py -i100 -f -k100 -g100 resources/flair.nii.gz output/anisotropic_diffusion.nii.gz

The original image:

The processed image


In [ ]: