[FieldTrip] Is it normal to have NaNs in source analysis output?

Jane Tan Jane.Tan at murdoch.edu.au
Mon Feb 11 10:59:37 CET 2019


Hi Jan-Mathjis,


What a relief and thank you very much!

Cheers,
Jane
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Monday, 11 February 2019 3:39 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Is it normal to have NaNs in source analysis output?

Hi Jane,

Yes, it is not a problem (and expected) for the outside-of-the-head dipole positions to be represented by NaNs.

Best wishes and keep up the good work,

Jan-Mathijs

J.M.Schoffelen, MD PhD
Senior Researcher, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands



On 11 Feb 2019, at 03:42, Jane Tan <Jane.Tan at murdoch.edu.au<mailto:Jane.Tan at murdoch.edu.au>> wrote:

Dear Fieldtrippers,

My name is Jane, and this is my first time posting a question to this community. First and foremost, I would like to apologise if my question is extremely trivial.

I am trying to perform source analysis using the Beamformer DICS approach on EEG data. My data has been preprocessed using the EEGlab toolbox, and in this particular instance I am only interested in 20 Hz source space activity for time periods around event 'SS'.
My question is very simple: is it normal to get NaNs in the avg.pow output of the source analysis? It seems to make sense; positions in the grid that do not have 20 Hz reconstructed activity would be represented by NaNs.  However, I'm a novice (in all aspects: Matlab, EEG analysis, and Fieldtrip), and for a sanity check, would like to confirm that getting NaNs in my source output is normal.


Here is the code I executed:


%% Loading data
[EEG]          = pop_loadset('E:\preprocesseddata.set');
EEG             = pop_epoch( EEG, {  'SSstopDIN'  }, [-0.5         0.8]);     % Epoch to event of interest 'SS'
dataSS_epoched  = eeglab2fieldtrip(EEG, 'preprocessing');  % Convert eeglab dataset to fieldtrip data



%% Calculating the cross spectral density matrix

    cfg = [];
    cfg.method    = 'mtmfft';
    cfg.taper     = 'hanning';
    cfg.output    = 'powandcsd';
    cfg.foi       = 4:40;
    cfg.keeptrials = 'no';
    TFR_SS = ft_freqanalysis(cfg, dataSS_epoched);



%% Computing leadfield

cfg                 = [];
cfg.headmodel       = vol; %using BEM head model from FT template
cfg.reducerank      = 3; %default = 3 for EEG
cfg.elec            = elec_aligned
cfg.grid.resolution = 0.5;   % use a 3-D grid with a 0.5 cm resolution
cfg.grid.unit       = 'cm';
[grid] = ft_prepare_leadfield(cfg);


%% Source analysis (without contrasts; just testing source reconstruction for one condition first)

cfg              = [];
cfg.method       = 'dics';
cfg.frequency    = 20;
cfg.grid         = grid;
cfg.headmodel    = vol;
cfg.elec         = elec_aligned;
sourceSS_nocon = ft_sourceanalysis(cfg, TFR_SS);  % Here, sourceSS_nocon.avg.pow shows NaNs in some cells and not others



<pastedImage.png>


My sincere thanks in advance!


Best regards,

Jane



Jane Tan, PhD Candidate

School of Psychology and Exercise Science | Murdoch University

Room 3.001 Social Science Building, 90 South Street, Murdoch WA 6150 | Email: Jane.Tan at murdoch.edu.au<mailto:Jane.Tan at murdoch.edu.au>

<Outlook-3jowpkkg.png>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://clicktime.symantec.com/3PxWcgg9pAUqfWN3Awe1wPB7Vc?u=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip>
https://doi.org/10.1371/journal.pcbi.1002202<https://clicktime.symantec.com/3TURgaEM3PFv2QqBMmF1AjP7Vc?u=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190211/7d3aa16b/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list