{"id":2621,"date":"2014-01-24T10:42:46","date_gmt":"2014-01-24T10:42:46","guid":{"rendered":"http:\/\/www.physiologicalcomputing.net\/?page_id=2621"},"modified":"2021-12-22T20:28:24","modified_gmt":"2021-12-22T20:28:24","slug":"biopac-fnirs-to-homer2-file-conversion-scripts","status":"publish","type":"page","link":"http:\/\/www.physiologicalcomputing.net\/?page_id=2621","title":{"rendered":"BIOPAC fNIRS to Homer2 file conversion scripts"},"content":{"rendered":"<p>Dear All<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>How to use the scripts:<\/p>\n<p>Download the zip folder, see below, and add it to your Matlab pathway. Open the &lt;test_all.m&gt; file.\u00a0 This is the file that converts your data. You don\u2019t need to open any of the other files, but they have to be in the same folder as the &lt;test_all.m&gt; file.<\/p>\n<p>If you don\u2019t know anything about Matlab I suggest that you just run the script with the test data. It uses the &lt;TEST_homer_test&gt; 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.<\/p>\n<p>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.<\/p>\n<p>Once you\u2019ve 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).<\/p>\n<p>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 &lt;test_all.m&gt; script might not work if the markers are not set right.<\/p>\n<p>To open the file in Homer2 go to the directory \u00a0for 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 \u2018Load Process Options File\u2019; \u00a0click \u201ccancel\u201d 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.<\/p>\n<p>Good luck<\/p>\n<p>Ute<\/p>\n<p>Click to download zip file &#8211;\u00a0<a href=\"http:\/\/www.physiologicalcomputing.net\/wordpress\/wp-content\/uploads\/2014\/01\/Convert-BIOPAC-to-Homer21.zip\">Convert BIOPAC to Homer2\u00a0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dear All 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 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"spay_email":""},"jetpack_shortlink":"https:\/\/wp.me\/PY315-Gh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/pages\/2621"}],"collection":[{"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2621"}],"version-history":[{"count":2,"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/pages\/2621\/revisions"}],"predecessor-version":[{"id":2628,"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=\/wp\/v2\/pages\/2621\/revisions\/2628"}],"wp:attachment":[{"href":"http:\/\/www.physiologicalcomputing.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}