[FieldTrip] fieldtrip Digest, Vol 161, Issue 4
MONALISA CHIKEZIE
chikeziemonalisa at gmail.com
Sun Apr 14 10:19:13 CEST 2024
Dear Jan-Mathijs,
Thank you for your response. I have gone through this thread :
https://mailman.science.ru.nl/pipermail/fieldtrip/2024-March/042417.html<
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fpipermail%2Ffieldtrip%2F2024-March%2F042417.html&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C9c4ab2b947b347f889a008dc546dd5da%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638478077945050349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fHqrXqfBaYWkJoGyr17Z496%2BuyCDk8gWHh31bqNDll4%3D&reserved=0>
to find solutions and applied various methods to visualize my statistical
mask.
I chose 500 randomizations as a result of computational demands when
applying 1000 permutations of montecarlo cluster method to the 100
participants I have.
I attempted the suggestions here:
https://yuval-harpaz.github.io/MEG-course/html/course12.html#4
My statistical plots were not informative. What is a suggested alternative
for plotting source statistics effects when computational demands are
limited ?
Best,
Monalisa
Cognitive Neuroscience Master Student
On Thu, Apr 4, 2024 at 12:00 PM <fieldtrip-request at science.ru.nl> wrote:
> Send fieldtrip mailing list submissions to
> fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
> fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
> fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
> 1. Re: Invalid file identifier when reading file with
> fiff_read_raw_segment (Schoffelen, J.M. (Jan Mathijs))
> 2. Plotting parametric cluster permutation (MONALISA CHIKEZIE)
> 3. Re: Plotting parametric cluster permutation
> (Schoffelen, J.M. (Jan Mathijs))
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 3 Apr 2024 10:02:11 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)"
> <janmathijs.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Invalid file identifier when reading file
> with fiff_read_raw_segment
> Message-ID: <E16CE576-5B9A-4DE6-B485-94D414B1127D at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Alexandria,
>
> Hmm, I am not sure what might be causing this. I cannot reproduce it on my
> end with the data that you provided (thanks for that!).
> I think that you might be working with an outdated copy of the
> fiff-readers - as provided in fieldtrip/external/mne.
>
> Your error stack mentions the error in fiff_read_raw_segment to be thrown
> at line 152, which is executing fiff_read_tag(…
>
> However, the most recent version of the code (which should be in line with
> the ‘original’ version https://github.com/mne-tools/mne-matlab<
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmne-tools%2Fmne-matlab&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd6ab124f41c940b268c408dc53c5214f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638477353345408413%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=PdRDm3wMmu0xz4C081eEAaoUjBWSzuEvhZRA5XNtf20%3D&reserved=0>)
> with its reads something else:
> https://github.com/fieldtrip/fieldtrip/blob/8f99c23131e221e1958bf3632a4aa125637ed501/external/mne/fiff_read_raw_segment.m#L152
> <
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip%2Fblob%2F8f99c23131e221e1958bf3632a4aa125637ed501%2Fexternal%2Fmne%2Ffiff_read_raw_segment.m%23L152&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd6ab124f41c940b268c408dc53c5214f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638477353349939790%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=K1bwmpH9XU7OjtHCirUjGje%2By%2BfV48z%2F0OYBzCTkN1A%3D&reserved=0
> >
>
> Could you update your fieldtrip version, and try whether your problem
> persists? If so, we can take it from there.
>
> Best wishes,
>
> Jan-Mathijs
>
> PS: I have a working matlab implementation of a ‘vanilla’ signal-space
> separation procedure, incorporating both a spatial and subsequent temporal
> projection, which I wrote to be able to apply SSS to OPM data. Drop me a
> direct message if you would be interested in working on this together.
>
>
>
>
> On 3 Apr 2024, at 01:07, Xan McPherson via fieldtrip <
> fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:
>
> Hello everyone,
>
> My name is Alexandria McPherson and I am a PhD student working with the
> physics behind MEG at the Institute for Learning and Brain Sciences,
> University of Washington, Seattle. Currently, I am focusing on ways to
> modify the signal space separation method for use with on-scalp MEG sensor
> systems.
>
> I am running into some issues using FieldTrip to load raw data from .fif
> files. Specifically, I have been working with the example file
> "sample-audvis-raw.fif" which is provided by MNE-Python in their
> "MEG/sample" data folder. Here is a Dropbox link to the data:
> https://www.dropbox.com/scl/fo/gffle6d9ppa47pkmes8gj/h?rlkey=8swrsnlyiz61si5ycrxg5x9c2&dl=0
> <
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.dropbox.com%2Fscl%2Ffo%2Fgffle6d9ppa47pkmes8gj%2Fh%3Frlkey%3D8swrsnlyiz61si5ycrxg5x9c2%26dl%3D0&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd6ab124f41c940b268c408dc53c5214f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638477353349939790%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2Fz85DWhK31J4Shu5NPAYZm30ObapTTDSsIX6X0uF650%3D&reserved=0
> >.
> I am first loading in the "info" structure, here is the code I am running:
> filename =
> "C:/Users/.../mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fifinfo
> = fiff_read_meas_info(filename);[raw] =
> fiff_setup_read_raw(filename);[data,times] = fiff_read_raw_segment(raw);
>
> I am able to read the "info" and "raw" objects, but when I run
> "fiff_read_raw_segment", I recieve the following error:
> Error using fseek. Invalid file identifier. Use fopen to generate a valid
> file identifier.
> Error in fiff_read_tag (line 83)
> fseek(fid,pos,'bof');
> Error in fiff_read_raw_segment (line 152)
> tag = fiff_read_tag(raw.fid,this.ent.pos);
>
> I also get this same error with other MEG "fif" files. Would you have any
> ideas as to what might be the issue?
>
> Thanks!
> Alexandria
> Physics PhD Student | I-LABS | University of Washington
> B.S. Engineering Physics | Colorado School of Mines
> _______________________________________________
> 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%7C02%7Cfieldtrip%40science.ru.nl%7Cd6ab124f41c940b268c408dc53c5214f%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638477353350095975%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=cGpVtNALEv6oyEbwcxa0KMOVaqoec31nRPvFNWp%2BnO0%3D&reserved=0
> >
> https://doi.org/10.1371/journal.pcbi.1002202
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240403/afe45d93/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 2
> Date: Thu, 4 Apr 2024 01:08:45 +0200
> From: MONALISA CHIKEZIE <chikeziemonalisa at gmail.com>
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] Plotting parametric cluster permutation
> Message-ID:
> <
> CAOJxHYLwEmZHExVMGBXCHOByOTyaKXnBLmMB+6xjYn7+QBQmCQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi All,
> I am relatively new to Fieldtrip and I want to plot source statistics
> results. How do I plot the results of my parametric cluster permutation.
> I used the following code to run the source statistics.
>
> cfg.stat = [];
> cfg.stat.method = 'analytic'; %
> cfg.stat.statistic = 'ft_statfun_depsamplesT';
> cfg.stat.correctm = 'fdr'; % Analytical methods with an FDR correction
> cfg.stat.parameter = 'pow';
> cfg.stat.clusteralpha = 0.05;
> cfg.stat.clustercritval = 0.05;
> cfg.stat.clusterstatistic = 'maxsum';
> cfg.stat.minnbchan = 2;
> cfg.stat.tail = 0;
> cfg.stat.clustertail = 0;
> cfg.stat.alpha = 0.025;
> cfg.stat.numrandomization = 500;
> cfg.stat.computecritval = 'yes' ; % calculates the critical values of the
> test statistics
> cfg.stat.computeprob = 'yes' ; %calculates the p-values
> cfg.stat.frequency = 'all';
> cfg.stat.ivar = 1; %conditions
> cfg.stat.uvar = 2; %Participnts
>
> I generated and saved the results as stats_results.mat.
>
> The output yielded the following fields:
> Field
> stat
> df
> critval
> prob
> mask
> dimord
> dim
> inside
> pos
> cfg
>
> Tutorials I saw on the ft website included fields like posclusters angled
> negclusters when using Montecarlo method.
>
> Thank you very much.
>
> Best,
> Monalisa
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240404/ddc6bfab/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Thu, 4 Apr 2024 06:09:49 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)"
> <janmathijs.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Plotting parametric cluster permutation
> Message-ID: <735242CD-4540-4293-8E99-C811CAE9A05C at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Monalisa,
>
> The cfg that you used to instruct the statistics computation is somewhat
> ambiguous, and contains specification for options that are mutually
> exclusive.
> Specifically, when specifying cfg.correctm = ‘fdr’, all options that
> pertain to clustering have become non-functional (because the thing you
> fill in for correctm takes precedence in determining what’s going to
> happen). In other words, you either use ‘fdr’(=false discovery rate), or
> ‘cluster’(=for cluster-based inference + multiple comparison correction),
> not both. Thus, indeed, the output of the statistics computation by design
> will not have any information pertaining to clusters. The effect of the
> false discovery rate will be visible in the ‘mask’ field, which specifies
> for each channel/source-time-(frequency) point whether the null hypothesis
> of exchangeability between conditions can be rejected with sufficient
> confidence. The relationship between the p-values and mask are not so
> straightforward when using ‘fdr’ as a correction method. This is something
> that recently came up in another (unresolved, probably TLDR) thread:
> https://mailman.science.ru.nl/pipermail/fieldtrip/2024-March/042417.html<
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fpipermail%2Ffieldtrip%2F2024-March%2F042417.html&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C9c4ab2b947b347f889a008dc546dd5da%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638478077945050349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fHqrXqfBaYWkJoGyr17Z496%2BuyCDk8gWHh31bqNDll4%3D&reserved=0
> >
>
> So, long story short, if you want to make a visualization of the effect, I
> would display the statistics’ value (as present in the stat-field) and
> creatively think of a way of highlighting the data points that survive the
> statistical mask.
>
> One final point: when using ‘fdr’ typically it only makes sense if you use
> a very large number of randomizations, in your case I would go way beyond
> the listed 500. If your design admits (i.e. the maximum number of
> randomizations will be 2^#-of-participants) you should use at least 10000
> or so. If that’s not possible, probably you’d need to consider another way
> of doing your inference.
>
> Good luck,
> Jan-Mathijs
>
>
> On 4 Apr 2024, at 01:08, MONALISA CHIKEZIE via fieldtrip <
> fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:
>
> Hi All,
> I am relatively new to Fieldtrip and I want to plot source statistics
> results. How do I plot the results of my parametric cluster permutation.
> I used the following code to run the source statistics.
>
> cfg.stat = [];
> cfg.stat.method = 'analytic'; %
> cfg.stat.statistic = 'ft_statfun_depsamplesT';
> cfg.stat.correctm = 'fdr'; % Analytical methods with an FDR correction
> cfg.stat.parameter = 'pow';
> cfg.stat.clusteralpha = 0.05;
> cfg.stat.clustercritval = 0.05;
> cfg.stat.clusterstatistic = 'maxsum';
> cfg.stat.minnbchan = 2;
> cfg.stat.tail = 0;
> cfg.stat.clustertail = 0;
> cfg.stat.alpha = 0.025;
> cfg.stat.numrandomization = 500;
> cfg.stat.computecritval = 'yes' ; % calculates the critical values of the
> test statistics
> cfg.stat.computeprob = 'yes' ; %calculates the p-values
> cfg.stat.frequency = 'all';
> cfg.stat.ivar = 1; %conditions
> cfg.stat.uvar = 2; %Participnts
>
> I generated and saved the results as stats_results.mat.
>
> The output yielded the following fields:
> Field
> stat
> df
> critval
> prob
> mask
> dimord
> dim
> inside
> pos
> cfg
>
> Tutorials I saw on the ft website included fields like posclusters angled
> negclusters when using Montecarlo method.
>
> Thank you very much.
>
> Best,
> Monalisa
>
>
>
>
> _______________________________________________
> 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%7C02%7Cfieldtrip%40science.ru.nl%7C9c4ab2b947b347f889a008dc546dd5da%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638478077945050349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=wnLUzMVACQZArEJRKvryu3GFIeClxkHQ8H9adWyicSk%3D&reserved=0
> >
> https://doi.org/10.1371/journal.pcbi.1002202
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240404/d631d64f/attachment-0001.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
>
> ------------------------------
>
> End of fieldtrip Digest, Vol 161, Issue 4
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20240414/ccceaf57/attachment.htm>
More information about the fieldtrip
mailing list