[FieldTrip] plotting frequency-power spectrum of ICA components ft_icabrowser error

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Wed Dec 6 09:21:38 CET 2023


Hi Laura,


I am currently doing artefact rejection on a dataset of children's EEG using ICA. I am able to plot the topography and timecourse of my ICA components, but fail in plotting their frequency-power spectrum (lot's of alpha activity in my dataset. Hopefully loads into a single component).

I found some code snippets in old messages on the mailing list but have not been able to apply them on my dataset. Is there maybe a tutorial I missed, some code that shows how to plot the freq-pwer spectrum like in eeglab?

If you want to compute a powerspectrum for component time-series data, you’d want to call ft_freqanalysis on the output structure that you get after ft_componentanalysis, and then make a figure, using old-fashioned matlab, plot, or perhaps ft_singleplotER (use cfg.method = ‘mtmfft’ for ft_freqanalysis)

I also found ft_icabrowser(cfg, comp), which should plot the freq-power spectrum of my components alongside other measures. I tried using it like this, with a custom layout

cfg = [];
cfg.layout = 'C:\EEG_Data\layout_EEG.mat'
[dummy] = ft_icabrowser(cfg, comp);
however, instead of one figure window with several subplots per component, several windows are opened, each containing subplots, some of them empty. The topoplots also open in seperate windows and only the first 4 of my 25 components are plotted. For each component I get this error message:

Warning: could not determine dimord of "comp" in:

             label: {28×1 cell}
               cfg: [1×1 struct]
              topo: [28×1 double]
        topodimord: 'chan_comp'
              comp: 4
          unmixing: [-1.2657 -1.5088 -1.6876 -1.1454 -1.3345 0.0388 -0.3569 1.2782 0.3718 -1.7437 -1.7553 -1.5412 -0.1625 0.6848 -0.4991 -1.8822 -0.2463 -1.5501 -2.0003 … ]
    unmixingdimord: 'chan_topochan'

Any thoughts on this?

Not really, ft_icabrowser is a function which is based on an external contribution to fieldtrip, which has never made it into the core release part of the code base. The core release part is kept up to date by the developer’s team, but the more peripheral functions are not. It could be that the advancing quality of the core FT-code has caused a backward compatibility break w.r.t. ft_icabrowser.

We can look into this (with not too high priority, because busy -> nudge to the stakeholders of the ft_icabrowser code to step in). For this we would appreciate you to file this as an issue on github:
https://github.com/fieldtrip/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip&data=05%7C01%7Cfieldtrip%40science.ru.nl%7Cd344a60d6e3644c14e5908dbf6345e3c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638374476996945168%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Gb2HYJ2d6UkDwdgId4edMqn%2B9qZVBmBHS%2F2zoCKtNM%3D&reserved=0>, describing the issue, provide some code and minimal data snippet for replication, and we can see how to take it from there.

Best wishes,
Jan-Mathijs



Thanks in advance and best wishes,

Laura

__________
Dr. Laura Hahn
Forschungsgruppe Frühkindliche Sprachentwicklung
Klinik für Audiologie und Phoniatrie
Charité - Universitätsmedizin Berlin


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C01%7Cfieldtrip%40science.ru.nl%7Cd344a60d6e3644c14e5908dbf6345e3c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638374476996945168%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=nKHia1nqL6c9iKxkk6DxU8hEUZ6%2BYmgVMObuoNLAEd0%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C01%7Cfieldtrip%40science.ru.nl%7Cd344a60d6e3644c14e5908dbf6345e3c%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638374476996945168%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=116JjGvkdMM%2BTQLMRgv8F7oqKGDJduQVkT4jCr6VMtU%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20231206/59341a63/attachment.htm>


More information about the fieldtrip mailing list