Skip to content

KIT to FIFF Conversion

Christian Brodbeck edited this page Mar 31, 2020 · 2 revisions

KIT to FIFF conversion

The kit2fiff conversion utility is part of MNE-Python. It can be started from a bash terminal (Linux) with:

$ mne kit2fiff

Or from a Python session (Windows and Linux):

>>> import mne
>>> mne.gui.kit2fiff()
KIT-2-FIFF GUI Overview
Figure 1. The kit-2-fiff GUI on macOS. Sections below refer to panel numbers.

1. Pre-marker

Select the file containing the pre-marker. Once selected, the markers should appear in the middle view (you might have to click-drag the mouse on the view). At first, only the blue (final) markers are visible because only one set is selected.

2. Post-marker

Select the second set of markers. Now, the pre (red), post(green) and combined (blue) markers should be visible.

3. Combine

Change the way the markers are combined. The default (Transform) is to use the pre-markers and move them half-way to the post-marker position. Alternatively, they can be averaged.

4. Other files

  • Data: The MEG data

  • Digitizer Head Shape: *.hsp file from the head shape digitizer

  • Digitizer Fiducials: *.elp file from the head shape digitizer

7. Exclude markers

If a marker is bad even after combining pre- and post-markers, it can be turned off here.

6. Events

While KIT files represent events as binary impulses on multiple channels, FIFF files represent events in a single channel which has an integer value at each time point (0 if there is no event). Conversion to the FIFF format thus entails merging events from multiple channels into a single time series:

  • Event onset: Whether events in the KIT channels are represented as signal drop (Trough) or as signal increase (Peak).

  • Value Coding: How to convert *.sqd channel indexes to *.fif event values. Little-endian and Big-endian treat successive channels as bits of a binary number. Channel# uses the KIT channel index as event value; if multiple channels are on at the same time, their values are summed.

  • Channels: specify the channels that contain events in the KIT file.

  • Threshold: Threshold for detecting events in the analog trigger channel (KIT channels are recorded as continuous value, and the Threshold is used to turn this into a binary state).

Use the Find Events button to test the settings.

7. Save

Once all settings are correct, use the Save FIFF…​ button to save. Once saving is in progress, you can move on:

  • If the same subject has multiple raw files, just switch the Data in panel 4 and save again.

  • To move to the next subject, use the Clear All button to reset the data files (event settings will stay).

Note
FIFF files have a 2 Gb size limit. If that limit is exceeded, additional files with number tags (-1 etc.) in their filenames are produced. The first file contains a reference to the filenames of the additional files, so that when reading the first file, the additional files are automatically read too. As a consequence of this, however, the additional files cannot be renamed without breaking this linkage.

Common issues

Defective Markers

Sometimes individual markers are defective, as in the example below:

Files added

It looks like the red central forehead marker is off. To find out what its index is, check the Label checkbox in section 1 (it is marker 2). Uncheck the 2 box in section 2 to not use the defective marker for fitting.

Marker turned off

Recording split into multiple files

When a recording was split into multiple *.sqd files these can be combined into a single *.fif file with the following steps:

  1. Convert the *.sqd files to *.fif as if they were separate recordings (they can share the digitizer info, so after saving the first one just switch the Data in panel 4 and save again).

  2. Combine the *.fif files as described in Concatenating-*-raw.fif-files