Skip to content

Commit 5389547

Browse files
committed
changed BidsConfig and FileSelection fields in the project toml file
1 parent 2615cb7 commit 5389547

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

lslautobids/convert_to_bids_and_upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def convert_to_bids(self, xdf_path,subject_id,session_id, run_id, task_id,other,
335335
# get the anonymization number from the toml file
336336
toml_path = os.path.join(project_root,project_name,project_name+'_config.toml')
337337
data = read_toml_file(toml_path)
338-
anonymization_number = data["SubjectInfo"]["anonymizationNumber"]
338+
anonymization_number = data["BidsConfig"]["anonymizationNumber"]
339339

340340
# Write the raw data to BIDS in EDF format
341341
# BrainVision format weird memory issues

lslautobids/gen_project_config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
otherFilesUsed = true # Set to true if you want to include other (non-eeg-files) files (experiment files, other modalities like eye tracking) in the dataset, else false
2424
expectedOtherFiles = [".edf", ".csv", "_labnotebook.tsv", "_participantform.tsv"] # List of expected other file extensions. Only the expected files will be copied to the beh folder in BIDS dataset. Give an empty list [] if you don't want any other files to be in the dataset. In this case only experiment files will be zipeed and copied to the misc folder in BIDS dataset.
2525
26-
[SubjectInfo]
26+
[FileSelection]
2727
ignoreSubjects = ['sub-777'] # List of subjects to ignore during the conversion - Leave empty to include all subjects. Changing this value will not delete already existing subjects.
28-
allTasks = [] # List of all possible tasks in the dataset. This will automatically be updated when new tasks are found during the conversion.
2928
excludeTasks = ['sampletask'] # List of tasks to exclude from the conversion for all subjects - Leave empty to include all tasks. Changing this value will not delete already existing tasks.
30-
anonymizationNumber = 123 # This is an anomization number that will be added to the recording date of all subjects.
3129
32-
"""
30+
[BidsConfig]
31+
anonymizationNumber = 123 # This is an anomization number that will be added to the recording date of all subjects.
32+
33+
"""
3334

3435

3536

lslautobids/processing_new_files.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ def process_new_files(file_status: List[str],logger) -> None:
4949
toml_path = os.path.join(project_path, project_name + '_config.toml')
5050
data = read_toml_file(toml_path)
5151

52-
existing_tasks = set(data.get('SubjectInfo', {}).get('allTasks', []))
52+
# existing_tasks = set(data.get('SubjectInfo', {}).get('allTasks', []))
5353

54-
# Add only new tasks
55-
updated_tasks = list(existing_tasks.union(tasks))
54+
# # Add only new tasks
55+
# updated_tasks = list(existing_tasks.union(tasks))
5656

57-
# Save updated task list back to the config
58-
data['SubjectInfo']['allTasks'] = updated_tasks
59-
write_toml_file(toml_path, data)
57+
# # Save updated task list back to the config
58+
# data['FileSelection']['allTasks'] = updated_tasks
59+
60+
# write_toml_file(toml_path, data)
6061

6162
# User prompt asking if we want to proceed to convert and upload
6263
if cli_args.yes:
@@ -143,11 +144,11 @@ def check_for_new_data(logger) -> None:
143144
toml_path = os.path.join(project_path, cli_args.project_name + '_config.toml')
144145
data = read_toml_file(toml_path)
145146

146-
ignore_subjects = data["SubjectInfo"]["ignoreSubjects"]
147+
ignore_subjects = data["FileSelection"]["ignoreSubjects"]
147148

148149
logger.info("Ignored subjects: %s", ignore_subjects)
149150
file_status = check_for_new_files(project_path, ignore_subjects, logger)
150-
ignore_tasks = data["SubjectInfo"]["excludeTasks"]
151+
ignore_tasks = data["FileSelection"]["excludeTasks"]
151152

152153
filtered_files = [
153154
f for f in file_status

0 commit comments

Comments
 (0)