Skip to content

Commit b6e917e

Browse files
dPysoesteban
andauthored
Update dmriprep/utils/images.py
Co-Authored-By: Oscar Esteban <[email protected]>
1 parent 1544a55 commit b6e917e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

dmriprep/utils/images.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,7 @@ def average_images(images, out_path=None):
7373

7474
def quick_load_images(image_list, dtype=np.float32):
7575
"""Load 3D volumes from a list of file paths into a 4D array."""
76-
example_img = nb.load(image_list[0])
77-
num_images = len(image_list)
78-
output_matrix = np.zeros(tuple(example_img.shape) + (num_images,), dtype=dtype)
79-
for image_num, image_path in enumerate(image_list):
80-
output_matrix[..., image_num] = nb.load(image_path).get_fdata(dtype=dtype)
81-
return output_matrix
76+
return nb.concat_images([nb.load(fname) for fname in image_list]).get_fdata(dtype=dtype)
8277

8378

8479
def match_transforms(dwi_files, transforms, b0_indices):

0 commit comments

Comments
 (0)