Skip to content

Starting ninjaGUI

aortega255 edited this page Oct 27, 2020 · 4 revisions

If ninjaGUI is being run on Matlab, then it can be run by simply typing the command "ninjaGUI" in the root folder for the ninjaGUI code. It can also be run with one input (i.e. "ninjaGUI('file.cfg')"), where the input is the name of a .cfg file. If no argument is passed to the command, or if the .cfg file does not exist, a browse window will appear asking the user to select a .cfg in their hard drive.

The .cfg files are used to define the hardware specifications of the device. As ninjaGUI is compatible with different hardware devices, and as some of those devices might have multiple configurations (for example, ninjaNIRS is modular so each system might have a different number of optodes, or a different set of auxiliaries), the .cfg file tells the GUI details of the hardware so it can define how the GUI will interact with the hardware.

If no .cfg file was specified/found and the file selection window for the .cfg file is canceled, the app will automatically call the hardware configuration GUI (see next figure):

ninjahwsel2

(The hardware configuration GUI can also be run independently with the app designer, it is called "hardwareselect.mlapp"). The purpose of this GUI is creating a valid .cfg file so we can provide it to the GUI in the next run. The parameters we can actually modify will depend on the Device type we select (ninjaNIRS, NIRS1k, etc).

The selection of the serial port to use will be specific to the computer. When we click on the drop-down list for the serial port, the configuration app will show all currently active serial ports in the computer (see next screenshot).

ninjahwsel1

Assuming ninjaNIRS is correctly connected to the computer via the USB cable, it will appear in the dropdown list as two separate COM ports numbered consecutively (in this example, COM7 and COM8 are the ones corresponding to ninjaNIRS). We need to select the first of these two consecutive serial ports (in the example, COM7). If there are multiple pairs of ports and we are not sure which one is the device, we can disconnect the device and click on the dropdown list again. The two ports will have disappeared from the list, so after connecting again we can choose the first one of the two that appear.

Depending on the type of selected hardware, some of the other options might be fixed or available to modify:

Number of sources: specify the number of sources connected to your fNIRS device. If the device is ninjaNIRS, you need to write down the number of optodes connected to your ninjaNIRS unit.

Number of detectors: specify the number of detectors connected to your fNIRS device. If the device is ninjaNIRS, you need to write down the number of optodes connected to your ninjaNIRS unit.

Laser power control: this parameters determines how (if) the source power is controlled for the device. Generally, this property is fixed to the fNIRS hardware and it can't be changed.

Number of wavelengths: specify how many different wavelengths are used per source for this fNIRS device. Generally, this property is fixed to the fNIRS hardware and it can't be changed.

Wavelength 1/2: specify the wavelength (in nanometers) of the sources used in the device. Generally, this property is fixed to the fNIRS hardware and it can't be changed.

Adjustable gain: determines if the detector gains of the device can be changed or are fixed. Generally, this property is fixed to the fNIRS hardware and it can't be changed.

Adjustable sampling rate: determines if the sampling rate of the device can be adjusted. Generally, this property is fixed to the fNIRS hardware and it can't be changed.

Sampling rate: specify the acquisition rate (in samples per second) for the device. Only modifiable for some types of fNIRS devices.

Number of auxiliary ports: this number is used to specify the number of physical auxiliary ports AVAILABLE for this hardware device (regardless if they are being used or not).

File name for cfg file: a character string used as a name for the .cfg file to be generated when pressing the "done" button.

Auxiliary port labels: this are just used to tell the GUI a label for the auxiliary signal connected to each available port. The default is "NONE", which indicates that auxiliary port is not being used. Auxiliary signal channels labeled as "NONE" cannot be visualized when the acquisition is running. Otherwise, specify a character label for each auxiliary port. These names are used only for display purposes. If the ninjaNIRS device is equipped with a remote trigger/accelerometer card, then Aux 1 will always be a signal for the X-axis of the accelerometer, Aux 2 the Y-axis and Aux 3 the Z-axis. Aux 4 is the temperature. We need to write the appropriate labels manually in those fields.

Once we press done, if we specified all parameters, the .cfg file will be created and the application will end. We can run ninjaGUI again and select the recently created .cfg file. This will start the next phase of the startup sequence (selecting a probe file).

Once a .cfg file has been created, it can be reused for all experiments using the same hardware connected to the same computer. If the hardware is migrated to a different computer, it might be necessary to create a new .cfg file specifying the correct serial COM port used in the new computer.