Now I visualze my data through:
stc_suf = apply_inverse(evoked, inv, lambda2, inv_method)
stc_suf.plot(surface='pial', subjects_dir=subjects_dir, hemi='both', initial_time=initial_time)
mlab.show()
I want to save this 3d- time series into a single .vtk file, however there are two difficulties can not be solved:
1: I can’t seperate ‘stc_suf’ into x,y,z axis, but it is needed in vtk_data.SetDimensions(data.shape)
2: How can I switch my data after ‘apply_inverse’ to the shape witch is supported for this (to the variable ‘data shape’ which can be load by vtk_data.SetDimensions, which needs 3 demention):
vtk_data = vtkStructuredPoints()
vtk_data.SetDimensions(data.shape)
vtk_data.SetOrigin(x.min(), y.min(), z.min())
vtk_data.SetSpacing((x[1]-x[0]), (y[1]-y[0]), (z[1]-z[0]))
vtk_data.GetPointData().SetScalars(data.ravel(order='F'))
time_series = np.sin(np.linspace(0, 2*np.pi, 10))
vtk_data.GetFieldData().AddArray(time_series)
Thanks so much for the anwsering!