Re: [HCP-Users] MEG processing pipelines

2018-04-13 Thread Michalareas, Georgios
Hi Tim and Benjamin,

@Tim: Thank you very much for your comments
@Benjamin: You can find the 4k spheres that were used for the released MEG data 
in the MEG pipeline in

https://github.com/Washington-University/megconnectome/tree/master/template

I also try Tim’s advice on using  -cifti-resample

Have a nice day
Giorgos

From: Timothy Coalson <tsc...@mst.edu<mailto:tsc...@mst.edu>>
Date: Friday, 13. April 2018 at 00:23
To: Giorgos Michalareas <g...@ae.mpg.de<mailto:g...@ae.mpg.de>>
Cc: Benjamin Chiêm 
<benjamin.ch...@uclouvain.be<mailto:benjamin.ch...@uclouvain.be>>, 
"hcp-users@humanconnectome.org<mailto:hcp-users@humanconnectome.org>" 
<hcp-users@humanconnectome.org<mailto:hcp-users@humanconnectome.org>>
Subject: Re: [HCP-Users] MEG processing pipelines

If you want to match existing 4K data, you shouldn't create a new sphere, you 
should obtain the spheres that define the correspondence between the surfaces 
you want to use, and the atlas your data is currently on.

Also, note that wb_command -cifti-resample will allow you to skip the separate, 
resample, cifti-create sequence.  This command is smart enough to notice when 
you are using label data, and do the right thing.  For an extreme downsampling 
like this, it will likely be rather detrimental to the area definitions (if you 
have a summary measure you want to compare to the atlas, consider upsampling 
that summary measure instead), but the ADAP_BARY_AREA method should be somewhat 
better for downsampling (but requires a little extra work).

If the outlines of the labels are what you want, then you can use border files 
instead - these aren't restricted to the vertices the way label files are, so 
the border file outlines will remain sharp when resampled.  You can make border 
files from label files at their original resolution with wb_command 
-cifti-label-to-border and/or -label-to-border .

Tim


On Thu, Apr 12, 2018 at 7:37 AM, Georgios Michalareas 
<g...@ae.mpg.de<mailto:g...@ae.mpg.de>> wrote:

Hi Benjamin,

to resample from 165K and 32K to 4K you need to use wb_command from connectome 
workbench software available on the connectome db website.

This is the actual documentation page of wb_command

https://www.humanconnectome.org/software/workbench-command

To downsample form 165K and 32K to a 4k representation you need a target 4k 
sphere for each hemisphere  (cortical surfaces are inflated to spheres then 
downsampled and then deflated again).
To create such a sphere you can use something like the foillowing commands


downsampDir=/home/georgios.michalareas/workspace/projects/testHCPsMRIinMPIEA/wbdata_downsampled/

wb_command -surface-create-sphere 4000 ${downsampDir}Sphere.4k.R.surf.gii
wb_command -surface-flip-lr ${downsampDir}Sphere.4k.R.surf.gii 
${downsampDir}Sphere.4k.L.surf.gii
wb_command -set-structure ${downsampDir}Sphere.4k.R.surf.gii CORTEX_RIGHT
wb_command -set-structure ${downsampDir}Sphere.4k.L.surf.gii CORTEX_LEFT


Then once you have these spheres you can downsample a label file with something 
like (commands on a linux terminal)

wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN  -label  
CORTEX_LEFT  TMPOLD_LEFT_EZE09.aparc.164k.label.gii
wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN  -label  
CORTEX_RIGHT  TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
wb_command -label-resample TMPOLD_LEFT_EZE09.aparc.164k.label.gii   
EZE09.L.sphere.164k_fs_LR.surf.gii Sphere.4k.L.surf.gii BARYCENTRIC 
TMPNEW_LEFT_EZE09.aparc.164k.label.gii
wb_command -label-resample TMPOLD_RIGHT_EZE09.aparc.164k.label.gii   
EZE09.R.sphere.164k_fs_LR.surf.gii Sphere.4k.R.surf.gii BARYCENTRIC 
TMPNEW_RIGHT_EZE09.aparc.164k.label.gii
wb_command -cifti-create-label  EZE09.aparc.a2009s.4k_fs_LR.dlabel.nii 
-left-label TMPNEW_LEFT_EZE09.aparc.164k.label.gii-right-label 
TMPNEW_RIGHT_EZE09.aparc.164k.label.gii

# delete temporary files
rm -f   TMPOLD_LEFT_EZE09.aparc.164k.label.gii
rm -f   TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
rm -f  TMPNEW_LEFT_EZE09.aparc.164k.label.gii
rm -f  TMPNEW_RIGHT_EZE09.aparc.164k.label.gii

The parcellation files from Freesurfer atlases , including Desikan-Killiany, 
i.e. EZE09.aparc.164k_fs_LR.dlabel.nii, as well as the 164K spheres required 
for downsampling , i.e. EZE09.L.sphere.164k_fs_LR.surf.gii, should be in the 
latest processed structural mri data that you download from connectome db. Look 
in the "MNINonLinear" folder.

I hope these helped
Best
Giorgos




On 4/10/2018 4:25 PM, Benjamin Chiêm wrote:
Dear Georgios,

Thank you again for your very helpful answer.
I have succeeded in parcellating my results using the Yeo et al. atlas, with 
the *.dlabel.nii file provided with the parcellated HCP MEG data (107 nodes), 
and with the wb_command –cifti-parcellate line code.

However, I have troubles to find equivalent *.dlabel.nii files for other 
parcellations scheme, like for the example the D

Re: [HCP-Users] MEG processing pipelines

2018-04-12 Thread Timothy Coalson
If you want to match existing 4K data, you shouldn't create a new sphere,
you should obtain the spheres that define the correspondence between the
surfaces you want to use, and the atlas your data is currently on.

Also, note that wb_command -cifti-resample will allow you to skip the
separate, resample, cifti-create sequence.  This command is smart enough to
notice when you are using label data, and do the right thing.  For an
extreme downsampling like this, it will likely be rather detrimental to the
area definitions (if you have a summary measure you want to compare to the
atlas, consider upsampling that summary measure instead), but the
ADAP_BARY_AREA method should be somewhat better for downsampling (but
requires a little extra work).

If the outlines of the labels are what you want, then you can use border
files instead - these aren't restricted to the vertices the way label files
are, so the border file outlines will remain sharp when resampled.  You can
make border files from label files at their original resolution with
wb_command -cifti-label-to-border and/or -label-to-border .

Tim


On Thu, Apr 12, 2018 at 7:37 AM, Georgios Michalareas <g...@ae.mpg.de> wrote:

> Hi Benjamin,
>
> to resample from 165K and 32K to 4K you need to use wb_command from
> connectome workbench software available on the connectome db website.
> This is the actual documentation page of wb_command
>
> https://www.humanconnectome.org/software/workbench-command
>
> To downsample form 165K and 32K to a 4k representation you need a target
> 4k sphere for each hemisphere  (cortical surfaces are inflated to spheres
> then downsampled and then deflated again).
> To create such a sphere you can use something like the foillowing commands
>
>
> downsampDir=/home/georgios.michalareas/workspace/
> projects/testHCPsMRIinMPIEA/wbdata_downsampled/
>
> wb_command -surface-create-sphere 4000 ${downsampDir}Sphere.4k.R.surf.gii
> wb_command -surface-flip-lr ${downsampDir}Sphere.4k.R.surf.gii
> ${downsampDir}Sphere.4k.L.surf.gii
> wb_command -set-structure ${downsampDir}Sphere.4k.R.surf.gii CORTEX_RIGHT
> wb_command -set-structure ${downsampDir}Sphere.4k.L.surf.gii CORTEX_LEFT
>
>
> Then once you have these spheres you can downsample a label file with
> something like (commands on a linux terminal)
> wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN
> -label  CORTEX_LEFT  TMPOLD_LEFT_EZE09.aparc.164k.label.gii
> wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN
> -label  CORTEX_RIGHT  TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
> wb_command -label-resample TMPOLD_LEFT_EZE09.aparc.164k.label.gii
> EZE09.L.sphere.164k_fs_LR.surf.gii Sphere.4k.L.surf.gii BARYCENTRIC
> TMPNEW_LEFT_EZE09.aparc.164k.label.gii
> wb_command -label-resample TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
> EZE09.R.sphere.164k_fs_LR.surf.gii Sphere.4k.R.surf.gii BARYCENTRIC
> TMPNEW_RIGHT_EZE09.aparc.164k.label.gii
> wb_command -cifti-create-label  EZE09.aparc.a2009s.4k_fs_LR.dlabel.nii
> -left-label TMPNEW_LEFT_EZE09.aparc.164k.label.gii-right-label
> TMPNEW_RIGHT_EZE09.aparc.164k.label.gii
>
> # delete temporary files
> rm -f   TMPOLD_LEFT_EZE09.aparc.164k.label.gii
> rm -f   TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
> rm -f  TMPNEW_LEFT_EZE09.aparc.164k.label.gii
> rm -f  TMPNEW_RIGHT_EZE09.aparc.164k.label.gii
>
> The parcellation files from Freesurfer atlases , including
> Desikan-Killiany, i.e. EZE09.aparc.164k_fs_LR.dlabel.nii, as well as the
> 164K spheres required for downsampling , i.e. 
> EZE09.L.sphere.164k_fs_LR.surf.gii,
> should be in the latest processed structural mri data that you download
> from connectome db. Look in the "MNINonLinear" folder.
>
> I hope these helped
> Best
> Giorgos
>
>
>
>
> On 4/10/2018 4:25 PM, Benjamin Chiêm wrote:
>
> Dear Georgios,
>
>
>
> Thank you again for your very helpful answer.
>
> I have succeeded in parcellating my results using the Yeo et al. atlas,
> with the *.dlabel.nii file provided with the parcellated HCP MEG data (107
> nodes), and with the wb_command –cifti-parcellate line code.
>
>
>
> However, I have troubles to find equivalent *.dlabel.nii files for other
> parcellations scheme, like for the example the Desikan-Killiany atlas.
> Could you help me? Also, should I just use the ft_resampledata Fieldtrip
> function in order to go from the 165K or 32K to the 4K dlabel files, or am
> I missing something?
>
>
>
> Regards,
>
>
>
> Benjamin
>
>
>
> *De :* Georgios Michalareas <g...@ae.mpg.de> <g...@ae.mpg.de>
> *Envoyé :* lundi 26 mars 2018 19:20
> *À :* Benjamin Chiêm <benjamin.ch...@uclouvain.be>
> <benjamin.ch...@uclouvain.be>; hcp-users@humanconnectome.org
> *O

Re: [HCP-Users] MEG processing pipelines

2018-04-12 Thread Georgios Michalareas

Hi Benjamin,

to resample from 165K and 32K to 4K you need to use wb_command from 
connectome workbench software available on the connectome db website.


This is the actual documentation page of wb_command

https://www.humanconnectome.org/software/workbench-command

To downsample form 165K and 32K to a 4k representation you need a target 
4k sphere for each hemisphere  (cortical surfaces are inflated to 
spheres then downsampled and then deflated again).

To create such a sphere you can use something like the foillowing commands


downsampDir=/home/georgios.michalareas/workspace/projects/testHCPsMRIinMPIEA/wbdata_downsampled/

wb_command -surface-create-sphere 4000 ${downsampDir}Sphere.4k.R.surf.gii
wb_command -surface-flip-lr ${downsampDir}Sphere.4k.R.surf.gii 
${downsampDir}Sphere.4k.L.surf.gii

wb_command -set-structure ${downsampDir}Sphere.4k.R.surf.gii CORTEX_RIGHT
wb_command -set-structure ${downsampDir}Sphere.4k.L.surf.gii CORTEX_LEFT


Then once you have these spheres you can downsample a label file with 
something like (commands on a linux terminal)


wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN 
-label  CORTEX_LEFT  TMPOLD_LEFT_EZE09.aparc.164k.label.gii
wb_command -cifti-separate EZE09.aparc.164k_fs_LR.dlabel.nii COLUMN 
-label  CORTEX_RIGHT  TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
wb_command -label-resample TMPOLD_LEFT_EZE09.aparc.164k.label.gii 
EZE09.L.sphere.164k_fs_LR.surf.gii Sphere.4k.L.surf.gii BARYCENTRIC 
TMPNEW_LEFT_EZE09.aparc.164k.label.gii
wb_command -label-resample TMPOLD_RIGHT_EZE09.aparc.164k.label.gii 
EZE09.R.sphere.164k_fs_LR.surf.gii Sphere.4k.R.surf.gii BARYCENTRIC 
TMPNEW_RIGHT_EZE09.aparc.164k.label.gii
wb_command -cifti-create-label EZE09.aparc.a2009s.4k_fs_LR.dlabel.nii 
-left-label TMPNEW_LEFT_EZE09.aparc.164k.label.gii    -right-label 
TMPNEW_RIGHT_EZE09.aparc.164k.label.gii


# delete temporary files
rm -f   TMPOLD_LEFT_EZE09.aparc.164k.label.gii
rm -f   TMPOLD_RIGHT_EZE09.aparc.164k.label.gii
rm -f  TMPNEW_LEFT_EZE09.aparc.164k.label.gii
rm -f  TMPNEW_RIGHT_EZE09.aparc.164k.label.gii

The parcellation files from Freesurfer atlases , including 
Desikan-Killiany, i.e. EZE09.aparc.164k_fs_LR.dlabel.nii, as well as the 
164K spheres required for downsampling , i.e. 
EZE09.L.sphere.164k_fs_LR.surf.gii, should be in the latest processed 
structural mri data that you download from connectome db. Look in the 
"MNINonLinear" folder.


I hope these helped
Best
Giorgos



On 4/10/2018 4:25 PM, Benjamin Chiêm wrote:


Dear Georgios,

Thank you again for your very helpful answer.

I have succeeded in parcellating my results using the Yeo et al. 
atlas, with the *.dlabel.nii file provided with the parcellated HCP 
MEG data (107 nodes), and with the wb_command –cifti-parcellate line 
code.


However, I have troubles to find equivalent *.dlabel.nii files for 
other parcellations scheme, like for the example the Desikan-Killiany 
atlas. Could you help me? Also, should I just use the ft_resampledata 
Fieldtrip function in order to go from the 165K or 32K to the 4K 
dlabel files, or am I missing something?


Regards,

Benjamin

*De :*Georgios Michalareas <g...@ae.mpg.de>
*Envoyé :* lundi 26 mars 2018 19:20
*À :* Benjamin Chiêm <benjamin.ch...@uclouvain.be>; 
hcp-users@humanconnectome.org

*Objet :* Re: [HCP-Users] MEG processing pipelines

Hi Benjamin,

Sorry for late reply but I was out of office.

Regarding single trial source analysis I have put together some code 
that shows you how to project all motor trials for LH into source 
space in a matrix with dimensions:


Nsources * Ntimespoints * Ntrials

beware this matrix for the specific subject is 11GB.

Please find the code attached in file

testsourcepertrial1.m

I have put some comments i hope they help.

Regarding parcellating the data, you have to use the workbench command 
tool to donwload all parcelations from thw 165 K representation to the 
4K one used for the MEG source level analysis.


I ll have a look and come back to you on this.

Till then I hope the code I am sending you helps

Best

Giorgos

On 3/16/2018 3:38 PM, Benjamin Chiêm wrote:

Dear HCP experts,

In the context of my PhD thesis (using HCP data), I had some
questions about MEG processing pipelines.

In my research, I somehow need the MEG data during motor task, in
the source space (i.e. after beamforming), for _each trial_ and
each individual _separately_. It seems that the MEG pipelines
average data over trials for each individual, and that they reduce
the temporal resolution of the data when going from 'tmegpreproc'
files to 'srcavglcmv’.

So my two questions are:

- Is it possible, from the 'tmegpreproc' file for each individual,
to perform sources reconstruction with Linearly Constrained
Minimum Variance beamformer for each trial independently, and to
keep the original temporal resolution (about 500Hz)? What are the
steps to follow? I tried to 

Re: [HCP-Users] MEG processing pipelines

2018-04-10 Thread Benjamin Chiêm
Dear Georgios,

Thank you again for your very helpful answer.
I have succeeded in parcellating my results using the Yeo et al. atlas, with 
the *.dlabel.nii file provided with the parcellated HCP MEG data (107 nodes), 
and with the wb_command -cifti-parcellate line code.

However, I have troubles to find equivalent *.dlabel.nii files for other 
parcellations scheme, like for the example the Desikan-Killiany atlas. Could 
you help me? Also, should I just use the ft_resampledata Fieldtrip function in 
order to go from the 165K or 32K to the 4K dlabel files, or am I missing 
something?

Regards,

Benjamin

De : Georgios Michalareas <g...@ae.mpg.de>
Envoyé : lundi 26 mars 2018 19:20
À : Benjamin Chiêm <benjamin.ch...@uclouvain.be>; hcp-users@humanconnectome.org
Objet : Re: [HCP-Users] MEG processing pipelines


Hi Benjamin,

Sorry for late reply but I was out of office.

Regarding single trial source analysis I have put together some code that shows 
you how to project all motor trials for LH into source space in a matrix with 
dimensions:

Nsources * Ntimespoints * Ntrials

beware this matrix for the specific subject is 11GB.

Please find the code attached in file

testsourcepertrial1.m

I have put some comments i hope they help.



Regarding parcellating the data, you have to use the workbench command tool to 
donwload all parcelations from thw 165 K representation to the 4K one used for 
the MEG source level analysis.

I ll have a look and come back to you on this.



Till then I hope the code I am sending you helps

Best

Giorgos

On 3/16/2018 3:38 PM, Benjamin Chiêm wrote:
Dear HCP experts,

In the context of my PhD thesis (using HCP data), I had some questions about 
MEG processing pipelines.
In my research, I somehow need the MEG data during motor task, in the source 
space (i.e. after beamforming), for each trial and each individual separately. 
It seems that the MEG pipelines average data over trials for each individual, 
and that they reduce the temporal resolution of the data when going from 
'tmegpreproc' files to 'srcavglcmv'.

So my two questions are:

- Is it possible, from the 'tmegpreproc' file for each individual, to perform 
sources reconstruction with Linearly Constrained Minimum Variance beamformer 
for each trial independently, and to keep the original temporal resolution 
(about 500Hz)? What are the steps to follow? I tried to play with options like 
« cfg.rawtrial = yes » or « cfg.keeptrials = yes » in ft_timelockanalysis and 
ft_sourceanalysis of the hcp_srcavglcmv_contrasts.m file, but to be honest I am 
not sure of what I am doing...

- After projection on the sources space, how can I parcellate the data, using 
for example the Desikan-Killiany atlas?

I hope I am clear enough in my explanations. Thank you again for the amazing 
work you're doing!

Regards,

Benjamin Chiêm


___
HCP-Users mailing list
HCP-Users@humanconnectome.org<mailto:HCP-Users@humanconnectome.org>
http://lists.humanconnectome.org/mailman/listinfo/hcp-users

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png]<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=emailclient>

Virus-free. 
www.avg.com<http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=emailclient>




--



Dr. Georgios Michalareas

Neuroscience Department

Max Planck Institute for Empirical Aesthetics



email: g...@aesthetics.mpg.de<mailto:g...@aesthetics.mpg.de>

phone: +49 69 8300479-325



___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users


Re: [HCP-Users] MEG processing pipelines

2018-03-26 Thread Georgios Michalareas

Hi Benjamin,

Sorry for late reply but I was out of office.

Regarding single trial source analysis I have put together some code 
that shows you how to project all motor trials for LH into source space 
in a matrix with dimensions:


Nsources * Ntimespoints * Ntrials

beware this matrix for the specific subject is 11GB.

Please find the code attached in file

testsourcepertrial1.m

I have put some comments i hope they help.


Regarding parcellating the data, you have to use the workbench command 
tool to donwload all parcelations from thw 165 K representation to the 
4K one used for the MEG source level analysis.


I ll have a look and come back to you on this.


Till then I hope the code I am sending you helps

Best

Giorgos


On 3/16/2018 3:38 PM, Benjamin Chiêm wrote:


Dear HCP experts,

In the context of my PhD thesis (using HCP data), I had some questions 
about MEG processing pipelines.


In my research, I somehow need the MEG data during motor task, in the 
source space (i.e. after beamforming), for _each trial_ and each 
individual _separately_. It seems that the MEG pipelines average data 
over trials for each individual, and that they reduce the temporal 
resolution of the data when going from 'tmegpreproc' files to 
'srcavglcmv’.


So my two questions are:

- Is it possible, from the 'tmegpreproc' file for each individual, to 
perform sources reconstruction with Linearly Constrained Minimum 
Variance beamformer for each trial independently, and to keep the 
original temporal resolution (about 500Hz)? What are the steps to 
follow? I tried to play with options like « cfg.rawtrial = yes » or « 
cfg.keeptrials = yes » in ft_timelockanalysis and ft_sourceanalysis of 
the hcp_srcavglcmv_contrasts.m file, but to be honest I am not sure of 
what I am doing…


- After projection on the sources space, how can I parcellate the 
data, using for example the Desikan-Killiany atlas?


I hope I am clear enough in my explanations. Thank you again for the 
amazing work you’re doing!


Regards,

Benjamin Chiêm

___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users


 
	Virus-free. www.avg.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


--

Dr. Georgios Michalareas
Neuroscience Department
Max Planck Institute for Empirical Aesthetics

email: g...@aesthetics.mpg.de
phone: +49 69 8300479-325



___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users
scanid_list={'10-Motort'
'11-Motort'};
groupnames_list={'TEMG'
'TFLA'};
iDataGroup=1;
groupname=groupnames_list{iDataGroup};
subjID='177746'; 

cdbDir='/home/georgios.michalareas/workspace/projects/HCP/data/connectomedb/';
pipelinedatadir 
='/home/georgios.michalareas/workspace/projects/HCP/code/testsingletrial';
subjectid=subjID;
experimentid=[subjectid,'_MEG'];
anatomydir=['/home/georgios.michalareas/workspace/projects/HCP/data/connectomedb/',subjectid,'/MEG/anatomy/'];


%-
fileGrid2D=[anatomydir,experimentid,'_anatomy_sourcemodel_2d.mat'];  
hcp_read_matlab(fileGrid2D,'sourcemodel2d');
grid=ft_convert_units(sourcemodel2d,'cm');

fileHeadVol=[anatomydir,'/',experimentid,'_anatomy_headmodel.mat'];
hcp_read_matlab(fileHeadVol,'headmodel');
headmodel=ft_convert_units(headmodel,'cm');
%-
scanid1=scanid_list{1};  
filename1=[cdbDir,subjID,'/MEG/Motort/tmegpreproc/',subjID,'_MEG_',scanid1,'_tmegpreproc_',groupname,'.mat'];
trialinfofile1=[cdbDir,subjID,'/MEG/Motort/tmegpreproc/',subjID,'_MEG_',scanid1,'_tmegpreproc_trialinfo.mat'];
%-
scanid2=scanid_list{2};  
filename2=[cdbDir,subjID,'/MEG/Motort/tmegpreproc/',subjID,'_MEG_',scanid2,'_tmegpreproc_',groupname,'.mat'];
trialinfofile2=[cdbDir,subjID,'/MEG/Motort/tmegpreproc/',subjID,'_MEG_',scanid2,'_tmegpreproc_trialinfo.mat'];
%-

hcp_read_matlab(filename1,'data');
data1=data;
hcp_read_matlab(trialinfofile1,'trlInfo');
trialinfo1=trlInfo.lockTrl{iDataGroup};
trlColDescr=trlInfo.trlColDescr{iDataGroup}; % See the description of the 
column sin trialinfo1 (also the same for trialinfo2 below)
%---
hcp_read_matlab(filename2,'data');
data2=data;
hcp_read_matlab(trialinfofile2,'trlInfo');
trialinfo2=trlInfo.lockTrl{iDataGroup};
%-
clear data;

grad=ft_convert_units(data1.grad,'cm'); % assuming that subject has moved very 
little between the two scans




%%
%- Create Leadfields ---
% You only need to do this once per subject. Not everytime you perform
% source localization

[HCP-Users] MEG processing pipelines

2018-03-16 Thread Benjamin Chiêm
Dear HCP experts,

In the context of my PhD thesis (using HCP data), I had some questions about 
MEG processing pipelines.
In my research, I somehow need the MEG data during motor task, in the source 
space (i.e. after beamforming), for each trial and each individual separately. 
It seems that the MEG pipelines average data over trials for each individual, 
and that they reduce the temporal resolution of the data when going from 
'tmegpreproc' files to 'srcavglcmv'.

So my two questions are:

- Is it possible, from the 'tmegpreproc' file for each individual, to perform 
sources reconstruction with Linearly Constrained Minimum Variance beamformer 
for each trial independently, and to keep the original temporal resolution 
(about 500Hz)? What are the steps to follow? I tried to play with options like 
« cfg.rawtrial = yes » or « cfg.keeptrials = yes » in ft_timelockanalysis and 
ft_sourceanalysis of the hcp_srcavglcmv_contrasts.m file, but to be honest I am 
not sure of what I am doing...

- After projection on the sources space, how can I parcellate the data, using 
for example the Desikan-Killiany atlas?

I hope I am clear enough in my explanations. Thank you again for the amazing 
work you're doing!

Regards,

Benjamin Chiêm


___
HCP-Users mailing list
HCP-Users@humanconnectome.org
http://lists.humanconnectome.org/mailman/listinfo/hcp-users