Skip to content

.cfg file

aortega255 edited this page Jul 28, 2020 · 3 revisions

The .cfg files are used to store pre-defined information about the hardware configuration. Their main purpose is to have several configurations ready in case there are multiple fNIRS devices connected to the host computer. It is always necessary to load a .cfg file to run ninjaGUI, as the file will determine several aspects of the GUI.

.cfg files are binary files in the Matlab format. Thus, they can easily be loaded in Matlab with the 'load' command. They simply contain a structure called devinfo. The structure devinfo contains the following twelve fields:

  • devID: this is a string simply containing the type of fNIRS hardware this configuration is being used for. For example, 'fNIRS1k'. The GUI uses this string in order to determine the appropriate serial commands for the device, so it needs to be equal to a supported device, otherwise the GUI will terminate by saying the device is not compatible. Right now, only two devIDs are compatible: 'fNIRS1k' and 'ninjaGUI'.
  • commPort: indicates the serial port which is being used for the fNIRS device (for example, 'COM5'). This can be found by using the command seriallist on the Matlab console when the device is connected to the computer.
  • auxList: this is a cell array of strings of size 1 by nAux. It indicates the label for the auxiliary signals connected to the fNIRS device. For example {'Accelerometer','Trigger','NONE','NONE','NONE'}. 'NONE' should be used for auxiliary ports with nothing connected to them. If an auxiliary port is designated as 'NONE' it is not possible to display it on the GUI.
  • nSrcs: the number of sources in the device. Depending on the device it might be fixed or variable. For example, fNIRS1k only has 4 sources (and always have 4 sources). ninjaGUI is more modular, and can have from 1 to 32 sources. As of today, the ninjaNIRS optodes are always a source detector-pair, so for ninjaNIRS nSrcs is always equal to nDets (but that's not the case for other types of devices).
  • nDets: the number or detectors connected to the fNIRS device.
  • LaserPowerControl
  • AdjustableGain: if the gain of the detectors can be adjusted, this should be 1. Otherwise 0.
  • AdustableRate: determines if the sampling frequency is fixed (0) or adjustable (1).
  • Rate: sampling frequency. This might be a fixed number for some devices, or able to be configured for other devices.
  • nLambda: the number of wavelengths used in the hardware device. Currently, all of our devices uses exactly two wavelengths.
  • Wavelengths: 1 by nLambda array. Each element is each one of the wavelengths used in the device (in nanometers). For example, [730,850].
  • nAux: number of auxiliary ports existing in the hardware device. We should specify the full number even if we do not have a signal plugged to all of them.