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

ensure correct behaviour of filters when set manually #61

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

JonasHell
Copy link
Contributor

@JonasHell JonasHell commented Jun 8, 2022

When set manually via filter_config, there have been some issues with filters of type structureTensorEigenvalues since they require the additional argument outerScale.

raw = np.random.rand(32, 256, 256)
filters_and_sigmas = _get_filters(3, [('hessianOfGaussianEigenvalues', (3., 1.25*3, 1.25*3))])
features = _apply_filters(raw, filters_and_sigmas)
print(features.shape)

--> works fine

filters_and_sigmas = _get_filters(3, [('structureTensorEigenvalues', (3., 1.25*3, 1.25*3))])
features = _apply_filters(raw, filters_and_sigmas)
print(features.shape)

--> throws the following error

---------------------------------------------------------------------------
File ~/torch-em/torch_em/shallow2deep/prepare_shallow2deep.py:222, in _apply_filters(raw, filters_and_sigmas)
    217     func = getattr(filter_impl, filter_) if isinstance(filter_, str) else filter_
--> 218 response = func(raw, sigma)
    219 if response.ndim > raw.ndim:
    220     for c in range(response.shape[-1]):

TypeError: structureTensorEigenvalues() missing 1 required positional argument: 'outerScale'

--> fixed now

@constantinpape constantinpape merged commit d731122 into constantinpape:main Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants