Skip to content

Commit

Permalink
adding density normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Asma TANABENE committed Dec 5, 2024
1 parent 2d58e02 commit 7a6f4a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mrinufft/operators/interfaces/cufinufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ def pipe(
raise ValueError(
"gpuNUFFT 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 = MRICufiNUFFT(
samples=kspace_loc,
Expand All @@ -922,4 +923,9 @@ def pipe(
grid_op.adj_op(density_comp.astype(grid_op.cpx_dtype))
).squeeze()
)
if normalize:
test_op = MRICufiNUFFT(samples=kspace_loc, shape=original_shape, **kwargs)
test_im = cp.ones(original_shape, dtype=test_op.cpx_dtype)
test_im_recon = test_op.adj_op(density_comp * test_op.op(test_im))
density_comp /= cp.mean(cp.abs(test_im_recon))
return density_comp.squeeze()

1 comment on commit 7a6f4a0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifacts

Please sign in to comment.