jsheunis / fMRwhy

Facilitating BIDS-compatible multi-echo fMRI analysis and quality control with SPM12 and Matlab
GNU Lesser General Public License v2.1
10 stars 1 forks source link

info that is extractable from BIDS data or metadata #20

Open Remi-Gau opened 3 years ago

Remi-Gau commented 3 years ago

Going through the default settings, some values that the users must enter either MUST be present or could be present in the BIDS dataset and bids-matlab can get those data.

% Define sequence parameters, this should be known to the user.
% fMRwhy does not yet support deriving these parameters from the BIDS json files

options.TR = 2;    <-------------- HAS to be present for any bold data
options.N_slices = 34;     <--------------- can be derived from the size of the nifti file

% Specify number of dummies, even if they have already been excluded from the BOLD timeseries images. 
% This is important for the TAPAS PhysIO steps when processing cardiac and respiratory data.
options.Ndummies = 5;  <--------------- this should be in the JSON file of the func file. If the user knows it then it should not be entered here.

% The number of scans in the BOLD timeseries images, excluding dummies.
options.Nscans = 210;  <--------------- can be derived from the size of the nifti file

% The echo times if multi-echo. fMRwhy assumes this is the same for all functional runs. If not multi-echo, set to [].
options.TE = [14 28 42];     <-------------- this too should be in the json file, no?

There also seems to be quite a few things from the first level of the GLM that could be removed from having the user fill it in.

% Settings for first level analysis: task-motor
options.firstlevel.motor.run1.sess_params.timing_units = 'secs'; <------------- BIDS using seconds as unit so I would make that a default
options.firstlevel.motor.run1.sess_params.timing_RT = 2;  <----------- this should be readable from either the nifti or the json

% Settings for plotting task conditions
onset = [11; 31; 51; 71; 91; 111; 131; 151; 171; 191];   <------------ can't those be read from the events.tsv pre-GLM or the SPM.mat post-GLM ?
duration = [10; 10; 10; 10; 10; 10; 10; 10; 10; 10]; <------------ can't those be read from the events.tsv pre-GLM or the SPM.mat post-GLM ?
options.firstlevel.motor.run1.plot_params.cond_onset = onset;
options.firstlevel.motor.run1.plot_params.cond_duration = duration;
jsheunis commented 3 years ago

Thanks for isolating these @Remi-Gau !

Deriving these probably fit well in the fmrwhy_settings_validate() function. And this could be a good first issue for someone.