diff --git a/narps_open/pipelines/team_X19V.py b/narps_open/pipelines/team_X19V.py index 88542a9f..a3b7cd33 100755 --- a/narps_open/pipelines/team_X19V.py +++ b/narps_open/pipelines/team_X19V.py @@ -734,7 +734,10 @@ def get_group_level_outputs(self): 'contrast_id': self.contrast_list, 'method': ['equalRange', 'equalIndifference'], 'file': [ - # TODO : add thresold_file and pval_file + '_cluster0/zstat1_pval.nii.gz ', + '_cluster0/zstat1_threshold.nii.gz', + '_cluster1/zstat2_pval.nii.gz', + '_cluster1/zstat2_threshold.nii.gz', 'tstat1.nii.gz', 'tstat2.nii.gz', 'zstat1.nii.gz', @@ -748,21 +751,28 @@ def get_group_level_outputs(self): '_contrast_id_{contrast_id}', '{file}' ) - return_list = [template.format(**dict(zip(parameters.keys(), parameter_values)))\ for parameter_values in parameter_sets] # Handle groupComp - files = [ - # TODO : add thresold_file and pval_file - 'zstat1.nii.gz', - 'tstat1.nii.gz' - ] - - return_list += [join( + parameters = { + 'contrast_id': self.contrast_list, + 'file': [ + '_cluster0/zstat1_pval.nii.gz ', + '_cluster0/zstat1_threshold.nii.gz', + 'tstat1.nii.gz', + 'zstat1.nii.gz' + ] + } + parameter_sets = product(*parameters.values()) + template = join( self.directories.output_dir, f'group_level_analysis_groupComp_nsub_{len(self.subject_list)}', - '_contrast_id_2', file) for file in files] # TODO contrast ID 2 only ???? + '_contrast_id_{contrast_id}', + '{file}' + ) + return_list += [template.format(**dict(zip(parameters.keys(), parameter_values)))\ + for parameter_values in parameter_sets] return return_list @@ -772,39 +782,39 @@ def get_hypotheses_outputs(self): nb_sub = len(self.subject_list) files = [ join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', - '_contrast_id_1', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_1', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', '_contrast_id_1', 'zstat1.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', - '_contrast_id_1', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_1', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', '_contrast_id_1', 'zstat1.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', - '_contrast_id_1', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_1', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', '_contrast_id_1', 'zstat1.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', - '_contrast_id_1', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_1', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', '_contrast_id_1', 'zstat1.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', - '_contrast_id_2', 'randomise_tfce_corrp_tstat2.nii.gz'),# TODO : add thresold_file + '_contrast_id_2', '_cluster1', 'zstat2_threshold.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', '_contrast_id_2', 'zstat2.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', - '_contrast_id_2', 'randomise_tfce_corrp_tstat2.nii.gz'),# TODO : add thresold_file + '_contrast_id_2', '_cluster1', 'zstat2_threshold.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', '_contrast_id_2', 'zstat2.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', - '_contrast_id_2', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_2', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalIndifference_nsub_{nb_sub}', '_contrast_id_2', 'zstat1.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', - '_contrast_id_2', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_2', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_equalRange_nsub_{nb_sub}', '_contrast_id_2', 'zstat1.nii.gz'), join(f'group_level_analysis_groupComp_nsub_{nb_sub}', - '_contrast_id_2', 'randomise_tfce_corrp_tstat1.nii.gz'),# TODO : add thresold_file + '_contrast_id_2', '_cluster0', 'zstat1_threshold.nii.gz'), join(f'group_level_analysis_groupComp_nsub_{nb_sub}', '_contrast_id_2', 'zstat1.nii.gz') ] diff --git a/tests/pipelines/test_team_X19V.py b/tests/pipelines/test_team_X19V.py index 4f93bbd1..6ef03d00 100644 --- a/tests/pipelines/test_team_X19V.py +++ b/tests/pipelines/test_team_X19V.py @@ -74,11 +74,11 @@ def test_outputs(): # 1 - 1 subject outputs pipeline.subject_list = ['001'] - helpers.test_pipeline_outputs(pipeline, [0, 4*1 + 4*4*4*1, 4*4*1 + 4*1, 0, 18]) + helpers.test_pipeline_outputs(pipeline, [0, 4*1 + 4*4*4*1, 4*4*1 + 4*1, 8*4*2 + 4*4, 18]) # 2 - 4 subjects outputs pipeline.subject_list = ['001', '002', '003', '004'] - helpers.test_pipeline_outputs(pipeline, [0, 4*4 + 4*4*4*4, 4*4 + 4*4, 0, 18]) + helpers.test_pipeline_outputs(pipeline, [0, 4*4 + 4*4*4*4, 4*4*4 + 4*4, 8*4*2 + 4*4, 18]) @staticmethod @mark.unit_test