@@ -110,7 +110,7 @@ def spatial_resample(
110110 )
111111 if affine_unchanged or lazy_evaluation :
112112 # no significant change or lazy change, return original image
113- img = convert_to_tensor (img , track_meta = get_track_meta (), dtype = torch . float32 ) # type: ignore
113+ img = convert_to_tensor (img , track_meta = get_track_meta ()) # type: ignore
114114 return img .copy_meta_from (meta_info ) if isinstance (img , MetaTensor ) else img # type: ignore
115115 im_size = torch .tensor (img .shape ).tolist ()
116116 chns , in_sp_size , additional_dims = im_size [0 ], im_size [1 : spatial_rank + 1 ], im_size [spatial_rank + 1 :]
@@ -138,8 +138,8 @@ def spatial_resample(
138138 if additional_dims :
139139 full_shape = (chns , * spatial_size , * additional_dims )
140140 img = img .reshape (full_shape )
141- img = convert_to_tensor (img , track_meta = get_track_meta (), dtype = torch .float32 )
142- return img .copy_meta_from (meta_info ) if isinstance (img , MetaTensor ) else img # type: ignore
141+ out = convert_to_tensor (img , track_meta = get_track_meta (), dtype = torch .float32 )
142+ return out .copy_meta_from (meta_info ) if isinstance (out , MetaTensor ) else out # type: ignore
143143
144144
145145def orientation (img , original_affine , spatial_ornt , transform_info ):
0 commit comments