55<!-- TOC -->
66
77- [ functions description] ( #functions-description )
8- - [ userInputs] ( #userinputs )
98 - [ createFilename] ( #createfilename )
109 - [ saveEventsFile] ( #saveeventsfile )
11- - [ checkCFG] ( #checkcfg )
12- - [ CFG content] ( #cfg-content )
1310 - [ createBoldJson] ( #createboldjson )
1411
1512<!-- /TOC -->
1613
1714<!-- lint enable -->
1815
19- ## userInputs
20-
21- Get subject, run and session number and make sure they are positive integer
22- values.
23-
24- By default this will return ` cfg.subject.session = 1 ` even if you asked it to
25- omit enquiring about sessions. This means that the folder tree will always
26- include a session folder.
27-
28- ``` matlab
29- [cfg] = userInputs(cfg)
30- ```
31-
32- If you use it with ` cfg.subject.askGrpSess = [0 0] ` , it won't ask you about
33- group or session.
34-
35- If you use it with ` cfg.subject.askGrpSess = [1] ` , it will only ask you about
36- group
37-
38- If you use it with ` cfg.subject.askGrpSess = [0 1] ` , it will only ask you about
39- session
40-
41- If you use it with ` cfg.subject.askGrpSess = [1 1] ` , it will ask you about both.
42- This is the default behavior.
43-
4416## createFilename
4517
4618Create the BIDS compliant directories and filenames (but not the files) for the
@@ -64,76 +36,6 @@ Function to save output files for events that will be BIDS compliant.
6436If the user DOES NOT provide ` onset ` , ` trial_type ` , this events will be skipped.
6537` duration ` will be set to ` n/a ` if no value is provided.
6638
67- ## checkCFG
68-
69- Check that we have all the fields that we need in the experiment parameters.
70-
71- ### CFG content
72-
73- ``` matlab
74- % The following can be modified by users but their effect might
75- % only be effective after running checkCFG
76-
77- cfg.verbose = 0;
78-
79- cfg.subject.subjectGrp = '';
80- cfg.subject.sessionNb = 1;
81- cfg.subject.askGrpSess = [true true];
82-
83- % BOLD MRI details
84- % some of those will be transferred to the correct fields in cfg.bids by checkCFG
85- cfg.mri.repetitionTime = [];
86- cfg.mri.contrastEnhancement = [];
87- cfg.mri.phaseEncodingDirection = [];
88- cfg.mri.reconstruction = [];
89- cfg.mri.echo = [];
90- cfg.mri.acquisition = [];
91-
92- cfg.fileName.task = '';
93- cfg.fileName.zeroPadding = 3; % amount of 0 padding the subject, session, run number
94-
95- cfg.eyeTracker.do = false;
96-
97- % content of the json side-car file for bold data
98- cfg.bids.mri.RepetitionTime = [];
99- cfg.bids.mri.SliceTiming = '';
100- cfg.bids.mri.TaskName = '';
101- cfg.bids.mri.Instructions = '';
102- cfg.bids.mri.TaskDescription = '';
103-
104- % content of the json side-car file for MEG
105- cfg.bids.meg.TaskName = '';
106- cfg.bids.meg.SamplingFrequency = [];
107- cfg.bids.meg.PowerLineFrequency = [];
108- cfg.bids.meg.DewarPosition = [];
109- cfg.bids.meg.SoftwareFilters = [];
110- cfg.bids.meg.DigitizedLandmarks = [];
111- cfg.bids.meg.DigitizedHeadPoints = [];
112-
113- % content of the datasetDescription.json file
114- cfg.bids.datasetDescription.Name = '';
115- cfg.bids.datasetDescription.BIDSVersion = '';
116- cfg.bids.datasetDescription.License = '';
117- cfg.bids.datasetDescription.Authors = {''};
118- cfg.bids.datasetDescription.Acknowledgements = '';
119- cfg.bids.datasetDescription.HowToAcknowledge = '';
120- cfg.bids.datasetDescription.Funding = {''};
121- cfg.bids.datasetDescription.ReferencesAndLinks = {''};
122- cfg.bids.datasetDescription.DatasetDOI = '';
123-
124-
125- %% Should not be modified by users
126- % many of those fields are set up by checkCFG and you might get output that is not BIDS valid if you touch those
127- cfg.fileName.dateFormat = 'yyyymmddHHMM'; % actual date of the experiment that is appended to the filename
128- cfg.fileName.modality
129- cgf.fileName.suffix.mri
130- cgf.fileName.suffix.meg
131- cfg.fileName.stim
132- cfg.fileName.events
133- cfg.fileName.datasetDescription
134-
135- ```
136-
13739## createBoldJson
13840
13941``` bash
0 commit comments