File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11
11
12
12
from .orientations import (io_orientation , orientation_affine , flip_axis ,
13
13
apply_orientation , OrientationError )
14
+ from .loadsave import load
14
15
15
16
16
17
def squeeze_image (img ):
@@ -92,7 +93,7 @@ def concat_images(images, check_affines=True):
92
93
Parameters
93
94
----------
94
95
images : sequence
95
- sequence of ``SpatialImage``\s
96
+ sequence of paths to be loaded as ``SpatialImage``\s
96
97
check_affines : {True, False}, optional
97
98
If True, then check that all the affines for `images` are nearly
98
99
the same, raising a ``ValueError`` otherwise. Default is True
@@ -104,13 +105,14 @@ def concat_images(images, check_affines=True):
104
105
dimension
105
106
'''
106
107
n_imgs = len (images )
107
- img0 = images [0 ]
108
+ img0 = load ( images [0 ])
108
109
i0shape = img0 .shape
109
110
affine = img0 .get_affine ()
110
111
header = img0 .get_header ()
111
112
out_shape = (n_imgs , ) + i0shape
112
113
out_data = np .empty (out_shape )
113
114
for i , img in enumerate (images ):
115
+ img = load (img )
114
116
if check_affines :
115
117
if not np .all (img .get_affine () == affine ):
116
118
raise ValueError ('Affines do not match' )
You can’t perform that action at this time.
0 commit comments