Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Restore resampling to T1w target #3116

Merged
merged 19 commits into from
Oct 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
RF: Move coordinate copies into threads to delay allocation
  • Loading branch information
effigies committed Oct 23, 2023
commit 333a8fea73bd2a904d2cbe7444efdda84eb9480f
5 changes: 4 additions & 1 deletion fmriprep/interfaces/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ def resample_vol(
coordinates = nb.affines.apply_affine(
hmc_xfm, coordinates.reshape(coords_shape[0], -1).T
).T.reshape(coords_shape)
else:
# Copy coordinates to avoid interfering with other calls
coordinates = coordinates.copy()

vsm = fmap_hz * pe_info[1]
coordinates[pe_info[0], ...] += vsm
Expand Down Expand Up @@ -377,7 +380,7 @@ async def resample_series_async(
partial(
resample_vol,
data=volume,
coordinates=coordinates.copy(),
coordinates=coordinates,
pe_info=pe_info[volid],
hmc_xfm=hmc_xfms[volid] if hmc_xfms else None,
fmap_hz=fmap_hz,
Expand Down