We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1544a55 commit b6e917eCopy full SHA for b6e917e
dmriprep/utils/images.py
@@ -73,12 +73,7 @@ def average_images(images, out_path=None):
73
74
def quick_load_images(image_list, dtype=np.float32):
75
"""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
+ return nb.concat_images([nb.load(fname) for fname in image_list]).get_fdata(dtype=dtype)
82
83
84
def match_transforms(dwi_files, transforms, b0_indices):
0 commit comments