@@ -149,6 +149,7 @@ def collect_participants(
149
149
def collect_data (
150
150
bids_dir ,
151
151
participant_label ,
152
+ session_id = False ,
152
153
task = None ,
153
154
echo = None ,
154
155
bids_validate = True ,
@@ -161,6 +162,23 @@ def collect_data(
161
162
162
163
>>> data_dir_canary()
163
164
165
+ Parameters
166
+ ----------
167
+ bids_dir : :obj:`str` or :obj:`bids.layout.BIDSLayout`
168
+ The BIDS directory
169
+ participant_label : :obj:`str`
170
+ The participant identifier
171
+ session_id : :obj:`str`, None, or ``False``
172
+ The session identifier. If ``False``, all sessions will be used (default).
173
+ task : :obj:`str` or None
174
+ The task identifier (for BOLD queries)
175
+ echo : :obj:`int` or None
176
+ The echo identifier (for BOLD queries)
177
+ bids_validate : :obj:`bool`
178
+ Whether the `bids_dir` is validated upon initialization
179
+ bids_filters: :obj:`dict` or None
180
+ Custom filters to alter default queries
181
+
164
182
Examples
165
183
--------
166
184
>>> bids_root, _ = collect_data(str(datadir / 'ds054'), '100185',
@@ -217,6 +235,10 @@ def collect_data(
217
235
if echo :
218
236
queries ["bold" ]["echo" ] = echo
219
237
238
+ if session_id is not False :
239
+ for acq in queries .keys ():
240
+ queries [acq ]["session" ] = session_id
241
+
220
242
subj_data = {
221
243
dtype : sorted (
222
244
layout .get (
0 commit comments