Skip to content

Commit

Permalink
fix: init_nufft with coil
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Feb 25, 2025
1 parent 6d9f92c commit 7c6711c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/snake/core/engine/nufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,25 @@ def _job_trajectories(
def _init_model_nufft(
samples: NDArray,
sim_conf: SimConfig,
smaps: NDArray,
backend: str,
slice_2d: bool = False,
) -> FourierOperatorBase:
"""Initialize the nufft operator."""
n_coils = len(smaps) if smaps is not None else 1
kwargs = {}
if slice_2d and "stacked" in backend:
raise ValueError("Stacked NUFFT does not support 2D slice")

if "stacked" in backend:
kwargs["z_index"] = "auto"

smaps_ = smaps
shape_ = sim_conf.shape
if slice_2d:
shape_ = sim_conf.shape[:-1]
if smaps is not None:
smaps_ = np.ascontiguousarray(
smaps[..., 0]
) # will be updated in the loop

nufft = get_operator(backend)(
samples, # will be updated in the loop
shape=shape_,
n_coils=n_coils,
smaps=smaps_,
n_coils=sim_conf.hardware.n_coils,
smaps=None,
density=False,
squeeze_dims=False,
**kwargs,
Expand All @@ -106,7 +98,6 @@ def _job_model_T2s(
nufft = NufftAcquisitionEngine._init_model_nufft(
trajectories[0],
sim_conf,
None,
backend=nufft_backend,
slice_2d=slice_2d,
)
Expand Down Expand Up @@ -155,7 +146,6 @@ def _job_model_simple(
nufft = NufftAcquisitionEngine._init_model_nufft(
trajectories[0],
sim_conf,
phantom.smaps,
backend=nufft_backend,
slice_2d=slice_2d,
)
Expand Down

0 comments on commit 7c6711c

Please sign in to comment.