I have briefly worked with Homer2 and the BIOPAC fNIRS device (fNIRS 100) and have created the following scripts to convert a COBI studio file to the .nirs files used by Homer2.
I am not a Matlab expert and the scripts may therefore not be perfect, please feel free to modify them as you see fit; I will therefore not take any responsibility for any work resulting from the use of these scripts.
How to use the scripts:
Download the zip folder, see below, and add it to your Matlab pathway. Open the <test_all.m> file. This is the file that converts your data. You don’t need to open any of the other files, but they have to be in the same folder as the <test_all.m> file.
If you don’t know anything about Matlab I suggest that you just run the script with the test data. It uses the <TEST_homer_test> files as an example if you just open it and run it as-is. That way you can have a look in the Workspace, and see what the end result should look like. Each variable tells you different things about your data.
d = data; t = trigger; s = time and SD has your settings for the user GUY in it. After running the script you will also see that a new variable has been created with the same file name (here TEST_homer_test_07011313) and the ending .nirs; this is the file that Homer2 will use.
Once you’ve had a look at it you can just change TEST_homer_test_07011313 to your variable name and run the script again (you will have to do this 3 times, in line 6, 7 and 16. Make sure that the endings .nir, .mrk and .nirs stay as they are now).
A note on the markers: I have used only two markers (1 and 4 using the parallel port) in my experiments. The Matlab script for the triggers is set out to take only take these two into consideration, you will have to modify the script (gettriggers.m) if you have used different markers. The <test_all.m> script might not work if the markers are not set right.
To open the file in Homer2 go to the directory for the .nirs file you have just created. Homer2 will automatically identify your file and try to open it. It will also open a box titled ‘Load Process Options File’; click “cancel” on the box unless you have previously created a process file. Homer2 will proceed to open your file and you can start working with it.
Click to download zip file – Convert BIOPAC to Homer2