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

Adding spacing to extra_properties's possible arguments in regionprops #7404

Open
jules-vanaret opened this issue Apr 25, 2024 · 3 comments
Open

Comments

@jules-vanaret
Copy link

Description:

Hi, first thank you for this package, which I have used extensively this last decade.
Would it be possible to allow extra arguments to functions passed to regionprops' extra_properties ?
Right now, these functions can have one argument (the binary prop.image) or two (prop.image_intensity if available). But passing spacing would be extremely useful.
In the current implementation, the number of arguments is checked with argspec = inspect.getfullargspec(func); n_args = len(argspec.args), which could probably give informations about the name of the arguments.
If the user is expected to give specific names to their functions' arguments, e.g

def extra_property(image, spacing):
    ....

the arguments names should be parsable and the appropriate parameters could theoretically be passed.

@jni
Copy link
Member

jni commented Apr 26, 2024

👍 from me!

@jni
Copy link
Member

jni commented Apr 26, 2024

(We should always pass it as a kwarg.)

@stefanv
Copy link
Member

stefanv commented Apr 26, 2024

+1 for passing through kwargs. May need to introduce extra_prop_kwargs or similar, I haven't looked too closely. But happy to review a suggested implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants