medpy icon indicating copy to clipboard operation
medpy copied to clipboard

Allow Passing in Function to Anisotropic Diffusion Filtering

Open cancan101 opened this issue 7 years ago • 1 comments

Right now the Anisotropic Diffusion Filtering takes in an option {1,2,3}, which limits the set of functions that can be used. I suggest allowing the user to pass in a function.

the signature should be: f(delta, spacing, dim_idx).

This will allow:

  1. different conductance param by dimension
  2. other scaling forms for the existing 3 functions
  3. new functions (eg huber)

cancan101 avatar Nov 14 '17 18:11 cancan101

Yes... I must confess, I fear a little increasing the complexity of the functions. Out of the box, they should work with as many default parameters as possible. Having to write (or at leas pass) a complete function might confuse some of the less experienced users.

Maybe an additional parameter, that allows to optionally pass a function?

def anisotropic_diffusion(..., equation=None):
   """
   Parameters
   ----------
   equation : function
      Can be used to supply a personal condgradient function of signature f(delta, spacing, dim_idx).
      The `option` parameter will be ignored if this parameter is set.
   """

What do you think?

loli avatar Dec 11 '17 19:12 loli

Closed due to inactivity.

loli avatar Dec 15 '23 17:12 loli