make non reg/meg movie

Hi,

i recently posted to free surfer list and was invited to post to this list as it seems the men may be the best way
for me to accomplish my task.

I want to make movies of a spatio-temporal evolution of a quantity across the cortical surface, not reg/meg.

i want to do it at the full resolution of the vertices on the surface, so about 300000+ for both hemispheres,there
would be 200-300 time points, so my input would
be a matrix 300000*300.

so looking a bit at the manual for men_make_movie ( i have used men before for reg solutions and displayed then on the cortical
surface succesfully ). would i use the --stcin option ? I would need to know the format for the stc files and skip,
--meas,--inv,--set would i need to fake these operators and input some version
of identity matrices ?

the threshold and such obvious parameters i remember

can ya help me skin this cat ?

g

If you're comfortable with Python, then PySurfer will allow you to directly
plot arbitrary data vectors on the cortical surface. Should be pretty easy
for your use case.

If you want to stick with Bash, then you can get the STC format spec from
looking at the mne-python code for `SourceEstimate.save`, which calls
`_write_stc`:

https://github.com/mne-tools/mne-python/blob/master/mne/source_estimate.py#L72

I don't think you need to supply the `--inv`, `--meas`, or `--set`
parameters to `mne_make_movie` if you provide `--stcin` (since those other
parameters are basically used to create a STC in memory). You'll probably
also need to specify the `--subject` and the output type (e.g. `--mov`).
The following command works on my system:

mne_make_movie --stcin test-fsaverage-lh.stc --mov test.mov --subject
fsaverage

Eric

Hi

seemed to follow the format of the python script and wrote a matlab file
fid=fopen('var-lh.stc','w');
tmin = 1;
tstep = 2;
load my_var
sz = size(my_var)
nvert=sz(1);
ntime = sz(2);
samp_rate = tstep*1000;

fwrite(fid,tmin,'float32');
fwrite(fid,samp_rate,'float32');
fwrite(fid,nvert,'uint32');
verts = [0:nvert-1];
fwrite(fid,verts,'uint32');
fwrite(fid,ntime,'uint32');
fwrite(fid,my_var,'float32');

?mne_make_movie --stcin var --mov test.mov

mne_make_movie seems to think t has no verticies

mne_make_movie version 1.34 compiled at Dec 21 2009 19:48:23
Create movies and tif, rgb, jpeg, png, or w files using a precomputed inverse operator decomposition

stc input file : var
mov file output : test.mov
width x height : 600 x 400
QuickTime quality : 80
The input stc file will be assumed to contain current expectation value data
Visualization surface : inflated
Process both hemispheres
Magnification factor : 1.00
Thresholding:
fthresh : 8.00
fmid : 15.00
fslope : 0.20
fmax : 20.00

Sorry for not mentioning this earlier, you can also use this MATLAB
function (which comes bundled with the MNE-C tools):

https://github.com/mne-tools/mne-matlab/blob/master/matlab/mne_write_stc_file.m

It looks like your code is quite close, I'm not sure why it isn't working.
Maybe try the above file. Also, make sure you write both -lh and -rh stc
files, and have the proper number of vertices for the subject of interest
(for each hemisphere).

Eric

Hi Eric, got mne_make_movie happy with my .stc files, i was not using the ieee file format specification and only feeding it the left hemi
now it writes the movies and they play in quicktime.

my data is in the range 0.0001-0.0045 and so i need to adjust the parameters
mne_make_movie --stcin var.stc --fthresh 0.0001 --fmax 0.01 --fmid 0.005 --mov test.mov or so
but mne_make_movie spits out fmax must be > fmin ??

mne_make_movie --stcin var.stc --fthresh 0.0001 --fmax 15.0 --fmid 1.0 --mov test.mov
also gives this error

but
mne_make_movie --stcin var.stc --fthresh 0.0001 --fmax 16.0 --fmid 1.0 --mov test.mov
runs

small fly in the ointment ?
thanks
greg

solved all of those problems and getting a movie now, but the scale is waaaaay off. seems to me now i remember
mne assumed the data was in pico volts or some other really small numbers, but the actuall data is short or long integers or something
so internally mne applies some huge scaling.

i rescalled my data from a variance range [0,1] my multiplying by 10,000 thinking that would allow me to use
the integer fmin, fthresh, etc. but now the cortex is solid yellow , i.e. everything abouve the max.

and the little movie says

1.0 .. 50 ..150 * 1e-10

so what internal scale do i need to account for, i.e. what scale should i apply to data in
a variance range to get this to come out good?

cheers,

greg

I haven't had to deal with this specific problem -- I would apply
trial-and-error with a small number of time samples to converge on the
proper scale factor.

Eric

Greg,

When you use --spm option the --fmin, --fmid, and --fmax values are used directly without any multiplier. Use --fmax instead of --fslope, which is provided for backwards compatibility only. - Matti

i think it's assuming i have p values and needs an integer or something ?
mne_make_movie --stcin var.stc --spm --fmin 0.0001 --fmax 0.0045 --fmid 0.001 --view med --mov spm_med.mov
gives fmax must be > fmid

im getting decent movies for my purpose using
mne_make_movie --stcin var.stc --fthresh 100000.0 --fmax 50000000.0 --fmid 5000000.0 --view med --mov med.mov
but have not gotten the scale to be the same as in tksurfer, there i get the low variances, below 0.001 to be dark
with what im using i get shades of red and yellow.

is it doing things at the full vertex resolution or decemating the surface, looks a little pixelated,also is
it doing any spatial smoothing, my data is un smoothed

my data is a variance between [0.0001,0.0045] at each vertex and in any particular timepoint.

cheers

Greg

when i said it's maybe expecting p values, i meant -log10(p) the freesurfer way ?
g

The color scale is made in the FreeSurfer way but there is no particular association with p values. With the mne_make_movie just takes the data from stc files as they are. Without the --spm option is missing, the scale values are multiplied by 10^(-10), with it not. - Matti