Turbo-BrainVoyager v4.4

ROI Activation Feedback Calculation

For many (clinical) neurofeedback applications, it is desirable to visualize the mean activation level from selected ROIs to the participant in the scanner. The Neurofeedback dialog can be used to select one or more ROIs and to prepare feedback display options as described in the previous topic. In this section, details about the calculation of neurofeedback signals from ROIs are described and how calculation is controlled using options in the Feedback settings field in the Neurofeedback dialog.

Feedback Calculation

Given a baseline level bl (see below), the feedback value fb for the current time point (without/prior to averaging) with value val is calculated within a neurofeedback trial simply as follows:

fb = (val - bl) / bl * 100

This results in a percent signal change (PSC) value that can be used for neurofeedback, e.g. by filling a thermometer display (see below). Note that if the detrending time course (default) option is used in version 4.2 or later, the input values to the neurofeedback calculation are already (GLM detrended) PSC values. In this case, the equation simplifies to:

fb = (val - bl)

It is recommended to use detrended PSC values since this provides optimized ("cleaned") data for neurofeedback. To convert the PSC feedback value to a corresponding fill level of a feedback display such as a thermometer, the resulting value is related to the maximum percent signal change value as specified in the Max PSC 1 field (the Max PSC 2 field is used for the second thermometer display in case that two ROI feedback thermometers are shown as described earlier). If, for example, the calculated fb value is 1,2% and the max psc value is set to 2%,, the thermometer would be filled 60%, i.e. 6 out of 10 rectangles will be filled since fb/max_psc = 0.6. To find good values for the maximum PSC value, it might be useful to observe achievable neurofeedback amplitudes for specific ROIs in localizer or test runs. It is also possible to automatically set the max-PSC value by enabling the Set to max measured option, which will set the value in the Max PSC 1 field to the maximum feedback value obtained until the current time point.

The Average feedback values spin box can be used to specify the number of time points that are averaged to calculate the current feedback value. With a value of "1" no averaging takes place, i.e. the feedback value is based directly on the current time point's ROI signal value. If the averaging value is larger than 1, the last N calculated feedback values are averaged to calculate the current feedback value. This effectively implements a temporal low-pass filter (smoothing) that "stabilizes" the feedback signal. In order to avoid, however, additional delays during TR-by-TR feedback, we recommend to use a rather small value for averaging time points in the range of 2 to 5 (default: 3).

Baseline Identification and Calculation

Normally the baseline is calculated based on the "rest" or "fixation" condition prior to an active modulation (neurofeedback) condition. TBV identifies automatically the first condition in the stimulation protocol (provided in the TBV Settings file) as the "baseline" condition. If another condition is the "baseline" condition in your protocol, select it in the Condition box in the Feedback baseline data points field (see snapshot below). Note, however, that it is highly recommended to always define a baseline condition as the first condition in a stimulation protocol since the first condition is also identified as the baseline condition in statistical (GLM) calculations.

When calculating the baseline for time points of a neurofeedback block, TBV uses the baseline interval defined just before the interval of the current feedback condition, which can be any other "modulation" condition (e.g. one or more different mental tasks). Using the baseline just before a modulation block is useful since only values in a small window are used which reduces the effect of global drifts on the calculated baseline and feedback values. To further ensure that the neurofeedback signal is as clean as possible, detrended PSC time courses should be used as described above.

Because of the sluggishness of the BOLD response, the values defined by a baseline interval should not be used as defined in the protocol but should take the hemodynamic delay into account. In order to protect the BOLD decay from a previous modulation condition, values at the begin of the baseline condition need to be excluded. The number of points to exclude can be specified with the Shift at begin spin box. The default value entered here by TBV is calculated simply by dividing the value 6 by the time-to-repeat value (TR in units of seconds) specified in the TBV settings file; if, for example, the TR is 2000 milliseconds, the default shift at the begin of the previous baseline will be 6/2 = 3 time points. If the previous baseline condition occurred, for example, from time points 60 - 69 (10 data points), the actual values considered for baseline calculation would be from 63 - 69 in case of value 3 for the shift at the begin of the baseline interval. In a similar way one can also extend points "to the right side" at the end of a baseline interval since it takes some time until the BOLD signal rises in the modulation block. Since it is expected that the signal starts to rise already after about 2-3 seconds, the shift into the modulation interval should be, however, smaller than at the begin of the baseline condition. As default, TBV calculates the shift at the end of the previous baseline interval as a third of the shift at the begin; in our example this leads to a value of 1 (3/3). The default value can be changed, however, using the Shift at end spin box. The final points that would be used as default to calculate the baseline for the interval 60 - 69 with a TR of 2 seconds would, thus, be 63 - 70. The signal values of the identified data points (8 in the example) will be averaged to obtain the baseline level bl for the subsequent modulation block (see above). Note that 4 points are minimally required for a pre-modulation baseline (at least 10 are recommended), otherwise no feedback output is produced in the thermometer display.

As an alternative to use the previous baseline for a modulation block, it is also possible to use the baseline value calculated by the GLM analysis of the ROI time course selected for neurofeedback. The calculated baseline value is then the predicted value when using only the confound predictors (constant, linear trend, eventually also non-linear trend predicotrs and motion parameters) of the GLM design matrix (for details, see topic Detrending Predictors Timing). In case that detrended PSC time courses are used, the baseline value is then simply 0% since the value predicted by the confound predictor is used to calulate the PSC values of the ROI time course display. If you prefer using the GLM calculated baseline instead of the mean value of the preceding values, turn on the Use GLM detrended baseline option. This option provides a more stable baseline than the rather small amount of values in a pre-feedback baseline interval. On the other hand, the pre-baseline interval approach reflects the current signal level best. While usually leading to very similar feedback values, both options have their merits and are, thus, both provided. 

Note. ROI time course detrending is enabled as default for time courses since TBV 4.2. Detrending can also be turned on/off using the D key or the Display Detrended Time Courses item in the View menu. While this is useful during localizer runs or when re-analyzing datasets, detrending should not turned off and on during a neurofeedback run since it might lead to wrong feedback values if the toggle is pressed during a modulation block.

Notes for previous versions. In previous versions (v3.0 and earlier), TBV identified baseline condition(s) by checking the name of each condition of the current protocol and assumes a baseline condition if the condition name contains the string "fix", "baseline" or "rest". This check is performed case-insensitive, e.g., both "Fixation" and "Cond-rest" would be identified as baseline conditions. Alternatively one can append "_0" to any condition name in the protocol to indicate that the respective condition intervals should be used as baseline epochs. TBV looked for a baseline condition in the past of the current time point within a window maximally of the size specified in the Baseline detection window spin box. The first baseline epoch discovered before an active neurofeedback trial was used for baseline calculation (averaging). If the window is so large that it encompasses earlier baselines, those epochs were not included in the calculation, i.e. just the baseline before an active neurofeedback trial was used. Since the search for a baseline epoch begins at the current time point, the value in the Baseline detection window spin box (default: 60) should be at least as large as the sum of the (longest) baseline and the (longest) active neurofeedback condition. The values of the baseline are not used directly but accommodate for the expected hemodynamic delay that was internally calculated simply as 6s / TR with TR in units of seconds. In order to prevent that values of the early rise of BOLD response in the next feedback trial is included in the baseline calculation, the hemodynamic delay was actually not added to the end of the rest epoch, i.e. the actual values used for baseline calculation of interval 60-70 would have been 63 - 70. Note also that the detected baseline period must have more than 3 data points otherwise the last (previously) calculated baseline is used as a fall-back option.

Logging Moment-to-Moment Calculations to Disk

The program provides several logging options to save data to disk during real-time processing (see below). Since TBV 4.0, the Neurofeedback dialog always saves a "neurofeedback value" (.NFV) file to disk at each time point, which can be used to perform custom feedback calculations and feedback presentations. Furthermore the logged information can be used after a real-time run to inspect what values have been calculated by the software at each moment in time, e.g. to reproduce precisely what feedback was provided to participants. The logged values can also be used for post-hoc statistical analyses, e..g. to analyze learning effects over time.

During real-tine processing, the files with the ".nfv" extension will be stored incrementally in the feedback folder, i.e. the (relative) path provided in the FeedbackFolder entry in the Folders tab of the TBV Settings dialog. If, for example, an experiment is named "sub-04_neurofeedback_run-02", the files "sub-04_neurofeedback_run-02-1.nfv", "sub-04_neurofeedback_run-02-2.nfv", "sub-04_neurofeedback_run-02-3.nfv" and so on will be stored incrementally in the feedback folder, i.e. one file for each time point. Each file contains all re;evamt values used to calculate feedback signals from the (detrended) time course values of the used ROI(s), including the current baseline and ROI value as well as relevant current settings such as the maximum percent signal change value, the calculated feedback level used to "fill" the thermometer, the current condition and the parameters specifying how the baseline window is adjusted at the begin and end of the selected baseline condition. A typical example of a .NFV file when using detrended PSC time courses is shown below:

CurTimePt:  80
Baseline1:  -0.0710152909
CurValue:   1.1595937
MaxPSC:     2
AvgLastN:   3
FbLevel:    6
TargLevel:  0
CurCond:    1
BLWndShift: 3 1

The first entry "CurTimePt" indicates that this file contains information calculated for neurofeedback at time point 80 during real-time processing. The "Baseline1" entry contains the baseline level calculated from the (detrended) time course values of ROI1. From these values the feedback value can be calculated as:

fb = (1.1595937 - -0.0710152909) = 1.23

Relating the calculated absolute value to the maximum percent signal change ("MaxPSC") value 2, the rescaled feedback value results in 1.23 / 2.0 = 0.615. This value is converted to the number of filled entries in the thermometer by multiplying with the number of available levels (usually 10 if no negative values are shown) followed by a simple rounding operation which results in value 6 (rounding value 6.15). While this matches the "FbLevel" entry in the example above, the value may also be different! The reason becomes clear when looking at the "AvgLastN" entry which specifies that the last 3 values are used to calculate the feedback value. If one wants to recalculate the presented feedback value, one needs, thus, to include also the values logged at time point 79 (t - 1) and 78 (t - 2). For the example data, the values are: val_79 = 1.17 and val_78 = 1.22, which results, after subtraction of the respective (same) baseline value, in the averaged feedback value of:

fb = (1.23 + 1.24 + 1.29 ) / 3.0 = 1.25

Relating this value now to the "MaxPSC" value of 2.0, we obtain value 0.63 which corresonds to the logged "FbLevel" value of 6 after multiplying by 10 and rounding operation. Note that it is important to calculate the feedback values for individual time points using the baseline value from that time point - which is the same for all values within a neurofeedback block but will differ across neurofeedback blocks in case that the standard pre-modulation block baseline option is used. In case that the GLM baseline option is used for detrended data, the value will be simply '0.0'. For details of detrending time courses and the effects of confound predictors, see topic GLM Confound Settings.

Other logging options. The logging options provided in previous software versions are also available. The "ROI Time Points" (.RTP) files, for example, log each value of ROI time courses to disk. This option can be turned on and off using the Log ROI Time Points File (RTPs) option in the Analysis menu. If enabled a file with the .rtp extension will be stored in the specified feedback folder (FeedbackFolder entry in the Folders tab of the TBV Settings dialog); if, for example, an experiment is named "S3_FFA_Feedback", the files "S3_FFA_Feedback-1.rtp", "S3_FFA_Feedback-2.rtp" and so on will be stored incrementally in the feedback folder, i.e. one file for each time point. Each file contains one line of information containing as the first entry the number of ROIs, then a list of the (detrended) signal values for each ROI and finally a numerical value indicating the protocol condition at that time point. In the case of two ROIs, for example, a typical ".rtp" file would look like this: "2 698.782 685.294 1"; here the first ROI has an average value of 698.782 and the second ROI a value of 685.294 at the respective time point; the last value indicates that at this time point, condition "1" was employed; since the latter value is zeroe-based, value "1" corresponds to the second condition in the experimental protocol file, i.e. the first condition (usually a baseline condition) will be indicated with value "0".

Additional real-time information for custom processing is stored incrementally to disk when turning on the Log ROI Voxel Time Courses (ERT) and/or Log Estimated ROI Betas (BTC) options in the Analysis menu. With these options, however, the respective information is not saved in a sequence of separate volume-by-volume files, but is stored in a single ".ert" or ".brt" file, respectively. Data from each volume is appended incrementally to the respective file during real-time processing. Note that you can also use the plugin interface to access ROI (and other) information for custom feedback processing.


Copyright © 2002 - 2024 Rainer Goebel. All rights reserved.