Skip to content

Commit

Permalink
fix: set the computed density using the setter.
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Feb 10, 2025
1 parent 6bf2bdf commit 56601e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/mrinufft/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def compute_density(self, method=None):
shape,
**kwargs,
)
self._density = method(self.samples, self.shape, **kwargs)
self.density = method(self.samples, self.shape, **kwargs)

def get_lipschitz_cst(self, max_iter=10, **kwargs):
"""Return the Lipschitz constant of the operator.
Expand Down
11 changes: 6 additions & 5 deletions src/mrinufft/operators/interfaces/gpunufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,11 @@ def density(self, density):
The density for the Fourier Operator.
"""
self._density = density
self.raw_op.set_pts(
self._samples,
density=density,
)
if hasattr(self, "raw_op"): # edge case for init
self.raw_op.set_pts(
self._samples,
density=density,
)

@classmethod
def pipe(
Expand Down Expand Up @@ -593,7 +594,7 @@ def pipe(
"""
if GPUNUFFT_AVAILABLE is False:
raise ValueError(
"gpuNUFFT is not available, cannot " "estimate the density compensation"
"gpuNUFFT is not available, cannot estimate the density compensation"
)
original_shape = volume_shape
volume_shape = (np.array(volume_shape) * osf).astype(int)
Expand Down

0 comments on commit 56601e6

Please sign in to comment.