Skip to content

Commit

Permalink
add case method == true
Browse files Browse the repository at this point in the history
  • Loading branch information
Lena OUDJMAN committed Jun 12, 2024
1 parent dc709aa commit 5044267
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/mrinufft/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,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 a bool, it will enable or disable the density compensation.
"""
if isinstance(method, np.ndarray):
self.density = method
return None
if not method:
self.density = None
return None
if method is True and hasattr(self, "pipe"):
method = "pipe"

if isinstance(method, np.ndarray):
self.density = method
return None

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

0 comments on commit 5044267

Please sign in to comment.