Skip to content

Commit bbba13c

Browse files
committed
fix: recompute coordinates per volume in serial resampling
1 parent a7ad08c commit bbba13c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nitransforms/resampling.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ async def _apply_serial(
110110
for t in range(n_resamplings):
111111
xfm_t = transform if (n_resamplings == 1 or transform.ndim < 4) else transform[t]
112112

113-
targets_t = targets
114-
if targets_t is None:
115-
targets_t = ImageGrid(spatialimage).index( # data should be an image
113+
targets_t = (
114+
ImageGrid(spatialimage).index(
116115
_as_homogeneous(xfm_t.map(ref_ndcoords), dim=ref_ndim)
117116
)
117+
if targets is None
118+
else targets
119+
)
118120

119121
data_t = (
120122
data

0 commit comments

Comments
 (0)