@@ -191,16 +191,26 @@ def test_meg_inverse():
191
191
stc = io .read_stc (stc_fname )
192
192
data = stc ['data' ]
193
193
vertices = stc ['vertices' ]
194
- time = 1e3 * np .linspace (stc ['tmin' ],
195
- stc ['tmin' ] + data .shape [1 ] * stc ['tstep' ],
196
- data .shape [1 ])
194
+ time = np .linspace (stc ['tmin' ], stc ['tmin' ] + data .shape [1 ] * stc ['tstep' ],
195
+ data .shape [1 ])
197
196
colormap = 'hot'
198
- time_label = 'time=%0.2f ms'
197
+
198
+ def time_label (t ):
199
+ return 'time=%0.2f ms' % (1e3 * t )
200
+
199
201
brain .add_data (data , colormap = colormap , vertices = vertices ,
200
202
smoothing_steps = 10 , time = time , time_label = time_label )
201
- brain .set_data_time_index (2 )
202
203
brain .scale_data_colormap (fmin = 13 , fmid = 18 , fmax = 22 , transparent = True )
204
+ assert_equal (brain .data_dict ['lh' ]['time_idx' ], 0 )
205
+
206
+ brain .set_time (.1 )
207
+ assert_equal (brain .data_dict ['lh' ]['time_idx' ], 2 )
203
208
# viewer = TimeViewer(brain)
209
+
210
+ brain .add_data (data , colormap = colormap , vertices = vertices ,
211
+ smoothing_steps = 10 , time = time , time_label = time_label ,
212
+ initial_time = .09 , remove_existing = True )
213
+ assert_equal (brain .data_dict ['lh' ]['time_idx' ], 1 )
204
214
brain .close ()
205
215
206
216
0 commit comments