Skip to content

Commit

Permalink
Add support for normlize back
Browse files Browse the repository at this point in the history
  • Loading branch information
chaithyagr committed Dec 6, 2024
1 parent db9290b commit 5dc9da9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/mrinufft/operators/interfaces/finufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def pipe(
raise ValueError(
"finufft is not available, cannot estimate the density compensation"
)
original_shape = volume_shape
volume_shape = np.array([_next235beven(int(osf * i), 1) for i in volume_shape])
grid_op = MRIfinufft(
samples=kspace_loc,
Expand All @@ -216,9 +217,9 @@ def pipe(
grid_op.adj_op(density_comp.astype(grid_op.cpx_dtype))
).squeeze()
)
# if normalize:
# test_op = MRIfinufft(samples=kspace_loc, shape=original_shape, **kwargs)
# test_im = np.ones(original_shape, dtype=test_op.cpx_dtype)
# test_im_recon = test_op.adj_op(density_comp * test_op.op(test_im))
# density_comp /= np.mean(np.abs(test_im_recon))
if normalize:
test_op = MRIfinufft(samples=kspace_loc, shape=original_shape, **kwargs)
test_im = np.ones(original_shape, dtype=test_op.cpx_dtype)
test_im_recon = test_op.adj_op(density_comp * test_op.op(test_im))
density_comp /= np.mean(np.abs(test_im_recon))
return density_comp.squeeze()

0 comments on commit 5dc9da9

Please sign in to comment.