Exporting HRF data - BUNPC/Homer3 GitHub Wiki

Introduction:

Homer3 can export HRF time course and mean HRF data to a spreadsheet-friendly text file. The mean HRF export, calculates the mean HRF for every subject X every channel X every condition in a group, and produces a file for every subject in a group. Prior to using this feature, first make sure to generate the HRF, by running the processing stream calculation.

Exporting Processed Data (HRF) to Tab-Separated Text File


As with most other features in Homer3, exporting HRF applies to the currently selected processing element in the data tree hierarchy.

To export the HRF of a specific processing element follow these steps:

  1. Select a current processing element you wish to export, as shown in the Selecting Current Processing page.

  2. File menu --> Export --> HRF.



  1. The ExportDataGUI dialog will appear. By default, Data Type dropdown menu will be set to 'HRF'. Leave it as is (unless you want to export HRF mean instead). Select which processing elements you want to export in the Processing Element Selection Panel: Current Proc Element Only or Current Proc Element And All Under It.



  1. Click the SUBMIT button.

Once the exporting is completed a separate .txt file will be generated for every processing element that the user chose.

Exporting Mean HRF:

Exporting mean HRF applies only the currently selected group (versus any selected processing element). The mean HRF export, calculates the mean HRF for every subject X every channel X every condition in a group, and produces a single file containing the mean HRFs for all condition and channels of every subject in the currently selected group.

To export the mean HRF of a specific processing element follow these steps:

  1. Select the current group you wish to export, as shown in the Selecting Current Processing page.

  2. File menu --> Export --> HRF.



  1. The ExportDataGUI dialog will appear. Data Type dropdown menu will be set to 'Subjects HRF mean'. Leave it as is unless you want to export HRF instead.



  1. Select HRF time range in the Time Range Selection Panel. The time range is relative to the stimulus onsets but should also be within the range of the HRF time range (tHRF) used in processing stream use to produce it.

  2. Click the SUBMIT button.

Once the exporting is completed a single file will be produced, containing the mean HRFs for all condition and channels of every subject in the currently selected group.

Exporting Processed Data to SNIRF File (NEW)

In addition to exporting HRF to tab-separated text file you cal also export to SNIRF files. For every .mat file produced in derived data a .SNIRF file is generated when you choose to export Current Proc Element AND All Under It in the export GUI. Go to


File menu --> Export --> Export to SNIRF.



You will see a printout in the command window (or output console if running Homer3 executable) of all the exported files for every processing level of the data tree.


Basic Display of Derived HRF data in SNIRF File


It can be very convenient to view SNIRF file data standalone on the Matlab command line. To do this download DataTree library (see wiki page Working With Datasets using DataTree Library). Once DataTree library is installed, you have access to the SnirfClass function that loads a SNIRF file.

Let's say you want to plot the HbO HRF from the 4th run of subject 3 channels S01-D02 and S01-D04, condition 3. The SNIRF file that contains this data in this example is


C:/Users/Public/homer3/UnitTests/Example9_SessRuns/derivatives/homer/SimpleProbe3_run04.snirf

Load SNIRF file by typing
s = SnirfClass('C:/Users/Public/homer3/UnitTests/Example9_SessRuns/derivatives/homer/SimpleProbe3_run04.snirf')

The measurement list channels for HbO HRF from the 4th run of subject 3 channels S01-D02 and S01-D04, condition 3 are specified as a num of channels X 4 matrix.

1,2,3,1
1,4,3,1

The meaning of the 4 columns in the second dimension are
[ source index, detector index, condition index, data type index {1=Hb, 2=HbR, 3=HbT} ]


To plot type:
s.Plot([1,2,3,1; 1,4,3,1])

⚠️ **GitHub.com Fallback** ⚠️