Skip to content

Commit 64c17f1

Browse files
Merge pull request #85 from Peyman-N/improve-reporing
Reporting list of protocols and tasks detected
2 parents d673919 + 6b1bcc2 commit 64c17f1

2 files changed

Lines changed: 32 additions & 8 deletions

File tree

bids2openminds/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def create_behavioral_protocol(layout, collection):
9595

9696

9797
def techniques_openminds(suffix):
98+
# TODO "MRIPulseSequence" and "MRIWeighting" should be added as soon as openMINDS v4 becomes available.
9899
possible_types = ["Technique", "AnalysisTechnique", "StimulationApproach",
99100
"StimulationTechnique"]
100101

bids2openminds/report.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,20 @@ def create_report(dataset, dataset_version, collection, dataset_description, inp
3939
else:
4040
data_types_list = f"{dataset_version.data_types.name}\n"
4141

42+
techniques_list = ""
43+
if dataset_version.techniques is not None:
44+
for technique in dataset_version.techniques:
45+
techniques_list += f"{technique.name}\n"
46+
else:
47+
techniques_list = "No techniques were detected. Please follow the BIDS recommendations for suffixes, as bids2openminds detects techniques based on suffixes."
48+
49+
behavioral_protocols_list = ""
50+
if dataset_version.behavioral_protocols is not None:
51+
for behavioral_protocol in dataset_version.behavioral_protocols:
52+
behavioral_protocols_list += f"{behavioral_protocol.name}\n"
53+
else:
54+
behavioral_protocols_list = "No behavioral protocols were detected. Please follow the BIDS recommendations for task labels, as bids2openminds detects behavioral protocols based on task labels."
55+
4256
author_list = ""
4357
i = 1
4458
if dataset_version.authors is not None:
@@ -65,14 +79,6 @@ def create_report(dataset, dataset_version, collection, dataset_description, inp
6579
Dataset title : {dataset.full_name}
6680
6781
68-
Experimental approaches detected:
69-
------------------------------------------
70-
{experimental_approaches_list}
71-
72-
Detected data types:
73-
------------------------------------------
74-
{data_types_list}
75-
7682
The following elements were converted:
7783
------------------------------------------
7884
+ number of authors : {len(dataset_version.authors or [])}
@@ -84,6 +90,23 @@ def create_report(dataset, dataset_version, collection, dataset_description, inp
8490
+ number of behavioral protocols: {behavioral_protocols_numbers}
8591
8692
93+
Experimental approaches detected:
94+
------------------------------------------
95+
{experimental_approaches_list}
96+
97+
Detected data types:
98+
------------------------------------------
99+
{data_types_list}
100+
101+
Detected techniques:
102+
------------------------------------------
103+
{techniques_list}
104+
105+
Detected behavioral protocols:
106+
------------------------------------------
107+
{behavioral_protocols_list}
108+
109+
87110
88111
**Important Notes**
89112
------------------------------------------

0 commit comments

Comments
 (0)