Back to the main page.

Bug 2651 - Inconsistency/Inaccuracy between Beamformer Tutorial and Common Filter Example Script

Status CLOSED WONTFIX
Reported 2014-07-16 15:30:00 +0200
Modified 2019-08-10 12:32:55 +0200
Product: FieldTrip
Component: documentation
Version: unspecified
Hardware: All
Operating System: Windows
Importance: P5 minor
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Max Cantor - 2014-07-16 15:30:46 +0200

Not a documentation issue in terms of the FieldTrip toolbox, rather an issue with the User Documentation on the site. Filing this report was suggested to me by Jan-Mathijs. My course of action is: 1. In the Common Filter Example Script (http://fieldtrip.fcdonders.nl/example/common_filters_in_beamforming) I would like to state explicitly that this method allows for the reconstruction of single trial data, but that this is generally not necessary. According to Jan-Mathijs this code is also incomplete. I'm not sure what about it is incomplete, but if I cannot figure this out, at the very least I can add a fixme tag. 2. I would also like to add a section of code that more closely resembles how to compute a common filter in the main Beamformer Tutorial (http://fieldtrip.fcdonders.nl/tutorial/beamformer). "Then we compute the inverse filter based on both conditions. Note the use of cfg.keepfilter so that the output saves this computed filter. cfg = []; cfg.method = 'dics'; cfg.frequency = 18; cfg.grid = grid; cfg.vol = vol; cfg.dics.projectnoise = 'yes'; cfg.dics.lambda = '5%'; cfg.dics.keepfilter = 'yes'; cfg.dics.realfilter = 'yes'; sourceAll = ft_sourceanalysis(cfg, freqAll); By placing this pre-computed filter inside cfg.grid.filter, it can now be applied to each condition separately. cfg.grid.filter = sourceAll.avg.filter; sourcePre_con = ft_sourceanalysis(cfg, freqPre ); sourcePost_con = ft_sourceanalysis(cfg, freqPost);" This comes straight from the beamformer tutorial and I think would be adequate to explain how to compute a common filter for general purposes. I'm not sure if I'm supposed to wait until after this has been approved before taking action, so to be safe I'll wait. Let me know if there is anything else concerning this that I can help with.


Max Cantor - 2014-07-17 15:33:04 +0200

Well, I hope this is ok but I went ahead and made the changes. If they are incorrect or need to be altered in any way please let me know and I can take care of it. 1. Added fixme tag 2. Added FIXME bar to Example Code section with the text "Code for reconstruction of single trial data is incomplete" 3. Added the comment "% only necessary if you are interested in reconstructing single trial data" to the code for the design variable for both PCC and DICS 4. Added in the comment in the code "This is not otherwise necessary to compute the common filter" next to cfg.keepfilter = 'yes' for the freqanalysis of both PCC and DICS 5. Added in the comment in the code "Only necessary if you are interested in reconstructing single trial data" next to cfg.keepfilter = 'yes' for the sourcenalysis of computing the common filter for PCC 6. Added "% This step is only necessary if you need to reconstruct single trial data" just below the % average over tapers, keep single trials % section of the code for PCC 7. Added "Only necessary if you are interested in reconstructing single trial data" to the comment for cfg.rawtrial = 'yes' of the source analysis through common filter section in DICS I still need to look into what is wrong with the single trial reconstruction code, so I don't know if I should re-label this as "status: resolved" or not, but I also put up the fixme in case somebody else can figure it out more easily than I can.


Jan-Mathijs Schoffelen - 2016-12-23 09:13:16 +0100

I think for now we can close this one. (Max: feel free to reopen this if there are new insights). In any case, the example scripts are not explicitly intended to be kept up-to-date, and although it may be desired to have them up-to-date, it is hardly impossible to do so. If however, there are contributions that can easily be incorporated, feel free to do so. The contributions made in 2014 look fair to me. Yet, I don't feel like upgrading the script even more, unless there's a sufficient incentive to do so.


Robert Oostenveld - 2019-08-10 12:32:55 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.