I think as long as these files are in the MATLAB path

the pipelines should work

so you just have to the matlab path the directory where they are or always work in this directory i guess



On 10/11/2017 4:23 PM, Jean-Didier Lemarechal wrote:

waouh !!! thank you so much for this clear and detailled help...


I used the same idea as you proposed with a contrastList and the script hcp_eravg_contrasts.m (to try to keep in line with the pipeline philosophy...)


because the next thing I would like to do is the source localization of these new ERF :)


And there comes my new rather practical question:


For hcp_eravg_contrasts.m to find the files '177746_MEG_6-Wrkmem_tmegpreproc_TIM', '177746_MEG_6-Wrkmem_tmegpreproc_trialinfo', ..., I had to be in the directory containing them :


177746/MEG/Wrkmem


and all the averaged output files ( *.mat, *.png, *xml ) were therefore  generated in this directory , instead of


177746/MEG/eravg

177746/MEG/eravg/figures

177746/MEG/eravg/provenance


Will this be a problem for the following source localization step ?


Should I write a few matlab lines to move the generated files in the "expected" directories ? Or maybe there is an appropriate way to call hcp_eravg_contrasts.m to do this automatically ?


Many thanks anyway !!

JD


Le 11/10/2017 à 15:20, Georgios Michalareas a écrit :

Hi Jean-Didier,

If you need a subset of 0-Back i.e. Faces you ll have to compute the average yourself . The way to do it to load the cleaned prerocessed data for specific subject :

i.e.


load ('load 177746_MEG_6-Wrkmem_tmegpreproc_TIM','data');

and also load the single trial information

load ('177746_MEG_6-Wrkmem_tmegpreproc_trialinfo','trlInfo');


The trlInfo Contains:


trlInfo =

      lockNames: {'TIM'  'TRESP'}
        lockTrl: {[187x40 double]  [186x40 double]}
    trlColDescr: {{40x1 cell}  {40x1 cell}}


the trial information is in field    .lockTrl

so if you want to load the trials cut relative to the Image onset (TIM) , then


trialinfo=trlInfo.lockTrl{1};


This is a matrix with dimension Ntrials x 40 .

The description of each column can be found in


trlInfo.trlColDescr{1}


as you will see in there, columns 4 and 5 have info for image type and memory Type,


 '4. imgType : 1- Face, 2- Tools  0- Fixation'
  '5. memoryType :  1: 0-Back   2: 2-Back'


So if you want 0-back faces you need to find all trials for which column 4 is equal to 1 and column 5 is equal to 1


indIn=find((trialinfo(:,4)==1)&(trialinfo(:,5)==1));

Now you need the indices of the trials you need to select from the 'data' variable.

the data variable contains



data =

          hdr: [1x1 struct]
      fsample: 508.6275
    trialinfo: [186x40 double]
         grad: [1x1 struct]
        trial: {1x186 cell}
         time: {1x186 cell}
        label: {244x1 cell}
          cfg: [1x1 struct]


the actual single trial data is in field .trial.

so the the trial data for 0-bak faces is

data.trial{indIn}.


If you have fieldtrip toolbox and you wanna retain the data structure in fieldtrip format you can extract the 0-back Faces trials by


data_0B_face=ft_select_data(data,'rpt',indIn);


'rpt' stands for repetitions aka trials



Please keep in mind that Working memory has two runs and the preprocessed data is released for each run separately so you need to do the above for each run.

I have put some MATcode below that should give you the average for 0-back faces


%==========================================================================
%Run 1

load ('177746_MEG_6-Wrkmem_tmegpreproc_TIM','data');

load ('177746_MEG_6-Wrkmem_tmegpreproc_trialinfo','trlInfo');

data_run1=data;

trialinfo_run1=trlInfo.lockTrl{1};

indIn_run1=find((trialinfo_run1(:,4)==1)&(trialinfo_run1(:,5)==1));


%Run 2

load ('177746_MEG_7-Wrkmem_tmegpreproc_TIM','data');

load ('177746_MEG_7-Wrkmem_tmegpreproc_trialinfo','trlInfo');

data_run2=data;

trialinfo_run2=trlInfo.lockTrl{1};

indIn_run2=find((trialinfo_run2(:,4)==1)&(trialinfo_run2(:,5)==1));



data_0B_face_run1=ft_selectdata(data_run1,'rpt',indIn_run1);

data_0B_face_run2=ft_selectdata(data_run2,'rpt',indIn_run2);

% Find Common channels
common_channels=intersect(data_0B_face_run1.label,data_0B_face_run2.label);
% Select common channels from each run
data_0B_face_run1=ft_selectdata(data_0B_face_run1,'channel',common_channels);
data_0B_face_run2=ft_selectdata(data_0B_face_run2,'channel',common_channels);

% Append the two runs
data_0B_face=ft_appenddata([], data_0B_face_run1,data_0B_face_run2);

% Demean from baseline before Averaging trials
cfg=[];
cfg.demean='yes';
cfg.baselinewindow = [-0.55 -0.05];
tmpdata=ft_preprocessing(cfg,data_0B_face);

% Average
cfg=[];
tmpavg=ft_timelockanalysis(cfg,tmpdata);

% Visualize the average
cfg=[];
cfg.layout='4D248.lay';
ft_multiplotER(cfg,tmpavg);
%-----------------------------------------------------------------------------------
% All the Fieldtrip commands require Fieldtrip toolbox.
% After you download it in a folder ,i.e. /home/username/fieldtrip
% you can add it to the path with the following commands

% addpath('/home/username/fieldtrip');
% ft_defaults;
%==========================================================================


I hope this helped

Best

Giorgos





On 10/10/2017 8:36 PM, Elam, Jennifer wrote:

Hi Jean-Didier,

Take a look at the "eravg" pipeline section beginning on pg. 153 of the S1200 Reference manual <https://www.humanconnectome.org/storage/app/media/documentation/s1200/HCP_S1200_Release_Reference_Manual.pdf> to see if one of the eravg pipeline output files has the data you want. If you need to compute the eravg yourself, you will likely need the info in Appendix 7 <https://www.humanconnectome.org/storage/app/media/documentation/s1200/HCP_S1200_Release_Appendix_VII.pdf> as well. Giorgos (cc'd) can also provide advice, if needed.


Best,

Jenn


Jennifer Elam, Ph.D.
Scientific Outreach, Human Connectome Project
Washington University School of Medicine
Department of Neuroscience, Box 8108
660 South Euclid Avenue
St. Louis, MO 63110
314-362-9387<tel:314-362-9387>
e...@wustl.edu<mailto:e...@wustl.edu>
www.humanconnectome.org<http://www.humanconnectome.org/>


------------------------------------------------------------------------
*From:* hcp-users-boun...@humanconnectome.org <hcp-users-boun...@humanconnectome.org> on behalf of Jean-Didier Lemarechal <jean-didier.lemarec...@upmc.fr>
*Sent:* Monday, October 9, 2017 5:20:44 PM
*To:* hcp-users@humanconnectome.org
*Subject:* [HCP-Users] eravg for MEG Working memory dataset for face condition
Hi

I have a question regarding the MEG Working memory dataset

I have downloaded all the eravg data

but I would like to get the 0-Back average only for the face condition
(not for the tool)

is it available or do i have to compute it by myself ?

and in this case, how can I do this ?

thanks


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

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

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




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

Reply via email to