Skip to content

Commit 3cc8a33

Browse files
committed
added inclusion of .bidsignore file
1 parent 9348531 commit 3cc8a33

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lslautobids/convert_to_bids_and_upload.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,23 @@ def convert_to_bids(self, xdf_path,subject_id,session_id, run_id, task_id,other,
342342
logger.info("Writing EEG-SET file")
343343
write_raw_bids(raw, bids_path, overwrite=cli_args.redo_bids_conversion, verbose=False,symlink=False, format= "EEGLAB",allow_preload=True, anonymize = dict(daysback=daysback_min + anonymization_number,keep_his=True))
344344

345+
# create a .bidsignore file in the project bids folder
346+
bidsignore_path = os.path.join(bids_root, project_name, '.bidsignore')
347+
if not os.path.exists(bidsignore_path):
348+
with open(bidsignore_path, 'w') as f:
349+
# ignore the sourcedata folder (.xdf files)s
350+
f.write('sourcedata/\n')
351+
# ignore the code folder - containing log files
352+
f.write('code/\n')
353+
# ignore the beh folder in each sub-xxx/ses-yyys
354+
f.write('**/beh/\n')
355+
# ignore the misc folder in each sub-xxx/ses-yyy
356+
f.write('**/misc/\n')
357+
# ignore hidden files
358+
f.write('.*\n')
359+
logger.info(".bidsignore file created.")
360+
else:
361+
logger.info(".bidsignore file already exists.")
345362

346363
logger.info("Conversion to BIDS complete.")
347364
# Validate BIDS data

0 commit comments

Comments
 (0)