Diff for "Maxfilter" - Meg Wiki
location: Diff for "Maxfilter"
Differences between revisions 2 and 51 (spanning 49 versions)
Revision 2 as of 2007-11-27 12:39:32
Size: 6339
Editor: YuryShtyrov
Comment:
Revision 51 as of 2022-07-18 14:59:31
Size: 2293
Editor: OlafHauk
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
{{attachment:mrclogo.gif}}
Line 3: Line 5:
The first step towards analysing your data is pre-processing it using Maxfilter utility. This is necessary regardless of the tools you are going to use for further analysis (ENM, SPM, Besa, etc.) == Background ==
A common first step in analysing your data is to pre-processing them using the Maxfilter program. This Neuromag sofware implements "Signal-Space Separation" (SSS), which is a clever mathematical way to separate magnetic signals coming from within the brain (or more precisely, a sphere within the sensors) from those coming from outside the brain (or more precisely, from outside a sphere outside the sensors). There are several technical papers on Maxfilter theory and application by Samu Taulu et al.
Line 5: Line 8:
= Avoid MaxFilter Bugs! =
CBU researchers have encountered problems using some options in Neuromag's Max Filter program, and in discussing these issues with the Neuromag software engineers, we have learned of a few other bugs too. These are briefly summarised below and will be expanded upon as we gain more info. See the "neuromeg" mailing list archives for the full discussion (and if you haven't done it already, join the list!): http://www.jiscmail.ac.uk/archives/neuromeg.html
Maxfilter is helpful for 1) removing noise originating from sources outside the sensor array, 2) detecting bad channels, 3) realigning (interpolating) data after movement (provided you have used continuous HPI) and 4) moving the data to a standard space (e.g, across subjects).
Line 8: Line 10:
'''Don't use '-trans default' without setting '-frame' and '-origin''''
Line 10: Line 11:
If you attempt to transform the subject's head position to the 'default' position corresponding to the origin of the device coordinate frame (see p. 33 of Max Filter User's Guide) without specifying the -frame and -origin options, the transformed data will contain large-amplitude noise at the vertex. This bug is known to Neuromag and they are working on a solution. Apparently Max Move works ok when the target position is defined in another file, or with the default option when -frame and -origin are specified, e.g.: '-trans other_file_sss.fif' or '-trans default -frame head -origin 0 0 40' == Maxfilter use at the CBU ==
Our latest Maxfilter version is Maxfilter 2.2.14 (but the previous version 2.2.12 is also in use).
Line 12: Line 14:
'''Don't use '-trans' with head-movement compensation '-movecomp'''' The following example will apply Maxfilter including Signal Space Separation (SSS), its temporal extension (ST), and movement compensation.
Line 14: Line 16:
According to Neuromag, -movecomp always returns the head position to the '''initial''' position in the recording. {{{
maxfilter-2.2.14 -f input_file.fif -o output_file.fif -st -origin 0 0 45 -frame head -autobad on -movecomp -cal /neuro/databases_triux/sss/sss_cal.dat -ctc /neuro/databases_triux/ctc/ct_sparse.fif
}}}
Line 16: Line 20:
'''Don't use '-autobad' with head-position estimation '-headpos' or movement compensation '-movecomp'''' If you are using data from our previous Vectorview machine, the last two options should be
Line 18: Line 22:
Just don't. Apparently -autobad is fine alone (but not really recommended anyway), and -headpos and -movecomp are fine without -autobad. Instead of -autobad, it is recommended that you inspect your raw data, note any noisy or otherwise 'bad' sensors, and use the -bad <sensor number(s)>, e.g.: '-bad 521 1421 2413'''' ''' {{{
-cal /neuro/databases_vectorview/sss/sss_cal.dat -ctc /neuro/databases_vectorview/ctc/ct_sparse.fif
}}}
Line 20: Line 26:
'''Don't use '-lpfilt' to low-pass filter data'''
Line 22: Line 27:
According to Neuromag, -lpfilt uses an IIR filter which introduces a delay in the output signal. Note that downsampling, option -ds, also necessarily low-pass filters data but it does not cause the same delay because it uses an FIR filter. For more information on these and other options, see the [[attachment:Maxfilter_Manual_v2pt2.pdf|Maxfilter 2.2 manual.]].
Line 24: Line 29:
'''Usage of MaxFitler from command line''''
GUI interface to maxfilter is limited, but can be helpful to discover the options the program has to offer. For the full power and scriptability, use the command line utility.
== Diagnostics ==
You can get information about movement parameters using these [[http://imaging.mrc-cbu.cam.ac.uk/meg/maxdiagnost|scripts to analyse maxfilter output]].
Line 27: Line 32:
usage: /opt/neuromag/bin/util/i686-pc-linux-gnu/maxfilter -f <infile> [options]
General options:
        -version shows the version number of the program
        -help shows information of all options
        -v switches on verbose logging
        -f <infile.fif> sets the name of the input file
        -o <outfile.fif> sets the name of the output file
        -origin <x0 y0 z0> sets the origin of the inside expansion
                               (x0,y0,z0 must be in [mm])
        -frame <device/head> sets the device/head coordinate frame
        -in <order_in> sets the order of the inside expansion
        -out <order_out> sets the order of the outside expansion
        -bad <chnos> sets the list of static bad channels
                               (logical chnos, e.g.: 0323 1042 2631)
        -autobad <on/off/n> sets automated bad channel detection on or off
                               n: scan from first n raw data tags (def n = 20)
        -badlimit <x> threshold for bad channel detection (>ave+x*SD)
        -skip <intervals> skips raw data sequences
                               time intervals pairs in sec, e.g.: 0 30 120 150
        -format <short/long/float>
                               stores the output in 16-bit short,
                               32-bit integer or float format
        -force ignores program warnings
        -def shows default settings
        -maint shows the options needed for maintenance
See also the archives of this email list (www.jiscmail.ac.uk/lists/NEUROMEG.html‎) which you may also want to join to hear about latest maxfilter updates.
Line 53: Line 34:
MaxST options:
        -st [<buflen>] applies the time-domain MaxST extension,
                               optionally set data buffer length (def 4 sec)
        -corr <th> set subspace correlation limit (def=0.98)
MaxMove options:
        -trans <fiff_file> | default
                               transforms the data into the coil definitions
                               of <fiff_file>, or into the default frame
        -movecomp [inter] estimates and compensates head movements
                               in continuous raw data
                               (optionally for intermittent HPI)
        -headpos estimates and stores head position parameters,
                               but does not compensate movements
        -hp <posfile> stores head position data in an ascii file
        -hpistep <n> sets head position update interval in ms
        -hpisubt <amp/base/off> subtracts hpi signals: sine amplitudes,
                               amp + baseline, or switch off (def = amp)
        -hpicons check initial consistency isotrak vs hpifit
        -linefreq <f> sets the basic line interference frequency
                               (50 or 60 Hz)
        -lpfilt <corner> applies low-pass IIR filtering
                               (def corner = 120 Hz)
Other options:
        -site <name> loads sss_cal_<name>.dat and ct_sparse_<name>.fif
        -cal <calfile> | off uses the fine-calibration in <calfile>,
                               or switch off
        -ctc <ctcfile> | off uses the cross-talk matrix in <ctcfile>,
                               or switch off
        -magbad marks all magnetometers bad
        -regularize on/off sets the component selection on or off
        -iterate [n] uses iterative pseudo-inverse, n iteration loops
                               default n=10; n=0 forces direct pseudo-inverse.
        -ds [f] applies downsampling with low-pass FIR filtering
                               f is optional downsampling factor (def = 2)
Other related Wiki pages:

 * [[Maxfilter_V2.2|Maxfilter 2.2]]
 * [[maxOlderVersions|Previous versions of Maxfilter (2.0/2.1)]]
 * [[maxoptions|Command line options]]
 * [[maxpreproc|Guideline(s) for data preprocessing]]
 * [[maxdiagnost|Maxfilter Output Diagnostics]]

mrclogo.gif

MaxFilter

Background

A common first step in analysing your data is to pre-processing them using the Maxfilter program. This Neuromag sofware implements "Signal-Space Separation" (SSS), which is a clever mathematical way to separate magnetic signals coming from within the brain (or more precisely, a sphere within the sensors) from those coming from outside the brain (or more precisely, from outside a sphere outside the sensors). There are several technical papers on Maxfilter theory and application by Samu Taulu et al.

Maxfilter is helpful for 1) removing noise originating from sources outside the sensor array, 2) detecting bad channels, 3) realigning (interpolating) data after movement (provided you have used continuous HPI) and 4) moving the data to a standard space (e.g, across subjects).

Maxfilter use at the CBU

Our latest Maxfilter version is Maxfilter 2.2.14 (but the previous version 2.2.12 is also in use).

The following example will apply Maxfilter including Signal Space Separation (SSS), its temporal extension (ST), and movement compensation.

maxfilter-2.2.14  -f input_file.fif  -o output_file.fif  -st  -origin 0 0 45  -frame head  -autobad on  -movecomp  -cal /neuro/databases_triux/sss/sss_cal.dat -ctc /neuro/databases_triux/ctc/ct_sparse.fif

If you are using data from our previous Vectorview machine, the last two options should be

-cal /neuro/databases_vectorview/sss/sss_cal.dat -ctc /neuro/databases_vectorview/ctc/ct_sparse.fif

For more information on these and other options, see the Maxfilter 2.2 manual..

Diagnostics

You can get information about movement parameters using these scripts to analyse maxfilter output.

See also the archives of this email list (www.jiscmail.ac.uk/lists/NEUROMEG.html‎) which you may also want to join to hear about latest maxfilter updates.

Other related Wiki pages:

CbuMeg: Maxfilter (last edited 2022-07-18 15:02:40 by OlafHauk)