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

add method == true in base.py #130

Merged
6 changes: 5 additions & 1 deletion src/mrinufft/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,20 +334,24 @@ def compute_density(self, method=None):

Parameters
----------
method: str or callable or array or dict
method: str or callable or array or dict or bool
The method to use to compute the density compensation.
If a string, the method should be registered in the density registry.
If a callable, it should take the samples and the shape as input.
If a dict, it should have a key 'name', to determine which method to use.
other items will be used as kwargs.
If an array, it should be of shape (Nsamples,) and will be used as is.
If `True`, the method `pipe` is chosen as default estimation method,
if `backend` is `tensorflow`, `gpunufft` or `torchkbnufft`
"""
if isinstance(method, np.ndarray):
self.density = method
return None
if not method:
self.density = None
return None
if method is True:
Lenoush marked this conversation as resolved.
Show resolved Hide resolved
method = "pipe"

kwargs = {}
if isinstance(method, dict):
Expand Down
Loading