- MNE version: MNE1.0.0
- operating system: CentOS release 6.5 (Final)
Hi! guys,
I want to extract data from stc time courses based on an atlas, like Wang(2015) atlas https://academic.oup.com/cercor/article/25/10/3911/393661?login=true. Here is what I did:
- I get the files
lh.mgz
andrh.mgz
contain the vertex overlays of the Wang(2015) atlas on the fsaverage surface; - get the labels from this two mgz files:
export roiname_array=(1 "V1v" "V1d" "V2v" "V2d" "V3v" "V3d" "hV4" "VO1" "VO2" "PHC1" "PHC2" \
"TO2" "TO1" "LO2" "LO1" "V3B" "V3A" "IPS0" "IPS1" "IPS2" "IPS3" "IPS4" \
"IPS5" "SPL1" "FEF")
export subjid=sub-fsaverage
for i in {1..25}
do
mri_cor2label --i ${data_dir}/surf/lh.wang2015_atlas.mgz --id ${i} --l ${label_dir}/wang2015atlas.${roiname_array[${i}]}.lh.label --surf ${subjid} lh inflated
mri_cor2label --i ${data_dir}/surf/rh.wang2015_atlas.mgz --id ${i} --l ${label_dir}wang2015atlas.${roiname_array[${i}]}.rh.label --surf ${subjid} rh inflated
done
- I tried to get stc constrained in the labels I got in step 2) of each subject :
rois_name =['V1v', 'V1d', 'V2v', 'V2d', 'V3v', 'V3d', 'hV4', 'VO1', 'VO2', 'PHC1', 'PHC2',
'TO2', 'TO1', 'LO2', 'LO1', 'V3B', 'V3A', 'IPS0', 'IPS1', 'IPS2', 'IPS3', 'IPS4',
'IPS5', 'SPL1', 'FEF']
fsaverage_dir = '/brain/guixue/zhouyu/proj01/mri/fmriprep/derivatives/freesurfer/sub-fsaverage/'
hemi = ['lh', 'rh']
snr = 3.
lambda2 = 1. / snr ** 2
for r in rois_name:
for h in hemi:
stc, stc_data, residual = {}, {}, {}
# project all evoked data to this roi
for evo_key, evo_val in evoked.items():
fname_label = fsaverage_dir + 'label/wang2015/wang2015atlas.{}.{}.label'.format(r, h)
label = read_label(fname_label)
stc[evo_key], residual[evo_key] = apply_inverse(evo_val, inverse_operator, lambda2=lambda2, method='MNE', pick_ori='normal', prepared=False, label=label, method_params=None, return_residual=True, verbose=None)
stc_data[evo_key] = stc[evo_key].data
stc_data_keys = np.asarray(list(stc_data.keys()))
stc_data_vals = np.asarray(list(stc_data.values()))
I think step3) above might be wrong cause I cannot apply the labels obtained from fsaverage surface to each subject directly. Maybe I should morph the subject stc to fsaverage space using mne.compute_source_morph
mne.compute_source_morph — MNE 1.1.dev0 documentation. In this case, the label obtained from fsaverage can be applied to the subject considering I morph the subjects’s source estimate to fsaverage space. Did this sound right?