Skip to content

Commit

Permalink
98BT bug with subject IDs (#183)
Browse files Browse the repository at this point in the history
* [BUG] inside unit_tests workflow

* Refactoring pipeline 98BT

* [TEST] update tests [REFAC] pep8 and bug correction

* Using narps_open.data.task module inside 98BT

* [TEST] update + dependancy to niflow

* [REFAC][skip ci]

* [BUG] input of get_contrats [skip ci]

* Light bugs + remove large files [skip ci]

* [TEST] adding tests for 98BT

* [TEST] adding tests for 98BT

* [TEST] adding tests for 98BT

* Output names for 98BT

* Preprocessing output names

* Subject info issue + output names

* 98BT - Refac get_parameters_files

* [TEST] 98BT get_parameters_file

* Using fixture for temporary test dir creation / removal

* Linting pipelines test files

* Bug with regressors naming

* pylintrc for pylint config

* Subject ID completion in get_contrast
  • Loading branch information
bclenet authored Mar 6, 2024
1 parent 931f76c commit 7209739
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions narps_open/pipelines/team_98BT.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,11 @@ def get_group_level_analysis_sub_workflow(self, method):
get_equal_indifference_subjects.inputs.list_1 = get_group('equalIndifference')
get_equal_indifference_subjects.inputs.list_2 = self.subject_list

# Create a function to complete the subject ids out from the get_equal_*_subjects nodes
# If not complete, subject id '001' in search patterns
# would match all contrast files with 'con_0001.nii'.
complete_subject_ids = lambda l : [f'_subject_id_{a}' for a in l]

# Function Node elements_in_string
# Get contrast files for required subjects
# Note : using a MapNode with elements_in_string requires using clean_list to remove
Expand Down Expand Up @@ -778,14 +783,16 @@ def get_group_level_analysis_sub_workflow(self, method):
])

if method == 'equalRange':
group_level_analysis.connect([
(get_equal_range_subjects, get_contrasts, [('out_list', 'elements')])
])
group_level_analysis.connect(
get_equal_range_subjects, ('out_list', complete_subject_ids),
get_contrasts, 'elements'
)

elif method == 'equalIndifference':
group_level_analysis.connect([
(get_equal_indifference_subjects, get_contrasts, [('out_list', 'elements')])
])
group_level_analysis.connect(
get_equal_indifference_subjects, ('out_list', complete_subject_ids),
get_contrasts, 'elements'
)

elif method == 'groupComp':
estimate_contrast.inputs.contrasts = [
Expand All @@ -812,8 +819,12 @@ def get_group_level_analysis_sub_workflow(self, method):

group_level_analysis.connect([
(select_files, get_contrasts_2, [('contrasts', 'input_str')]),
(get_equal_range_subjects, get_contrasts, [('out_list', 'elements')]),
(get_equal_indifference_subjects, get_contrasts_2, [('out_list', 'elements')]),
(get_equal_range_subjects, get_contrasts, [
(('out_list', complete_subject_ids), 'elements')
]),
(get_equal_indifference_subjects, get_contrasts_2, [
(('out_list', complete_subject_ids), 'elements')
]),
(get_contrasts, two_sample_t_test_design, [
(('out_list', clean_list), 'group1_files')
]),
Expand Down

0 comments on commit 7209739

Please sign in to comment.