@@ -158,12 +158,14 @@ def rsa_stcs(stcs, dsm_model, src, spatial_radius=0.04, temporal_radius=0.1,
158158 % (n_items , len (np .unique (y ))))
159159
160160 _check_stcs_compatibility (stcs , src )
161- dist = _get_distance_matrix (src , dist_lim = spatial_radius , n_jobs = n_jobs )
162-
161+ if spatial_radius is not None :
162+ dist = _get_distance_matrix (src , dist_lim = spatial_radius ,
163+ n_jobs = n_jobs )
164+ else :
165+ dist = None
163166 if temporal_radius is not None :
164167 # Convert the temporal radius to samples
165168 temporal_radius = int (temporal_radius // stcs [0 ].tstep )
166-
167169 if temporal_radius < 1 :
168170 raise ValueError ('Temporal radius is less than one sample.' )
169171
@@ -190,6 +192,7 @@ def rsa_stcs(stcs, dsm_model, src, spatial_radius=0.04, temporal_radius=0.1,
190192 vertices = [np .array ([1 ])]
191193 else :
192194 vertices = [np .array ([1 ]), np .array ([])]
195+ data = data [np .newaxis , ...]
193196 tmin = _construct_tmin (stcs [0 ].times , samples_from , samples_to ,
194197 temporal_radius )
195198 tstep = stcs [0 ].tstep
@@ -288,7 +291,11 @@ def dsm_stcs(stcs, src, spatial_radius=0.04, temporal_radius=0.1,
288291 A DSM for each searchlight patch.
289292 """
290293 _check_stcs_compatibility (stcs , src )
291- dist = _get_distance_matrix (src , dist_lim = spatial_radius , n_jobs = n_jobs )
294+ if spatial_radius is not None :
295+ dist = _get_distance_matrix (src , dist_lim = spatial_radius ,
296+ n_jobs = n_jobs )
297+ else :
298+ dist = None
292299
293300 # Convert the temporal radius to samples
294301 if temporal_radius is not None :
0 commit comments