fNIRS / snirf

SNIRF Format Specification
http://fnirs.org/resources/software/snirf/
Other
58 stars 33 forks source link

question about stim value #12

Closed dboas closed 3 years ago

dboas commented 5 years ago

Jay wrote: David and Qianqian,

Had a question about the stim structure. We now have

stim(n).name stim(n).data

stim(n).data is a 3 column array where each row corresponds to a stimulus trial and the three columns indicate [starttime duration value].

In Homer2, users can manually reject/toggle stims and we indicate this with various non-zero and non-one values. Assuming we want to preserve this functionality in SNIRF and Homer3, do we use the last column for this purpose?

I didn't see any description in the Spec about the last column. Should we add a short description of it's use?

dboas commented 5 years ago

Jay, turning stim on and off is data analysis software specific. We can hijack 'value' in stim(n).data for this purpose. As for the spec, for now we can leave value as undefined and people can use it how they like. I believe this spec for stim follows what is used for SPM. We can look that up to see how they define 'value'

forihuelaespina commented 5 years ago

In this regard, highjacking the scalar "value" might be insufficient. For some experiments, it may be interesting to associate to trials some information more elaborated than just a scalar value; e.g. picture, audio, event information, etc.

dboas commented 5 years ago

The description of how stim condition parameters are described in SPM is found on page 64 and 65 in this manual. Here. https://lsa.umich.edu/psych/danielweissmanlab/downloads/spm8_manual.pdf

Text copied here:

Conditions You are allowed to combine both event- and epoch-related responses in the same model and/or regressor. Any number of condition (event or epoch) types can be speci ed. Epoch and event- related responses are modeled in exactly the same way by specifying their onsets [in terms of onset times] and their durations. Events are speci ed with a duration of 0. If you enter a single number for the durations it will be assumed that all trials conform to this duration.For factorial designs, one can later associate these experimental conditions with the appropriate levels of experimental factors.

Condition An array of input functions is constructed, specifying occurrence events or epochs (or both). These are convolved with a basis set at a later stage to give regressors that enter into the design matrix. Interactions of evoked responses with some parameter (time or a speci ed variate) enter at this stage as additional columns in the design matrix with each trial multiplied by the [expansion of the] trial-speci c parameter. The 0th order expansion is simply the main e ect in the rst column.

Name Condition Name

Onsets Specify a vector of onset times for this condition type. This can be entered using the keyboard eg. typing in \100 300" and then hitting return or \100;300" or [100,300]" or [100,300]". More usually, however, this speci cation takes place using variables that have been created before and loaded into matlab. For example, an my_onsets cell array1 might exist in a le you created earlier called my_design.mat. You would then type load my_design at the matlab command prompt before pressing the `Specify 1st-level' button. You could then specify the onsets for condition 2 by typing in eg. my_onsets{2} instead of entering the numbers via the keyboard.

Durations Specify the event durations. Epoch and event-related responses are modeled in exactly the same way but by specifying their di erent durations. Events are speci ed with a duration of 0. If you enter a single number for the durations it will be assumed that all trials conform to this duration. If you have multiple di erent durations, then the number must match the number of onset times.

Time Modulation This option allows for the characterisation of nonstationary responses. Speci cally, you can model either linear or nonlinear time e ects. For example, 1st order modu- lation would model the stick functions and a linear change of the stick function heights over time. Higher order modulation will introduce further columns that contain the stick functions scaled by time squared, time cubed etc.

Parametric Modulations The stick function itself can be modulated by some parametric variate (this can be time or some trial-speci c variate like reaction time) modeling the interaction between the trial and the variate. The events can be modulated by zero or more parameters. See [16, 14] for further details of parametric modulations.

Multiple conditions If you have multiple conditions then entering the details a condition at a time is very inecient. This option can be used to load all the required information in one go. You will need to create a .mat le containing the relevant information. This .mat le must include the following cell arrays: names, onsets and durations eg. names{2}='SSent-DSpeak', onsets{2}=[3 5 19 222], durations{2}=[0 0 0 0] contain the required details of the second condition. These cell arrays may be made available by your stimulus delivery program eg. CO- GENT. The duration vectors can contain a single entry if the durations are identical for all events. You then need to use SPM's le selector to select this *.mat le.

Regressors Regressors are additional columns included in the design matrix, which may model e ects that would not be convolved with the haemodynamic response. One such example would be the estimated movement parameters, which may confound the data.

Regressor Name Enter name of regressor eg. First movement parameter Value Enter the values that the regressor takes. This could also be, for example, the name of a variable in MATLAB's work space that you have previously loaded in from a le. This might be a subjects movement parameters or reaction times.

Multiple regressors If you have mutliple regressors eg. realignment parameters, then entering the details a regressor at a time is very inecient. This option can be used to load all the required information in one go. You will rst need to create a .mat le containing a matrix R. Each column of R will contain a di erent regressor. When SPM creates the design matrix the regressors will be named R1, R2, R3, ..etc. You then need to use SPM's le selector to select this .mat le.

High-pass filter The default high-pass lter cuto is 128 seconds. Slow signal drifts with a period longer than this will be removed. Use \Explore design" to ensure this cut-o is not removing too much experimental variance. This is described later in section 8.10. High-pass ltering is implemented using a residual forming matrix (i.e. it is not a convolution) and is simply a way to remove confounds without estimating their parameters explicitly. The constant term is also incorporated into this lter matrix.

fangq commented 5 years ago

@dboas and @jayd1860, is this issue resolved? if yes, please feel free to close.

sstucker commented 3 years ago

Closing this-- discussion about an extension of stim/data that resolves the issue is ongoing here