indices = []
for tmpo, tmpb in zip(offsets[:3], b):
indices.append()
slices=1
// for each dimension:
// Save index as translation + offset
// (if not flipped: offset before, else: offset after)
After Change
// TODO: add check that off.stop + b <= shape ; place image in location
// but throw warning that the affine may be wrong because the image is
// being put outside the FOV and is non recoverable.
indices = tuple(slice(off.start + dim_b, off.stop + dim_b)
for off, dim_b in zip(offsets[:3], b[:3]))
resampled_data[indices] = cropped_img.get_data()
else:
// Iterate over a set of 3D volumes, as the interpolation problem is