C API Reference¶
Note that most programs have the options --version
and --help
which
give the version information and usage information, respectively.
List of components¶
Software components¶
Name |
Purpose |
|---|---|
An interactive analysis tool for computing source estimates, see Interactive analysis with mne_analyze. |
|
Average data across subjects. |
|
Interactive raw data browser. Includes filtering, offline averaging, and computation of covariance matrices, see Browsing raw data with mne_browse_raw. |
|
Computes the minimum-norm estimates, Most functionality is included in mne_make_movie. |
|
Compute the inverse solution from raw data see Computing inverse from raw and evoked data. |
|
Convert MNE data files to other file formats. |
|
Convenience script to calculate the forward solution matrix, see Computing the forward solution. |
|
Convenience script for inverse operator decomposition, see Calculating the inverse operator. |
|
Calculate the forward solution matrix, see Computing the forward solution. |
|
Compute the inverse operator decomposition see Inverse-operator decomposition. |
|
Make movies in batch mode, see Producing movies and snapshots. |
|
Create a fif source space description file, see Creating a surface-based source space. |
|
A batch-mode version of mne_browse_raw, see Browsing raw data with mne_browse_raw. |
|
Many intermediate result files contain a description of their ‘production environment’. Such files can be recreated easily with this utility. This is convenient if, for example, the selection of bad channels is changed and the inverse operator decomposition has to be recalculated. |
|
Works like mne_redo_file but does not try to change in to the working directory specified in the ‘production environment’. |
|
Set up the BEM-related fif files, see Setting up the boundary-element model. |
|
A convenience script to create the fif files describing the anatomical MRI data, see Setting up anatomical MR images for MRIlab |
|
A convenience script to create source space description file, see Setting up the source space. |
|
Show information about the production environment of a file. |
Utilities¶
Name |
Purpose |
|---|---|
Add neighborhood information to a source space file. |
|
Utility to add new information to the measurement info block of a fif file. The source of information is another fif file. |
|
Modify the trigger channel STI 014 in a raw data file. The same effect can be reached by using an event file for averaging in mne_process_raw and mne_browse_raw. |
|
Convert parcellation data into label files. |
|
Remove subject-specific information from a fif data file. |
|
Calculate an average of forward solutions, see Averaging forward solutions. |
|
Convert EEG data from BrainVision format to fif format. |
|
Change the dc offsets according to specifications given in a text file. |
|
Change the number of averages in an evoked-response data file. This is often necessary if the file was derived from several files. |
|
Checks that the EEG electrode locations have been correctly transferred from the Polhemus data block to the channel information tags |
|
Check the validity of a FreeSurfer surface file or one of the surfaces within a BEM file. This program simply checks for topological errors in surface files. |
|
Collect coordinate transformations from several sources into a single fif file. |
|
Change the applied software gradient compensation in an evoked-response data file, see Applying software gradient compensation. |
|
Copy the processing history between files. |
|
Convert digitization data between different formats. |
|
Convert the LISP format noise covariance matrix output by graph into fif. |
|
Convert the ncov format noise covariance file to fif. |
|
Convert FreeSurfer and text format surface files into Matlab mat files. |
|
Pick eigenvectors from a covariance matrix and create a signal-space projection (SSP) file out of them. |
|
Create a fif file containing software gradient compensation information from a text file. |
|
Convert a CTF ds folder into a fif file. |
|
Convert text format digitization data to fif format. |
|
List essential information from a DICOM file. This utility is used by the script mne_organize_dicom, see Organizing MRI data into directories. |
|
Convert EEG data from the EDF/EDF+/BDF formats to the fif format. |
|
Apply bandpass filter to raw data and extract epochs for subsequent processing in Matlab. |
|
List summary of averaged data from a fif file to the standard output. |
|
Convert EEG data from the Nexstim eXimia system to fif format. |
|
Fit a sphere to a surface given in fif or FreeSurfer format. |
|
Update the coil types for magnetometers in a fif file. |
|
Fix coding errors of trigger channel STI 014, see Cleaning the digital trigger channel. |
|
Create BEM tessellation using multi-echo FLASH MRI data, see Using FLASH images. |
|
Read Magnes compensation channel data from a text file and merge it with raw data from other channels in a fif file. |
|
Convert KIT data to FIF. |
|
List BEM information in text format. |
|
Create the coil description file. This is run automatically at when the software is set up, see Creating the coil definition file. |
|
List signal-space projection data from a fif file. |
|
List source space information in text format suitable for importing into Neuromag MRIlab. |
|
List versions and compilation dates of MNE software modules. |
|
Used by mne_setup_mri to create fif format MRI description files from COR or mgh/mgz format MRI data, see Setting up anatomical MR images for MRIlab. |
|
Create a channel derivation data file. |
|
Make a topographical trace layout file using the EEG electrode locations from an actual measurement. |
|
Precompute the mapping data needed for morphing between subjects, see Precomputing the morphing maps. |
|
Create a spatially uniform stc file for testing purposes. |
|
Update the list of unusable channels in a data file |
|
Morph label file definitions between subjects. |
|
Organized DICOM MRI image files into directories, see Organizing MRI data into directories. |
|
Perform the geometry calculations for BEM forward solutions, see Computing the BEM geometry data. |
|
Manipulate stc files. |
|
Convert raw data into a Matlab file. |
|
Change the names and types of channels in a fif file. |
|
Compute a sensitivity map and output the result in a w-file. |
|
Create a file containing the sensor locations in text format. |
|
List contents of a fif file. |
|
Simulate MEG and EEG data. |
|
Smooth a w or stc file. |
|
Create a fif file describing the triangulated compartment boundaries for the boundary-element model (BEM), see Creating the BEM meshes. |
|
Change data skip tags in a raw file into ignored skips or vice versa. |
|
Transform between MRI and MEG head coordinate frames. |
|
Convert EEG data from the Tufts University format to fif format. |
|
Starts a PDF reader to show this manual from its standard location. |
|
Convert volumetric data defined in a source space created with mne_volume_source_space into an MRI overlay. |
|
Make a volumetric source space, see Creating a volumetric or discrete source space. |
|
Do the segmentation for BEM using the watershed algorithm, see Using the watershed algorithm. |
Software component command-line arguments¶
mne_analyze¶
Since mne_analyze is primarily an interactive analysis tool, there are only a few command-line options:
\---cd <*dir*>
Change to this directory before starting.
\---subject <*name*>
Specify the default subject name for surface loading.
\---digtrig <*name*>
Name of the digital trigger channel. The default value is ‘STI 014’. Underscores in the channel name will be replaced by spaces.
\---digtrigmask <*number*>
Mask to be applied to the raw data trigger channel values before considering them. This option is useful if one wants to set some bits in a don’t care state. For example, some finger response pads keep the trigger lines high if not in use, i.e., a finger is not in place. Yet, it is convenient to keep these devices permanently connected to the acquisition system. The number can be given in decimal or hexadecimal format (beginning with 0x or 0X). For example, the value 255 (0xFF) means that only the lowest order byte (usually trigger lines 1 - 8 or bits 0 - 7) will be considered.
\---visualizehpi
Start mne_analyze in the restricted head position visualization mode. For details, see Visualizing the head position.
\---dig <*filename*>
Specify a file containing the head shape digitization data. This option is only usable if the head position visualization position visualization mode has been first invoked with the –visualizehpi option.
\---hpi <*filename*>
Specify a file containing the transformation between the MEG device and head coordinate frames. This option is only usable if the head position visualization position visualization mode has been first invoked with the
--visualizehpi
option.
\---scalehead
In head position visualization mode, scale the average scalp surface according to the head surface digitization data before aligning them to the scalp surface. This option is recommended.
\---rthelmet
Use the room-temperature helmet surface instead of the MEG sensor surface when showing the relative position of the MEG sensors and the head in the head position visualization mode.
Note
Before starting mne_analyze the SUBJECTS_DIR
environment variable has to be set.
Note
Strictly speaking, trigger mask value zero would mean that all trigger inputs are ignored. However, for convenience, setting the mask to zero or not setting it at all has the same effect as 0xFFFFFFFF, i.e., all bits set.
Note
The digital trigger channel can also be set with the MNE_TRIGGER_CH_NAME environment variable. Underscores in the variable value will not be replaced with spaces by mne_analyze . Using the --digtrig
option supersedes the MNE_TRIGGER_CH_NAME environment variable.
Note
The digital trigger channel mask can also be set with the MNE_TRIGGER_CH_MASK environment variable. Using the --digtrigmask
option supersedes the MNE_TRIGGER_CH_MASK environment variable.
mne_average_estimates¶
This is a utility for averaging data in stc files. It requires that all stc files represent data on one individual’s cortical surface and contain identical sets of vertices. mne_average_estimates uses linear interpolation to resample data in time as necessary. The command line arguments are:
---desc <filenname>
Specifies the description file for averaging. The format of this file is described below.
The description file¶
The description file for mne_average_estimates consists of a sequence of tokens, separated by whitespace (space, tab, or newline). If a token consists of several words it has to be enclosed in quotes. One or more tokens constitute an phrase, which has a meaning for the averaging definition. Any line starting with the pound sign (#) is a considered to be a comment line. There are two kinds of phrases in the description file: global and contextual. The global phrases have the same meaning independent on their location in the file while the contextual phrases have different effects depending on their location in the file.
There are three types of contexts in the description file: the global context, an input context, and the output context. In the beginning of the file the context is global for defining global parameters. The input context defines one of the input files (subjects) while the output context specifies the destination for the average.
The global phrases are:
tmin <*value/ms*>
The minimum time to be considered. The output stc file starts at this time point if the time ranges of the stc files include this time. Otherwise the output starts from the next later available time point.
tstep <*step/ms*>
Time step between consecutive movie frames, specified in milliseconds.
tmax <*value/ms*>
The maximum time point to be considered. A multiple of tstep will be added to the first time point selected until this value or the last time point in one of the input stc files is reached.
integ <:math:`\Delta t` /*ms*>
Integration time for each frame. Defaults to zero. The integration will be performed on sensor data. If the time specified for a frame is \(t_0\), the integration range will be \(t_0 - ^{\Delta t}/_2 \leq t \leq t_0 + ^{\Delta t}/_2\).
stc <*filename*>
Specifies an input stc file. The filename can be specified with one of the
-lh.stc
and-rh.stc
endings or without them. This phrase ends the present context and starts an input context.
deststc <*filename*>
Specifies the output stc file. The filename can be specified with one of the
-lh.stc
and-rh.stc
endings or without them. This phrase ends the present context and starts the output context.
lh
Process the left hemisphere. By default, both hemispheres are processed.
rh
Process the left hemisphere. By default, both hemispheres are processed.
The contextual phrases are:
weight <*value*>
Specifies the weight of the current data set. This phrase is valid in the input and output contexts.
abs
Specifies that the absolute value of the data should be taken. Valid in all contexts. If specified in the global context, applies to all subsequent input and output contexts. If specified in the input or output contexts, applies only to the data associated with that context.
pow <*value*>
Specifies that the data should raised to the specified power. For negative values, the absolute value of the data will be taken and the negative sign will be transferred to the result, unless abs is specified. Valid in all contexts. Rules of application are identical to abs .
sqrt
Means pow 0.5
The effects of the options can be summarized as follows. Suppose that the description file includes \(P\) contexts and the temporally resampled data are organized in matrices \(S^{(p)}\), where \(p = 1 \dotso P\) is the subject index, and the rows are the signals at different vertices of the cortical surface. The average computed by mne_average_estimates is then:
with
and
In the above, \(\beta_p\) and \(w_p\) are the powers and weights assigned to each of the subjects whereas \(\beta\) and \(w\) are the output weight and power value, respectively. The sign is either included (\(\alpha_p = 1\), \(\alpha = 1\)) or omitted (\(\alpha_p = 2\), \(\alpha = 2\)) depending on the presence of abs phrases in the description file.
Note
mne_average_estimates requires that the number of vertices in the stc files are the same and that the vertex numbers are identical. This will be the case if the files have been produced in mne_make_movie using the --morph
option.
Note
It is straightforward to read and write stc files using the MNE Matlab toolbox described in MNE-MATLAB toolbox and thus write custom Matlab functions to realize more complicated custom group analysis tools.
mne_browse_raw¶
--cd <*dir*>
Change to this directory before starting.
--raw <*name*>
Specifies the raw data file to be opened. If a raw data file is not specified, an empty interactive browser will open.
--grad <*number*>
Apply software gradient compensation of the given order to the data loaded with the
--raw
option. This option is effective only for data acquired with the CTF and 4D Magnes MEG systems. If orders different from zero are requested for Neuromag data, an error message appears and data are not loaded. Any compensation already existing in the file can be undone or changed to another order by using an appropriate--grad
options. Possible orders are 0 (No compensation), 1 - 3 (CTF data), and 101 (Magnes data). This applies only to the data file loaded by specifying the--raw
option. For interactive data loading, the software gradient compensation is specified in the corresponding file selection dialog, see Open.
--filtersize <*size*>
Adjust the length of the FFT to be applied in filtering. The number will be rounded up to the next power of two. If the size is \(N\), the corresponding length of time is \(N/f_s\), where \(f_s\) is the sampling frequency of your data. The filtering procedure includes overlapping tapers of length \(N/2\) so that the total FFT length will actually be \(2N\). This value cannot be changed after the program has been started.
--highpass <*value/Hz*>
Highpass filter frequency limit. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
--highpassw <*value/Hz*>
The width of the transition band of the highpass filter. The default is 6 frequency bins, where one bin is \(f_s / (2N)\). This value cannot be adjusted in the interactive version of the program.
--lowpass <*value/Hz*>
Lowpass filter frequency limit. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
--lowpassw <*value/Hz*>
The width of the transition band of the lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
--eoghighpass <*value/Hz*>
Highpass filter frequency limit for EOG. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
--eoghighpassw <*value/Hz*>
The width of the transition band of the EOG highpass filter. The default is 6 frequency bins, where one bin is \(f_s / (2N)\). This value cannot be adjusted in the interactive version of the program.
--eoglowpass <*value/Hz*>
Lowpass filter frequency limit for EOG. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
--eoglowpassw <*value/Hz*>
The width of the transition band of the EOG lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
--filteroff
Do not filter the data. This initial value can be changed in the interactive version of the program.
--digtrig <*name*>
Name of the composite digital trigger channel. The default value is ‘STI 014’. Underscores in the channel name will be replaced by spaces.
--digtrigmask <*number*>
Mask to be applied to the trigger channel values before considering them. This option is useful if one wants to set some bits in a don’t care state. For example, some finger response pads keep the trigger lines high if not in use, i.e., a finger is not in place. Yet, it is convenient to keep these devices permanently connected to the acquisition system. The number can be given in decimal or hexadecimal format (beginning with 0x or 0X). For example, the value 255 (0xFF) means that only the lowest order byte (usually trigger lines 1 - 8 or bits 0 - 7) will be considered.
--allowmaxshield
Allow loading of unprocessed Elekta-Neuromag data with MaxShield on. These kind of data should never be used for source localization without further processing with Elekta-Neuromag software.
--deriv <*name*>
Specifies the name of a derivation file. This overrides the use of a standard derivation file, see Load derivations.
--sel <*name*>
Specifies the channel selection file to be used. This overrides the use of the standard channel selection files, see Selection.
Note
Strictly speaking, trigger mask value zero would mean that all trigger inputs are ignored. However, for convenience, setting the mask to zero or not setting it at all has the same effect as 0xFFFFFFFF, i.e., all bits set.
Note
The digital trigger channel can also be set with the MNE_TRIGGER_CH_NAME environment variable. Underscores in the variable value will not be replaced with spaces. Using the --digtrig
option supersedes the MNE_TRIGGER_CH_NAME environment variable.
Note
The digital trigger channel mask can also be set with the MNE_TRIGGER_CH_MASK environment variable. Using the --digtrigmask
option supersedes the MNE_TRIGGER_CH_MASK environment variable.
mne_compute_mne¶
This program is gradually becoming obsolete. All of its functions will be eventually included to mne_make_movie, see Producing movies and snapshots. At this time, mne_compute_mne is still needed to produce time-collapsed w files unless you are willing to write a Matlab script of your own for this purpose.
--inv <*name*>
Load the inverse operator decomposition from here.
--meas <*name*>
Load the MEG or EEG data from this file.
--set <*number*>
The data set (condition) number to load. The list of data sets can be seen, e.g., in mne_analyze , mne_browse_raw , and xplotter .
--bmin <*time/ms*>
Specifies the starting time of the baseline. In order to activate baseline correction, both
--bmin
and--bmax
options must be present.
--bmax <*time/ms*>
Specifies the finishing time of the baseline.
--nave <*value*>
Specifies the number of averaged epochs in the input data. If the input data file is one produced by mne_process_raw or mne_browse_raw , the number of averages is correct in the file. However, if subtractions or some more complicated combinations of simple averages are produced, e.g., by using the xplotter software, the number of averages should be manually adjusted. This is accomplished either by employing this flag or by adjusting the number of averages in the data file with help of mne_change_nave .
--snr <*value*>
An estimate for the amplitude SNR. The regularization parameter will be set as \(\lambda = ^1/_{\text{SNR}}\). If the SNR option is absent, the regularization parameter will be estimated from the data. The regularization parameter will be then time dependent.
--snronly
Only estimate SNR and output the result into a file called SNR. Each line of the file contains three values: the time point in ms, the estimated SNR + 1, and the regularization parameter estimated from the data at this time point.
--abs
Calculate the absolute value of the current and the dSPM for fixed-orientation data.
--spm
Calculate the dSPM instead of the expected current value.
--chi2
Calculate an approximate \(\chi_2^3\) statistic instead of the F statistic. This is simply accomplished by multiplying the F statistic by three.
--sqrtF
Take the square root of the \(\chi_2^3\) or F statistic before outputting the stc file.
--collapse
Make all frames in the stc file (or the wfile) identical. The value at each source location is the maximum value of the output quantity at this location over the analysis period. This option is convenient for determining the correct thresholds for the rendering of the final brain-activity movies.
--collapse1
Make all frames in the stc file (or the wfile) identical. The value at each source location is the \(L_1\) norm of the output quantity at this location over the analysis period.
--collapse2
Make all frames in the stc file (or the wfile) identical. The value at each source location is the \(L_2\) norm of the output quantity at this location over the analysis period.
--SIcurrents
Output true current values in SI units (Am). By default, the currents are scaled so that the maximum current value is set to 50 (Am).
--out <*name*>
Specifies the output file name. This is the ‘stem’ of the output file name. The actual name is derived by removing anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. Finally,.stc
or.w
is added, depending on the output file type.
--wfiles
Use binary w-files in the output whenever possible. The noise-normalization factors can be always output in this format. The current estimates and dSPMs can be output as wfiles if one of the collapse options is selected.
--pred <*name*>
Save the predicted data into this file. This is a fif file containing the predicted data waveforms, see Predicted data.
--outputnorm <*name*>
Output noise-normalization factors to this file.
--invnorm
Output inverse noise-normalization factors to the file defined by the
--outputnorm
option.
--dip <*name*>
Specifies a dipole distribution snapshot file. This is a file containing the current distribution at a time specified with the
--diptime
option. The file format is the ASCII dip file format produced by the Neuromag source modelling software (xfit). Therefore, the file can be loaded to the Neuromag MRIlab MRI viewer to display the actual current distribution. This option is only effective if the--spm
option is absent.
--diptime <*time/ms*>
Time for the dipole snapshot, see
--dip
option above.
--label <*name*>
Label to process. The label files are produced by tksurfer and specify regions of interests (ROIs). A label file name should end with
-lh.label
for left-hemisphere ROIs and with-rh.label
for right-hemisphere ones. The corresponding output files are tagged with-lh-
<data type.amp
and-rh-
<data type.amp
, respectively. <data type> equalsMNE
for expected current data andspm
for dSPM data. Each line of the output file contains the waveform of the output quantity at one of the source locations falling inside the ROI.
Note
The --tmin
and --tmax
options which existed in previous versions of mne_compute_mne have been removed. mne_compute_mne can now process only the entire averaged epoch.
mne_compute_raw_inverse¶
--in <*filename*>
Specifies the input data file. This can be either an evoked data file or a raw data file.
--bmin <*time/ms*>
Specifies the starting time of the baseline. In order to activate baseline correction, both
--bmin
and--bmax
options must be present. This option applies to evoked data only.
--bmax <*time/ms*>
Specifies the finishing time of the baseline. This option applies to evoked data only.
--set <*number*>
The data set (condition) number to load. This is the sequential number of the condition. You can easily see the association by looking at the condition list in mne_analyze when you load the file.
--inv <*name*>
Load the inverse operator decomposition from here.
--nave <*value*>
Specifies the effective number of averaged epochs in the input data, \(L_{eff}\), as discussed in Effective number of averages. If the input data file is one produced by mne_browse_raw or mne_process_raw , the number of averages is correct in the file. However, if subtractions or some more complicated combinations of simple averages are produced, e.g., by using the xplotter software, the number of averages should be manually adjusted along the guidelines given in Effective number of averages. This is accomplished either by employing this flag or by adjusting the number of averages in the data file with help of the utility mne_change_nave .
--snr <*value*>
An estimate for the amplitude SNR. The regularization parameter will be set as \(\lambda^2 = 1/SNR^2\). The default value is SNR = 1. Automatic selection of the regularization parameter is currently not supported.
--spm
Calculate the dSPM instead of the expected current value.
--picknormalcomp
The components of the estimates corresponding to directions tangential with the cortical mantle are zeroed out.
--mricoord
Provide source locations and orientations in the MRI coordinate frame instead of the default head coordinate frame.
--label <*name*>
Specifies a label file to process. For each label file, the values of the computed estimates stored in a fif file. For more details, see Implementation details. The label files are produced by tksurfer or mne_analyze and specify regions of interests (ROIs). A label file name should end with
-lh.label
for left-hemisphere ROIs and with-rh.label
for right-hemisphere ones. The corresponding output files are tagged with-lh-
<data type>.fif
and-rh-
<data type>.fif
, respectively. <data type> equals'mne
‘ for expected current data and'spm
‘ for dSPM data. For raw data,_raw.fif
is employed instead of.fif
. The output files are stored in the same directory as the label files.
--labelselout
Produces additional label files for each label processed, containing only those vertices within the input label which correspond to available source space vertices in the inverse operator. These files have the same name as the original label except that
-lh
and-rh
are replaced by-sel-lh
and-sel-rh
, respectively.
--align_z
Instructs the program to try to align the waveform signs within the label. For more information, see Implementation details. This flag will not have any effect if the inverse operator has been computed with the strict orientation constraint active.
--labeldir <*directory*>
All previous
--label
options will be ignored when this option is encountered. For each label in the directory, the output file defined with the--out
option will contain a summarizing waveform which is the average of the waveforms in the vertices of the label. The--labeldir
option implies--align_z
and--picknormalcomp
options.
--orignames
This option is used with the
--labeldir
option, above. With this option, the output file channel names will be the names of the label files, truncated to 15 characters, instead of names containing the vertex numbers.
--out <*name*>
Required with
--labeldir
. This is the output file for the data.
--extra <*name*>
By default, the output includes the current estimate signals and the digital trigger channel, see
--digtrig
option, below. With the--extra
option, a custom set of additional channels can be included. The extra channel text file should contain the names of these channels, one channel name on each line. With this option present, the digital trigger channel is not included unless specified in the extra channel file.
--noextra
No additional channels will be included with this option present.
--digtrig <*name*>
Name of the composite digital trigger channel. The default value is ‘STI 014’. Underscores in the channel name will be replaced by spaces.
--split <*size/MB*>
Specifies the maximum size of the raw data files saved. By default, the output is split into files which are just below 2 GB so that the fif file maximum size is not exceed.
Note
The digital trigger channel can also be set with the MNE_TRIGGER_CH_NAME environment variable. Underscores in the variable value will not be replaced with spaces by mne_compute_raw_inverse . Using the --digtrig
option supersedes the MNE_TRIGGER_CH_NAME environment variable.
mne_convert_mne_data¶
This utility allows the conversion of various fif files related to the MNE computations to other formats. The two principal purposes of this utility are to facilitate development of new analysis approaches with Matlab and conversion of the forward model and noise covariance matrix data into evoked-response type fif files, which can be accessed and displayed with the Neuromag source modelling software.
Note
Most of the functions of mne_convert_mne_data are now covered by the MNE Matlab toolbox covered in MNE-MATLAB toolbox. This toolbox is recommended to avoid creating additional files occupying disk space.
The command-line options recognized by mne_convert_mne_data are:
--fwd <*name*>
Specity the name of the forward solution file to be converted. Channels specified with the
--bad
option will be excluded from the file.
--fixed
Convert the forward solution to the fixed-orientation mode before outputting the converted file. With this option only the field patterns corresponding to a dipole aligned with the estimated cortex surface normal are output.
--surfsrc
When outputting a free-orientation forward model (three orthogonal dipole components present) rotate the dipole coordinate system at each source node so that the two tangential dipole components are output first, followed by the field corresponding to the dipole aligned with the estimated cortex surface normal. The orientation of the first two dipole components in the tangential plane is arbitrarily selected to create an orthogonal coordinate system.
--noiseonly
When creating a ‘measurement’ fif file, do not output a forward model file, just the noise-covariance matrix.
--senscov <*name*>
Specifies the fif file containing a sensor covariance matrix to be included with the output. If no other input files are specified only the covariance matrix is output
--srccov <*name*>
Specifies the fif file containing the source covariance matrix to be included with the output. Only diagonal source covariance files can be handled at the moment.
--bad <*name*>
Specifies the name of the file containing the names of the channels to be omitted, one channel name per line. This does not affect the output of the inverse operator since the channels have been already selected when the file was created.
--fif
Output the forward model and the noise-covariance matrix into ‘measurement’ fif files. The forward model files are tagged with <modalities>
-meas-fwd.fif
and the noise-covariance matrix files with <modalities>-meas-cov.fif
. Here, modalities is-meg
if MEG is included,-eeg
if EEG is included, and-meg-eeg
if both types of signals are present. The inclusion of modalities is controlled by the--meg
and--eeg
options.
--mat
Output the data into MATLAB mat files. This is the default. The forward model files are tagged with <modalities>
-fwd.mat
forward model and noise-covariance matrix output, with-inv.mat
for inverse operator output, and with-inv-meas.mat
for combined inverse operator and measurement data output, respectively. The meaning of <modalities> is the same as in the fif output, described above.
--tag <*name*>
By default, all variables in the matlab output files start with
mne\_
. This option allows to change this prefix to <name> _.
--meg
Include MEG channels from the forward solution and noise-covariance matrix.
--eeg
Include EEG channels from the forward solution and noise-covariance matrix.
--inv <*name*>
Output the inverse operator data from the specified file into a mat file. The source and noise covariance matrices as well as active channels have been previously selected when the inverse operator was created with mne_inverse_operator . Thus the options
--meg
,--eeg
,--senscov
,--srccov
,--noiseonly
, and--bad
do not affect the output of the inverse operator.
--meas <*name*>
Specifies the file containing measurement data to be output together with the inverse operator. The channels corresponding to the inverse operator are automatically selected from the file if
--inv
. option is present. Otherwise, the channel selection given with--sel
option will be taken into account.
--set <*number*>
Select the data set to be output from the measurement file.
--bmin <*value/ms*>
Specifies the baseline minimum value setting for the measurement signal output.
--bmax <*value/ms*>
Specifies the baseline maximum value setting for the measurement signal output.
Note
The --tmin
and --tmax
options which existed in previous versions of mne_converted_mne_data have been removed. If output of measurement data is requested, the entire averaged epoch is now included.
Guide to combining options¶
The combination of options is quite complicated. The Guide to combining mne_convert_mne_data options. should be helpful to determine the combination of options appropriate for your needs.
Desired output |
Format |
Required options |
Optional options |
forward model |
fif |
—fwd <name> —out <name> —meg and/or —eeg —fif |
—bad <name> —surfsrc |
forward model |
mat |
—fwd <name> —out <name> —meg and/or –eeg |
—bad <name> —surfsrc |
forward model and sensor covariance |
mat |
—fwd <name> —out <name> —senscov <name> —meg and/or –eeg |
—bad <name> —surfsrc |
sensor covariance |
fif |
—fwd <name> —out <name> —senscov <name> —noiseonly —fif —meg and/or –eeg |
—bad <name> |
sensor covariance |
mat |
—senscov <name> —out <name> |
—bad <name> |
sensor covariance eigenvalues |
text |
—senscov <name> —out <name> —eig |
—bad <name> |
evoked MEG/EEG data |
mat |
—meas <name> —out <name> |
—sel <name> —set <number> |
evoked MEG/EEG data forward model |
mat |
—meas <name> —fwd <name> —out <name> |
—bad <name> —set <number> |
inverse operator data |
mat |
—inv <name> —out <name> |
|
inverse operator data evoked MEG/EEG data |
mat |
––inv <name> ––meas <name> ––out <name> |
Matlab data structures¶
The Matlab output provided by mne_convert_mne_data is organized in structures, listed in Matlab structures produced by mne_convert_mne_data.. The fields occurring in these structures are listed in The fields of Matlab structures..
The symbols employed in variable size descriptions are:
nloc
Number of source locations
nsource
Number of sources. For fixed orientation sources nsource = nloc whereas nsource = 3*nloc for free orientation sources
nchan
Number of measurement channels.
ntime
Number of time points in the measurement data.
Structure |
Contents |
|---|---|
<tag> _meas |
Measured data |
<tag> _inv |
The inverse operator decomposition |
<tag> _fwd |
The forward solution |
<tag> _noise |
A standalone noise-covariance matrix |
The prefix given with the --tag
option is indicated <tag> , see mne_convert_mne_data. Its default value is MNE.
Variable |
Size |
Description |
fwd |
nsource x nchan |
The forward solution, one source on each row. For free orientation sources, the fields of the three orthogonal dipoles for each location are listed consecutively. |
names ch_names |
nchan (string) |
String array containing the names of the channels included |
ch_types |
nchan x 2 |
The column lists the types of the channels (1 = MEG, 2 = EEG). The second column lists the coil types, see Normal coil descriptions. and Accurate coil descriptions. For EEG electrodes, this value equals one. |
ch_pos |
nchan x 3 |
The location information for each channel. The first three values specify the origin of the sensor coordinate system or the location of the electrode. For MEG channels, the following nine number specify the x, y, and z-direction unit vectors of the sensor coordinate system. For EEG electrodes the first unit vector specifies the location of the reference electrode. If the reference is not specified this value is all zeroes. The remaining unit vectors are irrelevant for EEG electrodes. |
ch_lognos |
nchan x 1 |
Logical channel numbers as listed in the fiff file |
ch_units |
nchan x 2 |
Units and unit multipliers as listed in the fif file. The unit of the data is listed in the first column (T = 112, T/m = 201, V = 107). At present, the second column will be always zero, i.e., no unit multiplier. |
ch_cals |
nchan x 2 |
Even if the data comes from the conversion already calibrated, the original calibration factors are included. The first column is the range member of the fif data structures and while the second is the cal member. To get calibrated values in the units given in ch_units from the raw data, the data must be multiplied with the product of range and cal. |
sfreq |
1 |
The sampling frequency in Hz. |
lowpass |
1 |
Lowpass filter frequency (Hz) |
highpass |
1 |
Highpass filter frequency (Hz) |
source_loc |
nloc x 3 |
The source locations given in the coordinate frame indicated by the coord_frame member. |
source_ori |
nsource x 3 |
The source orientations |
source_selection |
nsource x 2 |
Indication of the sources selected from the complete source spaces. Each row contains the number of the source in the complete source space (starting with 0) and the source space number (1 or 2). These numbers refer to the order the two hemispheres where listed when mne_make_source_space was invoked. mne_setup_source_space lists the left hemisphere first. |
coord_frame |
string |
Name of the coordinate frame employed in the forward calculations. Possible values are ‘head’ and ‘mri’. |
mri_head_trans |
4 x 4 |
The coordinate frame transformation from mri the MEG ‘head’ coordinates. |
meg_head_trans |
4 x 4 |
The coordinate frame transformation from the MEG device coordinates to the MEG head coordinates |
noise_cov |
nchan x nchan |
The noise covariance matrix |
source_cov |
nsource |
The elements of the diagonal source covariance matrix. |
sing |
nchan |
The singular values of \(A = C_0^{-^1/_2} G R^C = U \Lambda V^T\) with \(R\) selected so that \(\text{trace}(AA^T) / \text{trace}(I) = 1\) as discussed in Whitening and scaling |
eigen_fields |
nchan x nchan |
The rows of this matrix are the left singular vectors of \(A\), i.e., the columns of \(U\), see above. |
eigen_leads |
nchan x nsource |
The rows of this matrix are the right singular vectors of \(A\), i.e., the columns of \(V\), see above. |
noise_eigenval |
nchan |
In terms of Whitening and scaling, eigenvalues of \(C_0\), i.e., not scaled with number of averages. |
noise_eigenvec |
nchan |
Eigenvectors of the noise covariance matrix. In terms of Whitening and scaling, \(U_C^T\). |
data |
nchan x ntime |
The measured data. One row contains the data at one time point. |
times |
ntime |
The time points in the above matrix in seconds |
nave |
1 |
Number of averages as listed in the data file. |
meas_times |
ntime |
The time points in seconds. |
Note
The Matlab files can also be read in Python using scipy.io.loadmat()
mne_do_forward_solution¶
This utility accepts the following options:
--subject <*subject*>
Defines the name of the subject. This can be also accomplished by setting the SUBJECT environment variable.
--src <*name*>
Source space name to use. This option overrides the
--spacing
option. The source space is searched first from the current working directory and then from$SUBJECTS_DIR/
<subject> /bem. The source space file must be specified exactly, including thefif
extension.
--spacing <*spacing/mm*> or ``ico-
<number or ``oct-`` <*number>``
This is an alternate way to specify the name of the source space file. For example, if
--spacing 6
is given on the command line, the source space files searched for are./<subject> -6-src.fif and$SUBJECTS_DIR/$SUBJECT/
bem/<subject> -6-src.fif. The first file found is used. Spacing defaults to 7 mm.
--bem <*name*>
Specifies the BEM to be used. The name of the file can be any of <name> , <name> -bem.fif, <name> -bem-sol.fif. The file is searched for from the current working directory and from
bem
. If this option is omitted, the most recent BEM file in thebem
directory is used.
--mri <*name*>
The name of the MRI description file containing the MEG/MRI coordinate transformation. This file was saved as part of the alignment procedure outlined in Aligning coordinate frames. The file is searched for from the current working directory and from
mri/T1-neuromag/sets
. The search order for MEG/MRI coordinate transformations is discussed below.
--trans <*name*>
The name of a text file containing the 4 x 4 matrix for the coordinate transformation from head to mri coordinates, see below. If the option
--trans
is present, the--mri
option is not required. The search order for MEG/MRI coordinate transformations is discussed below.
--meas <*name*>
This file is the measurement fif file or an off-line average file produced thereof. It is recommended that the average file is employed for evoked-response data and the original raw data file otherwise. This file provides the MEG sensor locations and orientations as well as EEG electrode locations as well as the coordinate transformation between the MEG device coordinates and MEG head-based coordinates.
--fwd <*name*>
This file will contain the forward solution as well as the coordinate transformations, sensor and electrode location information, and the source space data. A name of the form <name>
-fwd.fif
is recommended. If this option is omitted the forward solution file name is automatically created from the measurement file name and the source space name.
--destdir <*directory*>
Optionally specifies a directory where the forward solution will be stored.
--mindist <*dist/mm*>
Omit source space points closer than this value to the inner skull surface. Any source space points outside the inner skull surface are automatically omitted. The use of this option ensures that numerical inaccuracies for very superficial sources do not cause unexpected effects in the final current estimates. Suitable value for this parameter is of the order of the size of the triangles on the inner skull surface. If you employ the seglab software to create the triangulations, this value should be about equal to the wish for the side length of the triangles.
--megonly
Omit EEG forward calculations.
--eegonly
Omit MEG forward calculations.
--all
Compute the forward solution for all vertices on the source space.
--overwrite
Overwrite the possibly existing forward model file.
--help
Show usage information for the script.
The MEG/MRI transformation is determined by the following search sequence:
If the
--mri
option was present, the file is looked for literally as specified, in the directory of the measurement file specified with the--meas
option, and in the directory $SUBJECTS_DIR/$SUBJECT/mri/T1-neuromag/sets. If the file is not found, the script exits with an error message.If the
--trans
option was present, the file is looked up literally as specified. If the file is not found, the script exists with an error message.If neither
--mri
nor--trans
option was not present, the following default search sequence is engaged:The
.fif
ending in the measurement file name is replaced by-trans.fif
. If this file is present, it will be used.The newest file whose name ends with
-trans.fif
in the directory of the measurement file is looked up. If such a file is present, it will be used.The newest file whose name starts with
COR-
in directory $SUBJECTS_DIR/$SUBJECT/mri/T1-neuromag/sets is looked up. If such a file is present, it will be used.If all the above searches fail, the script exits with an error message.
This search sequence is designed to work well with the MEG/MRI transformation files output by mne_analyze , see Coordinate frame alignment. It is recommended that -trans.fif file saved with the Save default and Save… options in the mne_analyze alignment dialog are used because then the $SUBJECTS_DIR/$SUBJECT directory will be composed of files which are dependent on the subjects’s anatomy only, not on the MEG/EEG data to be analyzed.
Note
If the standard MRI description file and BEM file selections are appropriate and the 7-mm source space grid spacing is appropriate, only the --meas
option is necessary. If EEG data is not used --megonly
option should be included.
Note
If it is conceivable that the current-density transformation will be incorporated into the inverse operator, specify a source space with patch information for the forward computation. This is not mandatory but saves a lot of time when the inverse operator is created, since the patch information does not need to be created at that stage.
Note
The MEG head to MRI transformation matrix specified with the --trans
option should be a text file containing a 4-by-4 matrix:
defined so that if the augmented location vectors in MRI head and MRI coordinate systems are denoted by \(r_{head}[x_{head}\ y_{head}\ z_{head}\ 1]\) and \(r_{MRI}[x_{MRI}\ y_{MRI}\ z_{MRI}\ 1]\), respectively,
Note
It is not possible to calculate an EEG forward solution with a single-layer BEM.
mne_do_inverse_operator¶
--fwd <*name of the forward solution file*>
This is the forward solution file produced in the computations step described in Computing the forward solution.
--meg
Employ MEG data in the inverse calculation. If neither
--meg
nor--eeg
is set only MEG channels are included.
--eeg
Employ EEG data in the inverse calculation. If neither
--meg
nor--eeg
is set only MEG channels are included.
--fixed
Use fixed source orientations normal to the cortical mantle. By default, the source orientations are not constrained. If
--fixed
is specified, the--loose
flag is ignored.
--loose <*amount*>
Use a ‘loose’ orientation constraint. This means that the source covariance matrix entries corresponding to the current component normal to the cortex are set equal to one and the transverse components are set to <amount> . Recommended value of amount is 0.1…0.6.
--depth
Employ depth weighting with the standard settings. For details, see Depth weighting and Inverse-operator decomposition.
--bad <*name*>
Specifies a text file to designate bad channels, listed one channel name (like MEG 1933) on each line of the file. Be sure to include both noisy and flat (non-functioning) channels in the list. If bad channels were designated using mne_mark_bad_channels in the measurement file which was specified with the
--meas
option when the forward solution was computed, the bad channel information will be automatically included. Also, any bad channel information in the noise-covariance matrix file will be included.
--noisecov <*name*>
Name of the noise-covariance matrix file computed with one of the methods described in Computing the noise-covariance matrix. By default, the script looks for a file whose name is derived from the forward solution file by replacing its ending
-
<anything>-fwd.fif
by-cov.fif
. If this file contains a projection operator, which will automatically attached to the noise-covariance matrix by mne_browse_raw and mne_process_raw , no--proj
option is necessary because mne_inverse_operator will automatically include the projectors from the noise-covariance matrix file. For backward compatibility, –senscov can be used as a synonym for –noisecov.
--noiserank <*value*>
Specifies the rank of the noise covariance matrix explicitly rather than trying to reduce it automatically. This option is sheldom needed,
--megreg <*value*>
Regularize the MEG part of the noise-covariance matrix by this amount. Suitable values are in the range 0.05…0.2. For details, see Regularization of the noise-covariance matrix.
--eegreg <*value*>
Like
--megreg
but applies to the EEG channels.
--diagnoise
Omit the off-diagonal terms of the noise covariance matrix. This option is irrelevant to most users.
--fmri <*name*>
With help of this w file, an a priori weighting can be applied to the source covariance matrix. The source of the weighting is usually fMRI but may be also some other data, provided that the weighting can be expressed as a scalar value on the cortical surface, stored in a w file. It is recommended that this w file is appropriately smoothed (see About smoothing) in mne_analyze , tksurfer or with mne_smooth_w to contain nonzero values at all vertices of the triangular tessellation of the cortical surface. The name of the file given is used as a stem of the w files. The actual files should be called <name>
-lh.pri
and <name>-rh.pri
for the left and right hemisphere weight files, respectively. The application of the weighting is discussed in fMRI-guided estimates.
--fmrithresh <*value*>
This option is mandatory and has an effect only if a weighting function has been specified with the
--fmri
option. If the value is in the a priori files falls below this value at a particular source space point, the source covariance matrix values are multiplied by the value specified with the--fmrioff
option (default 0.1). Otherwise it is left unchanged.
--fmrioff <*value*>
The value by which the source covariance elements are multiplied if the a priori weight falls below the threshold set with
--fmrithresh
, see above.
--srccov <*name*>
Use this diagonal source covariance matrix. By default the source covariance matrix is a multiple of the identity matrix. This option is irrelevant to most users.
--proj <*name*>
Include signal-space projection information from this file.
--inv <*name*>
Save the inverse operator decomposition here. By default, the script looks for a file whose name is derived from the forward solution file by replacing its ending
-fwd.fif
by <options>-inv.fif
, where <options> includes options--meg
,--eeg
, and--fixed
with the double dashes replaced by single ones.
--destdir <*directory*>
Optionally specifies a directory where the inverse operator will be stored.
Note
If bad channels are included in the calculation, strange results may ensue. Therefore, it is recommended that the data to be analyzed is carefully inspected with to assign the bad channels correctly.
Note
For convenience, the MNE software includes bad-channel designation files which can be used to ignore all magnetometer or all gradiometer channels in Vectorview measurements. These files are called vv_grad_only.bad
and vv_mag_only.bad
, respectively. Both files are located in $MNE_ROOT/share/mne/templates
.
mne_forward_solution¶
--src <*name*>
Source space name to use. The name of the file must be specified exactly, including the directory. Typically, the source space files reside in $SUBJECTS_DIR/$SUBJECT/bem.
--bem <*name*>
Specifies the BEM to be used. These files end with bem.fif or bem-sol.fif and reside in $SUBJECTS_DIR/$SUBJECT/bem. The former file contains only the BEM surface information while the latter files contain the geometry information precomputed with mne_prepare_bem_model, see Computing the BEM geometry data. If precomputed geometry is not available, the linear collocation solution will be computed by mne_forward_solution .
--origin <*x/mm*> : <*x/mm*> : <*z/mm*>
Indicates that the sphere model should be used in the forward calculations. The origin is specified in MEG head coordinates unless the
--mricoord
option is present. The MEG sphere model solution computed using the analytical Sarvas formula. For EEG, an approximative solution described in
--eegmodels <*name*>
This option is significant only if the sphere model is used and EEG channels are present. The specified file contains specifications of the EEG sphere model layer structures as detailed in The EEG sphere model definition file. If this option is absent the file
$HOME/.mne/EEG_models
will be consulted if it exists.
--eegmodel <*model name*>
Specifies the name of the sphere model to be used for EEG. If this option is missing, the model Default will be employed, see The EEG sphere model definition file.
--eegrad <*radius/mm*>
Specifies the radius of the outermost surface (scalp) of the EEG sphere model, see The EEG sphere model definition file. The default value is 90 mm.
--eegscalp
Scale the EEG electrode locations to the surface of the outermost sphere when using the sphere model.
--accurate
Use accurate MEG sensor coil descriptions. This is the recommended choice. More information
--fixed
Compute the solution for sources normal to the cortical mantle only. This option should be used only for surface-based and discrete source spaces.
--all
Compute the forward solution for all vertices on the source space.
--label <*name*>
Compute the solution only for points within the specified label. Multiple labels can be present. The label files should end with
-lh.label
or-rh.label
for left and right hemisphere label files, respectively. If--all
flag is present, all surface points falling within the labels are included. Otherwise, only decimated points with in the label are selected.
--mindist <*dist/mm*>
Omit source space points closer than this value to the inner skull surface. Any source space points outside the inner skull surface are automatically omitted. The use of this option ensures that numerical inaccuracies for very superficial sources do not cause unexpected effects in the final current estimates. Suitable value for this parameter is of the order of the size of the triangles on the inner skull surface. If you employ the seglab software to create the triangulations, this value should be about equal to the wish for the side length of the triangles.
--mindistout <*name*>
Specifies a file name to contain the coordinates of source space points omitted due to the
--mindist
option.
--mri <*name*>
The name of the MRI description file containing the MEG/MRI coordinate transformation. This file was saved as part of the alignment procedure outlined in Aligning coordinate frames. These files typically reside in
$SUBJECTS_DIR/$SUBJECT/mri/T1-neuromag/sets
.
--trans <*name*>
The name of a text file containing the 4 x 4 matrix for the coordinate transformation from head to mri coordinates. With
--trans
,--mri
option is not required.
--notrans
The MEG/MRI coordinate transformation is taken as the identity transformation, i.e., the two coordinate systems are the same. This option is useful only in special circumstances. If more than one of the
--mri
,--trans
, and--notrans
options are specified, the last one remains in effect.
--mricoord
Do all computations in the MRI coordinate system. The forward solution matrix is not affected by this option if the source orientations are fixed to be normal to the cortical mantle. If all three source components are included, the forward three source orientations parallel to the coordinate axes is computed. If
--mricoord
is present, these axes correspond to MRI coordinate system rather than the default MEG head coordinate system. This option is useful only in special circumstances.
--meas <*name*>
This file is the measurement fif file or an off-line average file produced thereof. It is recommended that the average file is employed for evoked-response data and the original raw data file otherwise. This file provides the MEG sensor locations and orientations as well as EEG electrode locations as well as the coordinate transformation between the MEG device coordinates and MEG head-based coordinates.
--fwd <*name*>
This file will contain the forward solution as well as the coordinate transformations, sensor and electrode location information, and the source space data. A name of the form <name>-fwd.fif is recommended.
--meg
Compute the MEG forward solution.
--eeg
Compute the EEG forward solution.
--grad
Include the derivatives of the fields with respect to the dipole position coordinates to the output, see Field derivatives.
mne_inverse_operator¶
--meg
Employ MEG data in the calculation of the estimates.
--eeg
Employ EEG data in the calculation of the estimates. Note: The EEG computations have not been thoroughly tested at this time.
--fixed
Use fixed source orientations normal to the cortical mantle. By default, the source orientations are not constrained.
--loose <amount>
Employ a loose orientation constraint (LOC). This means that the source covariance matrix entries corresponding to the current component normal to the cortex are set equal to one and the transverse components are set to <amount> . Recommended value of amount is 0.2…0.6.
--loosevar <amount>
Use an adaptive loose orientation constraint. This option can be only employed if the source spaces included in the forward solution have the patch information computed, see Setting up the source space.
--fwd <name>
Specifies the name of the forward solution to use.
--noisecov <name>
Specifies the name of the noise-covariance matrix to use. If this file contains a projection operator, attached by mne_browse_raw and mne_process_raw, no additional projection vectors can be added with the
--proj
option. For backward compatibility,--senscov
can be used as a synonym for--noisecov
.
--noiserank <value>
Specifies the rank of the noise covariance matrix explicitly rather than trying to reduce it automatically. This option is seldom needed,
--gradreg <value>
Regularize the planar gradiometer section (channels for which the unit of measurement is T/m) of the noise-covariance matrix by the given amount. The value is restricted to the range 0…1. For details, see Regularization of the noise-covariance matrix.
--magreg <value>
Regularize the magnetometer and axial gradiometer section (channels for which the unit of measurement is T) of the noise-covariance matrix by the given amount. The value is restricted to the range 0…1. For details, see Regularization of the noise-covariance matrix.
--eegreg <value>
Regularize the EEG section of the noise-covariance matrix by the given amount. The value is restricted to the range 0…1. For details, see Regularization of the noise-covariance matrix.
--diagnoise
Omit the off-diagonal terms from the noise-covariance matrix in the computations. This may be useful if the amount of signal-free data has been insufficient to calculate a reliable estimate of the full noise-covariance matrix.
--srccov <name>
Specifies the name of the diagonal source-covariance matrix to use. By default the source covariance matrix is a multiple of the identity matrix. This option can be employed to incorporate the fMRI constraint. The software to create a source-covariance matrix file from fMRI data will be provided in a future release of this software package.
--depth
Employ depth weighting. For details, see Depth weighting.
--weightexp <value>
This parameter determines the steepness of the depth weighting function (default = 0.8). For details, see Depth weighting.
--weightlimit <value>
Maximum relative strength of the depth weighting (default = 10). For details, see Depth weighting.
--fmri <name>
With help of this w file, an a priori weighting can be applied to the source covariance matrix. The source of the weighting is usually fMRI but may be also some other data, provided that the weighting can be expressed as a scalar value on the cortical surface, stored in a w file. It is recommended that this w file is appropriately smoothed (see About smoothing) in mne_analyze , tksurfer or with mne_smooth_w to contain nonzero values at all vertices of the triangular tessellation of the cortical surface. The name of the file given is used as a stem of the w files. The actual files should be called <name>
-lh.pri
and <name>-rh.pri
for the left and right hemsphere weight files, respectively. The application of the weighting is discussed in fMRI-guided estimates.
--fmrithresh <value>
This option is mandatory and has an effect only if a weighting function has been specified with the
--fmri
option. If the value is in the a priori files falls below this value at a particular source space point, the source covariance matrix values are multiplied by the value specified with the--fmrioff
option (default 0.1). Otherwise it is left unchanged.
--fmrioff <value>
The value by which the source covariance elements are multiplied if the a priori weight falls below the threshold set with
--fmrithresh
, see above.
--bad <name>
A text file to designate bad channels, listed one channel name on each line of the file. If the noise-covariance matrix specified with the
--noisecov
option contains projections, bad channel lists can be included only if they specify all channels containing non-zero entries in a projection vector. For example, bad channels can usually specify all magnetometers or all gradiometers since the projection vectors for these channel types are completely separate. Similarly, it is possible to include MEG data only or EEG data only by using only one of--meg
or--eeg
options since the projection vectors for MEG and EEG are always separate.
--surfsrc
Use a source coordinate system based on the local surface orientation at the source location. By default, the three dipole components are pointing to the directions of the x, y, and z axis of the coordinate system employed in the forward calculation (usually the MEG head coordinate frame). This option changes the orientation so that the first two source components lie in the plane normal to the surface normal at the source location and the third component is aligned with it. If patch information is available in the source space, the normal is the average patch normal, otherwise the vertex normal at the source location is used. If the
--loose
or--loosevar
option is employed,--surfsrc
is implied.
--exclude <name>
Exclude the source space points defined by the given FreeSurfer ‘label’ file from the source reconstruction. This is accomplished by setting the corresponding entries in the source-covariance matrix equal to zero. The name of the file should end with
-lh.label
if it refers to the left hemisphere and with-rh.label
if it lists points in the right hemisphere, respectively.
--proj <name>
Include signal-space projection (SSP) information from this file. For information on SSP, see The Signal-Space Projection (SSP) method. If the projections are present in the noise-covariance matrix, the
--proj
option is not allowed.
--csd
Compute the inverse operator for surface current densities instead of the dipole source amplitudes. This requires the computation of patch statistics for the source space. Since this computation is time consuming, it is recommended that the patch statistics are precomputed and the source space file containing the patch information is employed already when the forward solution is computed, see Setting up the source space and Computing the forward solution. For technical details of the patch information, please consult Cortical patch statistics. This option is considered experimental at the moment.
--inv <name>
Save the inverse operator decomposition here.
mne_make_movie¶
Input files¶
--inv <*name*>
Load the inverse operator decomposition from here.
--meas <*name*>
Load the MEG or EEG data from this file.
--set <*number*>
The data set (condition) number to load. This is the sequential number of the condition. You can easily see the association by looking at the condition list in mne_analyze when you load the file.
--stcin <*name*>
Specifies an stc file to read as input.
Times and baseline¶
--tmin <*time/ms*>
Specifies the starting time employed in the analysis. If
--tmin
option is missing the analysis starts from the beginning of the epoch.
--tmax <*time/ms*>
Specifies the finishing time employed in the analysis. If
--tmax
option is missing the analysis extends to the end of the epoch.
--tstep <*step/ms*>
Time step between consecutive movie frames, specified in milliseconds.
--integ <*:math:`\Delta`t/ms*>
Integration time for each frame. Defaults to zero. The integration will be performed on sensor data. If the time specified for a frame is \(t_0\), the integration range will be \(t_0 - \Delta t/2 \leq t \leq t_0 + \Delta t/2\).
--pick <*time/ms*>
Pick a time for the production of rgb, tif, jpg, png, or w files. Several pick options may be present. The time must be with in the analysis interval, indicated by the
--tmin
and--tmax
options. The--rgb
,--tif
,--jpg
,--png
, and--w
options control which file types are actually produced. When a--pick
option is encountered, the effect of any preceding--pickrange
option is ignored.
--pickrange
All previous
-pick
options will be ignored. Instead, snapshots are produced as indicated by the--tmin
,--tmax
, and--tstep
options. This is useful, e.g., for producing input for scripts merging the individual graphics snapshots into a composite “filmstrip” representation. However, such scripts are not yet part of the MNE software.
--bmin <*time/ms*>
Specifies the starting time of the baseline. In order to activate baseline correction, both
--bmin
and--bmax
options must be present.
--bmax <*time/ms*>
Specifies the finishing time of the baseline.
--baselines <*file_name*>
Specifies a file which contains the baseline settings. Each line of the file should contain a name of a channel, followed by the baseline value, separated from the channel name by a colon. The baseline values must be specified in basic units, i.e., Teslas/meter for gradiometers, Teslas for magnetometers, and Volts for EEG channels. If some channels are missing from the baseline file, warning messages are issued: for these channels, the
--bmin
and--bmax
settings will be used.
Options controlling the estimates¶
--nave <*value*>
Specifies the effective number of averaged epochs in the input data, \(L_{eff}\), as discussed in Effective number of averages. If the input data file is one produced by mne_browse_raw or mne_process_raw, the number of averages is correct in the file. However, if subtractions or some more complicated combinations of simple averages are produced, e.g., by using the xplotter software, the number of averages should be manually adjusted along the guidelines given in Effective number of averages. This is accomplished either by employing this flag or by adjusting the number of averages in the data file with help of the utility mne_change_nave .
--snr <*value*>
An estimate for the amplitude SNR. The regularization parameter will be set as \(\lambda^2 = 1/SNR^2\). The default value is SNR = 3. Automatic selection of the regularization parameter is currently not supported.
--spm
Calculate the dSPM instead of the expected current value.
--sLORETA
Calculate the noise-normalized estimate using the sLORETA approach. sLORETA solutions have in general a smaller location bias than either the expected current (MNE) or the dSPM.
--signed
Indicate the current direction with respect to the cortex outer normal by sign. Currents flowing out of the cortex are thus considered positive (warm colors) and currents flowing into the cortex negative (cold colors).
--picknormalcomp
The components of the estimates corresponding to directions tangential with the cortical mantle are zeroed out.
Visualization options¶
--subject <*subject*>
Specifies the subject whose MRI data is employed in the visualization. This must be the same subject that was used for computing the current estimates. The environment variable SUBJECTS_DIR must be set to point to a locations where the subjects are to be found.
--morph <*subject*>
Morph the data to to the cortical surface of another subject. The Quicktime movie, stc-file, graphics snapshot, and w-file outputs are affected by this option, i.e., they will take the morphing into account and will represent the data on the cortical surface of the subject defined with this option. The stc files morphed to a single subject’s cortical surface are used by mne_average_estimates to combine data from different subjects. If morphing is selected appropriate smoothing must be specified with the
--smooth
option. The morphing process can be made faster by precomputing the necessary morphing maps with mne_make_morph_maps , see Precomputing the morphing maps. More information about morphing and averaging can be found in Morphing and averaging.
--morphgrade <*number*>
Adjusts the number of vertices in the stc files produced when morphing is in effect. By default the number of vertices is 10242 corresponding to –morphgrade value 5. Allowed values are 3, 4, 5, and 6 corresponding to 642, 2562, 10242, and 40962 vertices, respectively.
--surface <*surface name*>
Name of the surface employed in the visualization. The default is inflated .
--curv <*name*>
Specify a nonstandard curvature file name. The default curvature files are
lh.curv
andrh.curv
. With this option, the names becomelh.
<name> andrh.
<name> .
--patch <*name*> [: <*angle/deg*> ]
Specify the name of a surface patch to be used for visualization instead of the complete cortical surface. A complete name of a patch file in the FreeSurface surf directory must be given. The name should begin with lh or rh to allow association of the patch with a hemisphere. Maximum of two
--patch
options can be in effect, one patch for each hemisphere. If the name refers to a flat patch, the name can be optionally followed by a colon and a rotation angle in degrees. The flat patch will be then rotated counterclockwise by this amount before display. You can check a suitable value for the rotation angle by loading the patch interactively in mne_analyze .
--width <*value*>
Width of the graphics output frames in pixels. The default width is 600 pixels.
--height <*value*>
Height of the graphics output frames in pixels. The default height is 400 pixels.
--mag <*factor*>
Magnify the the visualized scene by this factor.
--lh
Select the left hemisphere for graphics output. By default, both hemisphere are processed.
--rh
Select the right hemisphere for graphics output. By default, both hemisphere are processed.
--view <*name*>
Select the name of the view for mov, rgb, and tif graphics output files. The default viewnames, defined in
$MNE_ROOT/share/mne/mne_analyze/eyes
, are lat (lateral), med (medial), ven (ventral), and occ (occipital). You can override these defaults by creating the directory .mne under your home directory and copying the eyes file there. Each line of the eyes file contains the name of the view, the viewpoint for the left hemisphere, the viewpoint for the right hemisphere, left hemisphere up vector, and right hemisphere up vector. The entities are separated by semicolons. Lines beginning with the pound sign (#) are considered to be comments.
--smooth <*nstep*>
Number of smoothsteps to take when producing the output frames. Depending on the source space decimation, an appropriate number is 4 - 7. Smoothing does not have any effect for the original brain if stc files are produced. However, if morphing is selected smoothing is mandatory even with stc output. For details of the smoothing procedure, see About smoothing.
--nocomments
Do not include the comments in the image output files or movies.
--noscalebar
Do not include the scalebar in the image output files or movies.
--alpha <*value*>
Adjust the opacity of maps shown on the cortical surface (0 = transparent, 1 = totally opaque). The default value is 1.
Thresholding¶
--fthresh <*value*>
Specifies the threshold for the displayed colormaps. At the threshold, the overlaid color will be equal to the background surface color. For currents, the value will be multiplied by \(1^{-10}\). The default value is 8.
--fmid <*value*>
Specifies the midpoint for the displayed colormaps. At this value, the overlaid color will be read (positive values) or blue (negative values). For currents, the value will be multiplied by \(1^{-10}\). The default value is 15.
--fmax <*value*>
Specifies the maximum point for the displayed colormaps. At this value, the overlaid color will bright yellow (positive values) or light blue (negative values). For currents, the value will be multiplied by \(1^{-10}\). The default value is 20.
--fslope <*value*>
Included for backwards compatibility. If this option is specified and
--fmax
option is not specified, \(F_{max} = F_{mid} + 1/F_{slope}\).
Output files¶
--mov <*name*>
Produce QuickTime movie files. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. The name of the view is indicated with-
<viename> . Finally,.mov
is added to indicate a QuickTime output file. The movie is produced for all times as dictated by the--tmin
,--tmax
,--tstep
, and--integ
options.
--qual <*value*>
Quality of the QuickTime movie output. The default quality is 80 and allowed range is 25 - 100. The size of the movie files is a monotonously increasing function of the movie quality.
--rate <*rate*>
Specifies the frame rate of the QuickTime movies. The default value is \(1/(10t_{step})\), where \(t_{step}\) is the time between subsequent movie frames produced in seconds.
--rgb <*name*>
Produce rgb snapshots. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. The name of the view is indicated with-
<viename> . Finally,.rgb
is added to indicate an rgb output file. Files are produced for all picked times as dictated by the--pick
and--integ
options.
--tif <*name*>
Produce tif snapshots. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. The name of the view is indicated with-
<viename> . Finally,.tif
is added to indicate an rgb output file. Files are produced for all picked times as dictated by the--pick
and--integ
options. The tif output files are not compressed. Pass the files through an image processing program to compress them.
--jpg <*name*>
Produce jpg snapshots. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. The name of the view is indicated with-
<viename> . Finally,.jpg
is added to indicate an rgb output file. Files are produced for all picked times as dictated by the--pick
and--integ
options.
--png <*name*>
Produce png snapshots. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
or-rh
is then appended. The name of the view is indicated with-
<viename> . Finally,.png
is added to indicate an rgb output file. Files are produced for all picked times as dictated by the--pick
and--integ
options.
--w <*name*>
Produce w file snapshots. This is the ‘stem’ of the output file name. The actual name is derived by stripping anything up to and including the last period from the end of <name> . According to the hemisphere,
-lh
.w or-rh
.w is then appended. Files are produced for all picked times as dictated by the--pick
and--integ
options.
--stc <*name*>
Produce stc files for either the original subject or the one selected with the
--morph
option. These files will contain data only for the decimated locations. If morphing is selected, appropriate smoothing is mandatory. The morphed maps will be decimated with help of a subdivided icosahedron so that the morphed stc files will always contain 10242 vertices. These morphed stc files can be easily averaged together, e.g., in Matlab since they always contain an identical set of vertices.
--norm <*name*>
Indicates that a separate w file containing the noise-normalization values will be produced. The option
--spm
must also be present. Nevertheless, the movies and stc files output will contain MNE values. The noise normalization data files will be called <name>- <SNR>-lh.w
and <name>- <SNR>-rh.w
.
Label processing¶
--label <*name*>
Specifies a label file to process. For each label file, the values of the computed estimates are listed in text files. The label files are produced by tksurfer or mne_analyze and specify regions of interests (ROIs). A label file name should end with
-lh.label
for left-hemisphere ROIs and with-rh.label
for right-hemisphere ones. The corresponding output files are tagged with-lh-
<data type>.amp
and-rh-
<data type>.amp
, respectively. <data type> equals'mne
‘ for expected current data and'spm
‘ for dSPM data. Each line of the output file contains the waveform of the output quantity at one of the source locations falling inside the ROI. For more information about the label output formats, see Label timecourse files.
--labelcoords
Include coordinates of the vertices in the output. The coordinates will be listed in millimeters in the coordinate system which was specified for the forward model computations. This option cannot be used with stc input files (
--stcin
) because the stc files do not contain the coordinates of the vertices.
--labelverts
Include vertex numbers in the output. The numbers refer to the complete triangulation of the corresponding surface and are zero based. The vertex numbers are by default on the first row or first column of the output file depending on whether or not the
--labeltimebytime
option is present.
--labeltimebytime
Output the label data time by time instead of the default vertex-by-vertex output.
--labeltag <*tag*>
End the output files with the specified tag. By default, the output files will end with
-mne.amp
or-spm.amp
depending on whether MNE or one of the noise-normalized estimates (dSPM or sLORETA) was selected.
--labeloutdir <*directory*>
Specifies the directory where the output files will be located. By default, they will be in the current working directory.
--labelcomments
Include comments in the output files. The comment lines begin with the percent sign to make the files compatible with Matlab.
--scaleby <*factor*>
By default, the current values output to the files will be in the actual physical units (Am). This option allows scaling of the current values to other units. mne_analyze typically uses 1e10 to bring the numbers to a human-friendly scale.
Using stc file input¶
The --stcin
option allows input of stc files.
This feature has several uses:
QuickTime movies can be produced from existing stc files without having to resort to EasyMeg.
Graphics snapshot can be produced from existing stc files.
Existing stc files can be temporally resampled with help of the
--tmin
,--tmax
,--tstep
, and--integ
options.Existing stc files can be morphed to another cortical surface by specifying the
--morph
option.Timecourses can be inquired and stored into text files with help of the
--label
options, see above.
mne_make_source_space¶
--subject <name>
Name of the subject.
--morph <name>
Name of the subject to morph the source space to.
--spacing <dist>
Approximate source space spacing in mm.
--ico <grade>
Use the subdivided icosahedron or octahedron in downsampling instead of the –spacing option.
--oct <grade>
Same as –ico -grade.
--surf <names>
Surface file names (separated by colons)
--src <name>
Name of the output file.
mne_process_raw¶
--cd <*dir*>
Change to this directory before starting.
--raw <*name*>
Specifies the raw data file to be opened. This option is required.
--grad <*number*>
Apply software gradient compensation of the given order to the data loaded with the
--raw
option. This option is effective only for data acquired with the CTF and 4D Magnes MEG systems. If orders different from zero are requested for Neuromag data, an error message appears and data are not loaded. Any compensation already existing in the file can be undone or changed to another order by using an appropriate--grad
options. Possible orders are 0 (No compensation), 1 - 3 (CTF data), and 101 (Magnes data). The same compensation will be applied to all loaded data files.
--filtersize <*size*>
Adjust the length of the FFT to be applied in filtering. The number will be rounded up to the next power of two. If the size is \(N\), the corresponding length of time is \(N/f_s\), where \(f_s\) is the sampling frequency of your data. The filtering procedure includes overlapping tapers of length \(N/2\) so that the total FFT length will actually be \(2N\). This value cannot be changed after the program has been started.
--highpass <*value/Hz*>
Highpass filter frequency limit. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
--highpassw <*value/Hz*>
The width of the transition band of the highpass filter. The default is 6 frequency bins, where one bin is \(f_s / (2N)\). This value cannot be adjusted in the interactive version of the program.
--lowpass <*value/Hz*>
Lowpass filter frequency limit. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
--lowpassw <*value/Hz*>
The width of the transition band of the lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
--eoghighpass <*value/Hz*>
Highpass filter frequency limit for EOG. If this is too low with respect to the selected FFT length and, the data will not be highpass filtered. It is best to experiment with the interactive version to find the lowest applicable filter for your data. This value can be adjusted in the interactive version of the program. The default is 0, i.e., no highpass filter apart from that used during the acquisition will be in effect.
--eoghighpassw <*value/Hz*>
The width of the transition band of the EOG highpass filter. The default is 6 frequency bins, where one bin is \(f_s / (2N)\). This value cannot be adjusted in the interactive version of the program.
--eoglowpass <*value/Hz*>
Lowpass filter frequency limit for EOG. This value can be adjusted in the interactive version of the program. The default is 40 Hz.
--eoglowpassw <*value/Hz*>
The width of the transition band of the EOG lowpass filter. This value can be adjusted in the interactive version of the program. The default is 5 Hz.
--filteroff
Do not filter the data. This initial value can be changed in the interactive version of the program.
--digtrig <*name*>
Name of the composite digital trigger channel. The default value is ‘STI 014’. Underscores in the channel name will be replaced by spaces. May also be specified by an environment variable
MNE_TRIGGER_CH_NAME
.
--digtrigmask <*number*>
Mask to be applied to the trigger channel values before considering them. This option is useful if one wants to set some bits in a don’t care state. For example, some finger response pads keep the trigger lines high if not in use, i.e., a finger is not in place. Yet, it is convenient to keep these devices permanently connected to the acquisition system. The number can be given in decimal or hexadecimal format (beginning with 0x or 0X). For example, the value 255 (0xFF) means that only the lowest order byte (usually trigger lines 1 - 8 or bits 0 - 7) will be considered. May also be specified by an environment variable
MNE_TRIGGER_CH_MASK
.
--proj <*name*>
Specify the name of the file of the file containing a signal-space projection (SSP) operator. If
--proj
options are present the data file is not consulted for an SSP operator. The operator corresponding to average EEG reference is always added if EEG data are present.
--projon
Activate the projections loaded. One of the options
--projon
or--projoff
must be present on the mne_processs_raw command line.
--projoff
Deactivate the projections loaded. One of the options
--projon
or--projoff
must be present on the mne_processs_raw command line.
--makeproj
Estimate the noise subspace from the data and create a new signal-space projection operator instead of using one attached to the data file or those specified with the
--proj
option. The following eight options define the parameters of the noise subspace estimation. More information on the signal-space projection can be found in The Signal-Space Projection (SSP) method.
--projevent <*no*>
Specifies the events which identify the time points of interest for projector calculation. When this option is present,
--projtmin
and--projtmax
are relative to the time point of the event rather than the whole raw data file.
--projtmin <*time/s*>
Specify the beginning time for the calculation of the covariance matrix which serves as the basis for the new SSP operator. This option is required with
--projevent
and defaults to the beginning of the raw data file otherwise. This option is effective only if--makeproj
or--saveprojtag
options are present.
--projtmax <*time/s*>
Specify the ending time for the calculation of the covariance matrix which serves as the basis for the new SSP operator. This option is required with
--projevent
and defaults to the end of the raw data file otherwise. This option is effective only if--makeproj
or--saveprojtag
options are present.
--projngrad <*number*>
Number of SSP components to include for planar gradiometers (default = 5). This value is system dependent. For example, in a well-shielded quiet environment, no planar gradiometer projections are usually needed.
--projnmag <*number*>
Number of SSP components to include for magnetometers / axial gradiometers (default = 8). This value is system dependent. For example, in a well-shielded quiet environment, 3 - 4 components are need while in a noisy environment with light shielding even more than 8 components may be necessary.
--projgradrej <*value/ fT/cm*>
Rejection limit for planar gradiometers in the estimation of the covariance matrix frfixom which the new SSP operator is derived. The default value is 2000 fT/cm. Again, this value is system dependent.
--projmagrej <*value/ fT*>
Rejection limit for planar gradiometers in the estimation of the covariance matrix from which the new SSP operator is derived. The default value is 3000 fT. Again, this value is system dependent.
--saveprojtag <*tag*>
This option defines the names of files to hold the SSP operator. If this option is present the
--makeproj
option is implied. The SSP operator file name is formed by removing the trailing.fif
or_raw.fif
from the raw data file name by appending <tag> .fif to this stem. Recommended value for <tag> is-proj
.
--saveprojaug
Specify this option if you want to use the projection operator file output in the Elekta-Neuromag Signal processor (graph) software.
--eventsout <*name*>
List the digital trigger channel events to the specified file. By default, only transitions from zero to a non-zero value are listed. If multiple raw data files are specified, an equal number of
--eventsout
options should be present. If the file name ends with .fif, the output will be in fif format, otherwise a text event file will be output.
--allevents
List all transitions to file specified with the
--eventsout
option.
--events <*name*>
Specifies the name of a fif or text format event file (see Event files) to be associated with a raw data file to be processed. If multiple raw data files are specified, the number of
--events
options can be smaller or equal to the number of raw data files. If it is equal, the event filenames will be associated with the raw data files in the order given. If it is smaller, the remaining raw data files for which an event file is not specified will not have an event file associated with them. The event file format is recognized from the file name: if it ends with.fif
, the file is assumed to be in fif format, otherwise a text file is expected.
--ave <*name*>
Specifies the name of an off-line averaging description file. For details of the format of this file, please consult Description files for off-line averaging. If multiple raw data files are specified, the number of
--ave
options can be smaller or equal to the number of raw data files. If it is equal, the averaging description file names will be associated with the raw data files in the order given. If it is smaller, the last description file will be used for the remaining raw data files.
--saveavetag <*tag*>
If this option is present and averaging is evoked with the
--ave
option, the outfile and logfile options in the averaging description file are ignored. Instead, trailing.fif
or_raw.fif
is removed from the raw data file name and <tag>.fif
or <tag>.log
is appended to create the output and log file names, respectively.
--gave <*name*>
If multiple raw data files are specified as input and averaging is requested, the grand average over all data files will be saved to <name> .
--cov <*name*>
Specify the name of a description file for covariance matrix estimation. For details of the format of this file, please see Description files for covariance matrix estimation. If multiple raw data files are specified, the number of
--cov
options can be smaller or equal to the number of raw data files. If it is equal, the averaging description file names will be associated with the raw data files in the order given. If it is smaller, the last description file will be used for the remaining raw data files.
--savecovtag <*tag*>
If this option is present and covariance matrix estimation is evoked with the
--cov
option, the outfile and logfile options in the covariance estimation description file are ignored. Instead, trailing.fif
or_raw.fif
is removed from the raw data file name and <tag> .fif or <tag> .log is appended to create the output and log file names, respectively. For compatibility with other MNE software scripts,--savecovtag -cov
is recommended.
--savehere
If the
--saveavetag
and--savecovtag
options are used to generate the file output file names, the resulting files will go to the same directory as raw data by default. With this option the output files will be generated in the current working directory instead.
--gcov <*name*>
If multiple raw data files are specified as input and covariance matrix estimation is requested, the grand average over all data files will be saved to <name> . The details of the covariance matrix estimation are given in Covariance matrix estimation.
--save <*name*>
Save a filtered and optionally down-sampled version of the data file to <name> . If multiple raw data files are specified, an equal number of
--save
options should be present. If <filename> ends with.fif
or_raw.fif
, these endings are deleted. After these modifications,_raw.fif
is inserted after the remaining part of the file name. If the file is split into multiple parts (see--split
option below), the additional parts will be called <name>-
<number>_raw.fif
--split <*size/MB*>
Specifies the maximum size of the raw data files saved with the
--save
option. By default, the output is split into files which are just below 2 GB so that the fif file maximum size is not exceed.
--anon
Do not include any subject information in the output files created with the
--save
option.
--decim <*number*>
The data are decimated by this factor before saving to the file specified with the
--save
option. For decimation to succeed, the data must be lowpass filtered to less than third of the sampling frequency effective after decimation.
mne_redo_file¶
Usage: mne_redo_file file-to-redo
mne_redo_file_nocwd¶
Usage: mne_redo_file_nocwd file-to-redo
mne_setup_forward_model¶
--subject <*subject*>
Defines the name of the subject. This can be also accomplished by setting the SUBJECT environment variable.
--surf
Use the FreeSurfer surface files instead of the default ASCII triangulation files. Please consult Setting up the head surface triangulation files for the standard file naming scheme.
--noswap
Traditionally, the vertices of the triangles in ‘tri’ files have been ordered so that, seen from the outside of the triangulation, the vertices are ordered in clockwise fashion. The fif files, however, employ the more standard convention with the vertices ordered counterclockwise. Therefore, mne_setup_forward_model by default reverses the vertex ordering before writing the fif file. If, for some reason, you have counterclockwise-ordered tri files available this behavior can be turned off by defining
--noswap
. When the fif file is created, the vertex ordering is checked and the process is aborted if it is incorrect after taking into account the state of the swapping. Should this happen, try to run mne_setup_forward_model again including the--noswap
flag. In particular, if you employ the seglab software to create the triangulations (see Creating the BEM meshes), the--noswap
flag is required. This option is ignored if--surf
is specified
--ico <*number*>
This option is relevant (and required) only with the
--surf
option and if the surface files have been produced by the watershed algorithm. The watershed triangulations are isomorphic with an icosahedron, which has been recursively subdivided six times to yield 20480 triangles. However, this number of triangles results in a long computation time even in a workstation with generous amounts of memory. Therefore, the triangulations have to be decimated. Specifying--ico 4
yields 5120 triangles per surface while--ico 3
results in 1280 triangles. The recommended choice is--ico 4
.
--homog
Use a single compartment model (brain only) instead a three layer one (scalp, skull, and brain). Only the
inner_skull.tri
triangulation is required. This model is usually sufficient for MEG but invalid for EEG. If you are employing MEG data only, this option is recommended because of faster computation times. If this flag is specified, the options--brainc
,--skullc
, and--scalpc
are irrelevant.
--brainc <*conductivity/ S/m*>
Defines the brain compartment conductivity. The default value is 0.3 S/m.
--skullc <*conductivity/ S/m*>
Defines the skull compartment conductivity.  The default value is 0.3 S/m.
--innershift <*value/mm*>
Shift the inner skull surface outwards along the vertex normal directions by this amount.
--outershift <*value/mm*>
Shift the outer skull surface outwards along the vertex normal directions by this amount.
--scalpshift <*value/mm*>
Shift the scalp surface outwards along the vertex normal directions by this amount.
--nosol
Omit the BEM model geometry dependent data preparation step. This can be done later by running mne_setup_forward_model without the
--nosol
option.
--model <*name*>
Name for the BEM model geometry file. The model will be created into the directory bem as <name>-
bem.fif
. If this option is missing, standard model names will be used (see below).
mne_setup_mri¶
This command sets up the directories subjects/$SUBJECT/mri/T1-neuromag
and
subjects/$SUBJECT/mri/brain-neuromag
.
mne_setup_source_space¶
--subject <*name*>
Name of the subject in SUBJECTS_DIR. In the absence of this option, the SUBJECT environment variable will be consulted. If it is not defined, mne_setup_source_space exits with an error.
--morph <*name*>
Name of a subject in SUBJECTS_DIR. If this option is present, the source space will be first constructed for the subject defined by the –subject option or the SUBJECT environment variable and then morphed to this subject. This option is useful if you want to create a source spaces for several subjects and want to directly compare the data across subjects at the source space vertices without any morphing procedure afterwards. The drawback of this approach is that the spacing between source locations in the “morph” subject is not going to be as uniform as it would be without morphing.
--surf <*name1*>: <*name2*>:...
FreeSurfer surface file names specifying the source surfaces, separated by colons.
--spacing <*spacing/mm*>
Specifies the approximate grid spacing of the source space in mm.
--ico <*number*>
Instead of using the traditional method for cortical surface decimation it is possible to create the source space using the topology of a recursively subdivided icosahedron ( <number> > 0) or an octahedron ( <number> < 0). This method uses the cortical surface inflated to a sphere as a tool to find the appropriate vertices for the source space. The benefit of the
--ico
option is that the source space will have triangulation information between the decimated vertices included, which some future versions of MNE software may be able to utilize. The number of triangles increases by a factor of four in each subdivision, starting from 20 triangles in an icosahedron and 8 triangles in an octahedron. Since the number of vertices on a closed surface is \(n_{vert} = (n_{tri} + 4) / 2\), the number of vertices in the k th subdivision of an icosahedron and an octahedron are \(10 \cdot 4^k +2\) and \(4_{k + 1} + 2\), respectively. The recommended values for <number> and the corresponding number of source space locations are listed in Table 3.1.
--all
Include all nodes to the output. The active dipole nodes are identified in the fif file by a separate tag. If tri files were used as input the output file will also contain information about the surface triangulation. This option is always recommended to include complete information.
--src <*name*>
Output file name. Use a name <dir>/<name>-src.fif
Note
If both --ico
and --spacing
options are present the later one on the command line takes precedence.
Note
Due to the differences between the FreeSurfer and MNE libraries, the number of source space points generated with the --spacing
option may be different between the current version of MNE and versions 2.5 or earlier (using --spacing
option to mne_setup_source_space ) if the FreeSurfer surfaces employ the (old) quadrangle format or if there are topological defects on the surfaces. All new FreeSurfer surfaces are specified as triangular tessellations and are e of defects.
mne_show_environment¶
Usage: mne_show_environment files
Utility command-line arguments¶
mne_add_patch_info¶
Purpose¶
The utility mne_add_patch_info uses the detailed cortical surface geometry information to add data about cortical patches corresponding to each source space point. A new copy of the source space(s) included in the input file is created with the patch information included. In addition to the patch information, mne_add_patch_info can optionally calculate distances, along the cortical surface, between the vertices selected to the source space.
Note
Depending on the speed of your computer and the options selected, mne_add_patch_info takes 5 - 30 minutes to run.
Command line options¶
mne_add_patch_info accepts the following command-line options:
--verbose
Provide verbose output during the calculations.
--dist <*dist/mm*>
Invokes the calculation of distances between vertices included in the source space along the cortical surface. Only pairs whose distance in the three-dimensional volume is less than the specified distance are considered. For details, see Computational details, below.
--src <*name*>
The input source space file. The source space files usually end with
-src.fif
.
--srcp <*name*>
The output source space file which will contain the patch information. If the file exists it will overwritten without asking for permission. A recommended naming convention is to add the letter
p
after the source spacing included in the file name. For example, if the input file ismh-7-src.fif
, a recommended output file name ismh-7p-src.fif
.
--w <*name*>
Name of a w file, which will contain the patch area information. Two files will be created: <name>
-lh.w
and <name>-rh.w
. The numbers in the files are patch areas in \(\text{mm}^2\). The source space vertices are marked with value 150.
--labeldir <*directory*>
Create a label file corresponding to each of the patches in the given directory. The directory must be created before running mne_add_patch_info .
Computational details¶
By default, mne_add_patch_info creates a copy of the source space(s) with the following additional information for each vertex in the original dense triangulation of the cortex:
The number of the closest active source space vertex and
The distance to this vertex.
This information can be used to determine, e.g., the sizes of the patches, their average normals, and the standard deviation of the normal directions. This information is also returned by the mne_read_source_space Matlab function as described in Table 10.28.
The --dist
option to mne_add_patch_info invokes
the calculation of inter-vertex distances. These distances are computed
along the the cortical surface (usually the white matter) on which
the source space vertices are located.
Since the calculation of all possible distances would take
a very long time, the distance given with the --dist
option allows
restriction to the neighborhood of each source space vertex. This
neighborhood is defined as the sphere around each source space vertex,
with radius given by the --dist
option. Because the distance calculation
is done along the folded cortical surface whose details are given
by the dense triangulation of the cortical surface produced by FreeSurfer,
some of the distances computed will be larger than the value give
with –dist.
mne_add_to_meas_info¶
Add new data to meas info.
--add <name>
The file to add.
--dest <name>
the destination file.
mne_add_triggers¶
Purpose¶
The utility mne_add_triggers modifies the digital trigger channel (STI 014) in raw data files to include additional transitions. Since the raw data file is modified, it is possible to make irreversible changes. Use this utility with caution. It is recommended that you never run mne_add_triggers on an original raw data file.
Command line options¶
mne_add_triggers accepts the following command-line options:
--raw <*name*>
Specifies the raw data file to be modified.
--trg <*name*>
Specifies the trigger line modification list. This text file should contain two entries per line: the sample number and the trigger number to be added into the file. The number of the first sample in the file is zero. It is recommended that trigger numbers whose binary equivalent has lower eight bits equal to zero are used to avoid conflicts with the ordinary triggers occurring in the file.
--delete
Delete the triggers defined by the trigger file instead of adding them. This enables changing the file to its original state, provided that the trigger file is preserved.
Note
Since mne_browse_raw and mne_process_raw can employ an event file which effectively adds new trigger instants, mne_add_triggers is for the most part obsolete but it has been retained in the MNE software suite for backward compatibility.
mne_annot2labels¶
The utility mne_annot2labels converts
cortical parcellation data into a set of labels. The parcellation
data are read from the directory $SUBJECTS_DIR/$SUBJECT/label
and
the resulting labels are written to the current directory. mne_annot2labels requires
that the environment variable $SUBJECTS_DIR
is set.
The command line options for mne_annot2labels are:
--subject <*name*>
Specifies the name of the subject. If this option is not present the
$SUBJECT
environment variable is consulted. If the subject name cannot be determined, the program quits.
--parc <*name*>
Specifies the parcellation name to convert. The corresponding parcellation file names will be
$SUBJECTS_DIR/$SUBJECT/label/
<hemi>h.
<name>.annot
where <hemi> isl
orr
for the left and right hemisphere, respectively.
mne_anonymize¶
Depending no the settings during acquisition in the Elekta-Neuromag EEG/MEG systems the data files may contain subject identifying information in unencrypted form. The utility mne_anonymize was written to clear tags containing such information from a fif file. Specifically, this utility removes the following tags from the fif file:
Tag |
Description |
|---|---|
FIFF_SUBJ_FIRST_NAME |
First name of the subject |
FIFF_SUBJ_MIDDLE_NAME |
Middle name of the subject |
FIFF_SUBJ_LAST_NAME |
Last name of the subject |
FIFF_SUBJ_BIRTH_DAY |
Birthday of the subject (Julian day number) |
FIFF_SUBJ_SEX |
The sex of the subject |
FIFF_SUBJ_HAND |
Handedness of the subject |
FIFF_SUBJ_WEIGHT |
Weight of the subject in kg |
FIFF_SUBJ_HEIGHT |
Height of the subject in m |
FIFF_SUBJ_COMMENT |
Comment about the subject |
FIFF_MEAS_DATE |
The date of the recordings |
FIFF_SUBJ_HIS_ID |
The ID used in the Hospital Information System (only with |
Note
mne_anonymize normally keeps the FIFF_SUBJ_HIS_ID tag which can be used to identify the subjects uniquely after the information listed in Tags cleared by mne_anonymize . have been removed. If the --his
option is specified on the command line, the FIFF_SUBJ_HIS_ID tag will be removed as well. The data of the tags listed in Tags cleared by mne_anonymize . and the optional FIFF_SUBJ_HIS_ID tag are overwritten with zeros and the space claimed by omitting these tags is added to the free space list of the file. Therefore, after mne_anonymize has processed a data file there is no way to recover the removed information. Use this utility with caution.
mne_anonymize recognizes the following command-line options:
--his
Remove the FIFF_SUBJ_HIS_ID tag as well, see above.
--file <*name*>
Specifies the name of the file to be modified.
Note
You need write permission to the file to be processed.
mne_average_forward_solutions¶
--fwd <*name*> :[ <*weight*> ]
Specifies a forward solution to include. If no weight is specified, 1.0 is assumed. In the averaging process the weights are divided by their sum. For example, if two forward solutions are averaged and their specified weights are 2 and 3, the average is formed with a weight of 2/5 for the first solution and 3/5 for the second one.
--out <*name*>
Specifies the output file which will contain the averaged forward solution.
mne_brain_vision2fiff¶
The utility mne_brain_vision2fiff was created to import BrainVision EEG data. This utility also helps to import the eXimia (Nexstim) TMS-compatible EEG system data to the MNE software. The utility uses an optional fif file containing the head digitization data to allow source modeling. The MNE Matlab toolbox contains the function fiff_write_dig_file to write a digitization file based on digitization data available in another format, see MNE-MATLAB toolbox.
Note
mne_brain_vision2fiff reads events from the vmrk
file referenced in the
vhdr
file, but it only includes events whose “Type” is Stimulus
and
whose “description” is given by S<number>
. All other events are ignored.
The command-line options of mne_brain_vision2fiff are:
--header <*name*>
The name of the BrainVision header file. The extension of this file is
vhdr
. The header file typically refers to a marker file (vmrk
) which is automatically processed and a digital trigger channel (STI 014) is formed from the marker information. Thevmrk
file is ignored if the--eximia
option is present.
--dig <*name*>
The name of the fif file containing the digitization data.
--orignames
Use the original EEG channel labels. If this option is absent the EEG channels will be automatically renamed to EEG 001, EEG 002, etc.
--eximia
Interpret this as an eXimia data file. The first three channels will be thresholded and interpreted as trigger channels. The composite digital trigger channel will be composed in the same way as in the mne_kit2fiff utility. In addition, the fourth channel will be assigned as an EOG channel. This option is normally used by the mne_eximia2fiff script.
--split <*size/MB*>
Split the output data into several files which are no more than <size> MB. By default, the output is split into files which are just below 2 GB so that the fif file maximum size is not exceeded.
--out <*filename*>
Specifies the name of the output fif format data file. If <filename> ends with
.fif
or_raw.fif
, these endings are deleted. After these modifications,_raw.fif
is inserted after the remaining part of the file name. If the file is split into multiple parts, the additional parts will be called <name>-
<number>_raw.fif
.
mne_change_baselines¶
The utility mne_change_baselines computes baseline values and applies them to an evoked-response data file. The command-line options are:
--in <*name*>
Specifies the input data file.
--set <*number*>
The data set number to compute baselines from or to apply baselines to. If this option is omitted, all average data sets in the input file are processed.
--out <*name*>
The output file.
--baselines <*name*>
Specifies a text file which contains the baseline values to be applied. Each line should contain a channel name, colon, and the baseline value given in ‘native’ units (T/m, T, or V). If this option is encountered, the limits specified by previous
--bmin
and--bmax
options will not have an effect.
--list <*name*>
Specifies a text file to contain the baseline values. Listing is provided only if a specific data set is selected with the
--set
option.
--bmin <*value/ms*>
Lower limit of the baseline. Effective only if
--baselines
option is not present. Both--bmin
and--bmax
must be present to compute the baseline values. If either--bmin
or--bmax
is encountered, previous--baselines
option will be ignored.
--bmax <*value/ms*>
Upper limit of the baseline.
mne_check_eeg_locations¶
Some versions of the Neuromag acquisition software did not copy the EEG channel location information properly from the Polhemus digitizer information data block to the EEG channel information records if the number of EEG channels exceeds 60. The purpose of mne_check_eeg_locations is to detect this problem and fix it, if requested. The command-line options are:
--file <*name*>
Specify the measurement data file to be checked or modified.
--dig <*name*>
Name of the file containing the Polhemus digitizer information. Default is the data file name.
--fix
By default mne_check_eeg_locations only checks for missing EEG locations (locations close to the origin). With –fix mne_check_eeg_locations reads the Polhemus data from the specified file and copies the EEG electrode location information to the channel information records in the measurement file. There is no harm running mne_check_eeg_locations on a data file even if the EEG channel locations were correct in the first place.
mne_check_surface¶
This program just reads a surface file to check whether it is valid.
--surf <name>
The input file (FreeSurfer surface format).
--bem <name>
The input file (a BEM fif file)
--id <id>
Surface id to list (default : 4)
4 for outer skin (scalp) surface * 3 for outer skull surface * 1 for inner skull surface
--checkmore
Do more thorough testing
mne_collect_transforms¶
The utility mne_collect_transforms collects coordinate transform information from various sources and saves them into a single fif file. The coordinate transformations used by MNE software are summarized in Figure 5.1. The output of mne_collect_transforms may include all transforms referred to therein except for the sensor coordinate system transformations \(T_{s_1} \dotso T_{s_n}\). The command-line options are:
--meas <*name*>
Specifies a measurement data file which provides \(T_1\). A forward solution or an inverse operator file can also be specified as implied by Table 5.1.
--mri <*name*>
Specifies an MRI description or a standalone coordinate transformation file produced by mne_analyze which provides \(T_2\). If the
--mgh
option is not present mne_collect_transforms also tries to find \(T_3\), \(T_4\), \(T_-\), and \(T_+\) from this file.
--mgh <*name*>
An MRI volume volume file in mgh or mgz format. This file provides \(T_3\). The transformation \(T_4\) will be read from the talairach.xfm file referred to in the MRI volume. The fixed transforms \(T_-\) and \(T_+\) will also be created.
--out <*name*>
Specifies the output file. If this option is not present, the collected transformations will be output on screen but not saved.
mne_compensate_data¶
--in <*name*>
Specifies the input data file.
--out <*name*>
Specifies the output data file.
--grad <*number*>
Specifies the desired compensation grade in the output file. The value can be 1, 2, 3, or 101. The values starting from 101 will be used for 4D Magnes compensation matrices.
Note
Only average data is included in the output. Evoked-response data files produced with mne_browse_raw or mne_process_raw may include standard errors of mean, which can not be re-compensated using the above method and are thus omitted.
Note
Raw data cannot be compensated using mne_compensate_data . For this purpose, load the data to mne_browse_raw or mne_process_raw , specify the desired compensation grade, and save a new raw data file.
mne_copy_processing_history¶
In order for the inverse operator calculation to work correctly with data processed with the Elekta-Neuromag Maxfilter (TM) software, the so-called processing history block must be included in data files. Previous versions of the MNE Matlab functions did not copy processing history to files saved. As of March 30, 2009, the Matlab toolbox routines fiff_start_writing_raw and fiff_write_evoked have been enhanced to include these data to the output file as appropriate. If you have older raw data files created in Matlab from input which has been processed Maxfilter, it is necessary to copy the processing history block from the original to modified raw data file using the mne_copy_processing_history utility described below. The raw data processing programs mne_browse_raw and mne_process_raw have handled copying of the processing history since revision 2.5 of the MNE software.
mne_copy_processing_history is simple to use:
mne_copy_processing_history --from
<from> --to
<to> ,
where <from> is an original raw data file containing the processing history and <to> is a file output with older MNE Matlab routines. Be careful: this operation cannot be undone. If the <from> file does not have the processing history block or the <to> file already has it, the destination file remains unchanged.
mne_convert_dig_data¶
Converts Polhemus digitization data between different file formats. The input formats are:
fif
The standard format used in MNE. The digitization data are typically present in the measurement files.
hpts
A text format which is a translation of the fif format data, see The hpts format below.
elp
A text format produced by the Source Signal Imaging, Inc. software. For description of this “probe” format, see http://www.sourcesignal.com/formats_probe.html.
The data can be output in fif and hpts formats. Only the last command-line option specifying an input file will be honored. Zero or more output file options can be present on the command line.
Note
The elp and hpts input files may contain textual EEG electrode labels. They will not be copied to the fif format output.
The command-line options of mne_convert_dig_data are:
--fif <*name*>
Specifies the name of an input fif file.
--hpts <*name*>
Specifies the name of an input hpts file.
--elp <*name*>
Specifies the name of an input elp file.
--fifout <*name*>
Specifies the name of an output fif file.
--hptsout <*name*>
Specifies the name of an output hpts file.
--headcoord
The fif and hpts input files are assumed to contain data in the MNE head coordinate system, see The head and device coordinate systems. With this option present, the data are transformed to the MNE head coordinate system with help of the fiducial locations in the data. Use this option if this is not the case or if you are unsure about the definition of the coordinate system of the fif and hpts input data. This option is implied with elp input files. If this option is present, the fif format output file will contain the transformation between the original digitizer data coordinates the MNE head coordinate system.
The hpts format¶
The hpts format digitzer data file may contain comment lines starting with the pound sign (#) and data lines of the form:
<category> <identifier> <x/mm> <y/mm> <z/mm>
where
`` <category>``
defines the type of points. Allowed categories are: hpi , cardinal (fiducial ),eeg , and extra corresponding to head-position indicator coil locations, cardinal landmarks, EEG electrode locations, and additional head surface points, respectively. Note that tkmedit does not recognize the fiducial as an alias for cardinal .
`` <identifier>``
identifies the point. The identifiers are usually sequential numbers. For cardinal landmarks, 1 = left auricular point, 2 = nasion, and 3 = right auricular point. For EEG electrodes, identifier = 0 signifies the reference electrode. Some programs (not tkmedit ) accept electrode labels as identifiers in the eeg category.
`` <x/mm> , <y/mm> , <z/mm>``
Location of the point, usually in the MEG head coordinate system, see The head and device coordinate systems. Some programs have options to accept coordinates in meters instead of millimeters. With
--meters
option, mne_transform_points lists the coordinates in meters.
mne_convert_lspcov¶
The utility mne_convert_lspcov converts a LISP-format noise-covariance file, produced by the Neuromag signal processor, graph into fif format.
The command-line options are:
--lspcov <*name*>
The LISP noise-covariance matrix file to be converted.
--meas <*name*>
A fif format measurement file used to assign channel names to the noise-covariance matrix elements. This file should have precisely the same channel order within MEG and EEG as the LISP-format covariance matrix file.
--out <*name*>
The name of a fif format output file. The file name should end with -cov.fif.text format output file. No information about the channel names is included. The covariance matrix file is listed row by row. This file can be loaded to MATLAB, for example
--outasc <*name*>
The name of a text format output file. No information about the channel names is included. The covariance matrix file is listed row by row. This file can be loaded to MATLAB, for example
mne_convert_ncov¶
The ncov file format was used to store the noise-covariance matrix file. The MNE software requires that the covariance matrix files are in fif format. The utility mne_convert_ncov converts ncov files to fif format.
The command-line options are:
--ncov <*name*>
The ncov file to be converted.
--meas <*name*>
A fif format measurement file used to assign channel names to the noise-covariance matrix elements. This file should have precisely the same channel order within MEG and EEG as the ncov file. Typically, both the ncov file and the measurement file are created by the now mature off-line averager, meg_average.
mne_convert_surface¶
The utility mne_convert_surface converts surface data files between different formats.
Note
The MNE Matlab toolbox functions enable reading of FreeSurfer surface files directly. Therefore, the --mat
option has been removed. The dfs file format conversion functionality has been moved here from mne_convert_dfs . Consequently, mne_convert_dfs has been removed from MNE software.
command-line options¶
mne_convert_surface accepts the following command-line options:
--fif <*name*>
Specifies a fif format input file. The first surface (source space) from this file will be read.
--tri <*name*>
Specifies a text format input file. The format of this file is described in Tessellation file format.
--meters
The unit of measure for the vertex locations in a text input files is meters instead of the default millimeters. This option does not have any effect on the interpretation of the FreeSurfer surface files specified with the
--surf
option.
--swap
Swap the ordering or the triangle vertices. The standard convention in the MNE software is to have the vertices in text format files ordered so that the vector cross product of the vectors from vertex 1 to 2 and 1 to 3 gives the direction of the outward surface normal. This is also called the counterclockwise ordering. If your text input file does not comply with this right-hand rule, use the
--swap
option. This option does not have any effect on the interpretation of the FreeSurfer surface files specified with the--surf
option.
--surf <*name*>
Specifies a FreeSurfer format input file.
--dfs <*name*>
Specifies the name of a dfs file to be converted. The surfaces produced by BrainSuite are in the dfs format.
--mghmri <*name*>
Specifies a mgh/mgz format MRI data file which will be used to define the coordinate transformation to be applied to the data read from a dfs file to bring it to the FreeSurfer MRI coordinates, i.e., the coordinate system of the MRI stack in the file. In addition, this option can be used to insert “volume geometry” information to the FreeSurfer surface file output (
--surfout
option). If the input file already contains the volume geometry information, –replacegeom is needed to override the input volume geometry and to proceed to writing the data.
--replacegeom
Replaces existing volume geometry information. Used in conjunction with the
--mghmri
option described above.
--fifmri <*name*>
Specifies a fif format MRI destription file which will be used to define the coordinate transformation to be applied to the data read from a dfs file to bring it to the same coordinate system as the MRI stack in the file.
--trans <*name*>
Specifies the name of a text file which contains the coordinate transformation to be applied to the data read from the dfs file to bring it to the MRI coordinates, see below. This option is rarely needed.
--flip
By default, the dfs surface nodes are assumed to be in a right-anterior-superior (RAS) coordinate system with its origin at the left-posterior-inferior (LPI) corner of the MRI stack. Sometimes the dfs file has left and right flipped. This option reverses this flip, i.e., assumes the surface coordinate system is left-anterior-superior (LAS) with its origin in the right-posterior-inferior (RPI) corner of the MRI stack.
--shift <*value/mm*>
Shift the surface vertices to the direction of the surface normals by this amount before saving the surface.
--surfout <*name*>
Specifies a FreeSurfer format output file.
--fifout <*name*>
Specifies a fif format output file.
--triout <*name*>
Specifies an ASCII output file that will contain the surface data in the triangle file format described in Tessellation file format.
--pntout <*name*>
Specifies a ASCII output file which will contain the vertex numbers only.
--metersout
With this option the ASCII output will list the vertex coordinates in meters instead of millimeters.
--swapout
Defines the vertex ordering of ASCII triangle files to be output. For details, see
--swap
option, above.
--smfout <*name*>
Specifies a smf (Simple Model Format) output file. For details of this format, see http://people.sc.fsu.edu/~jburkardt/data/smf/smf.txt.
Note
Multiple output options can be specified to produce outputs in several different formats with a single invocation of mne_convert_surface .
The coordinate transformation file specified with the --trans
should contain
a 4 x 4 coordinate transformation matrix:
defined so that if the augmented location vectors in the dfs file and MRI coordinate systems are denoted by \(r_{dfs} = [x_{dfs} y_{dfs} z_{dfs} 1]^T\) and \(r_{MRI} = [x_{MRI} y_{MRI} z_{MRI} 1]^T\), respectively,
mne_cov2proj¶
Purpose¶
The utility mne_cov2proj picks eigenvectors from a covariance matrix and outputs them as a signal-space projection (SSP) file.
Command line options¶
mne_cov2proj accepts the following command-line options:
--cov <*name*>
The covariance matrix file to be used a source. The covariance matrix files usually end with
-cov.fif
.
--proj <*name*>
The output file to contain the projection. It is recommended that the file name ends with
-proj.fif
.
--bad <*name*>
Specify channels not to be included when an eigenvalue decomposition of the covariance matrix is computed.
--include <*val1*> [: <*val2*> ]
Select an eigenvector or a range of eigenvectors to include. It is recommended that magnetometers, gradiometers, and EEG data are handled separately with help of the
--bad
,--meg
,--megmag
,--meggrad
, and--eeg
options.
--meg
After loading the covariance matrix, modify it so that only elements corresponding to MEG channels are included.
--eeg
After loading the covariance matrix, modify it so that only elements corresponding to EEG channels are included.
--megmag
After loading the covariance matrix, modify it so that only elements corresponding to MEG magnetometer channels are included.
--meggrad
After loading the covariance matrix, modify it so that only elements corresponding to MEG planar gradiometer channels are included.
Note
The --megmag
and --meggrad
employ the Vectorview channel numbering scheme to recognize MEG magnetometers (channel names ending with ‘1’) and planar gradiometers (other channels). Therefore, these options are only meaningful in conjunction with data acquired with a Neuromag Vectorview system.
mne_create_comp_data¶
--in <*name*>
Specifies the input text file containing the compensation data.
--kind <*value*>
The compensation type to be stored in the output file with the data. This value defaults to 101 for the Magnes compensation and does not need to be changed.
--out <*name*>
Specifies the output fif file containing the compensation channel weight matrix \(C_{(k)}\), see Applying software gradient compensation.
The format of the text-format compensation data file is:
<number of MEG helmet channels> <number of compensation channels included> <cname_1> <cname_2> … <name_1> <weights> <name_2> <weights> …
In the above <name_k> denote
names of MEG helmet channels and <cname_k>
those of the compensation channels, respectively. If the channel
names contain spaces, they must be surrounded by quotes, for example, "MEG 0111"
.
mne_ctf2fiff¶
--verbose
Produce a verbose listing of the conversion process to stdout.
--ds <*directory*>
Read the data from this directory
--omit <*filename*>
Read the names of channels to be omitted from this text file. Enter one channel name per line. The names should match exactly with those listed in the CTF data structures. By default, all channels are included.
--fif <*filename*>