diff --git a/bv_use_cases/tiny_morphologist/__init__.py b/bv_use_cases/tiny_morphologist/__init__.py index d8bc127..abaa8a7 100644 --- a/bv_use_cases/tiny_morphologist/__init__.py +++ b/bv_use_cases/tiny_morphologist/__init__.py @@ -97,6 +97,7 @@ def execute(self, context): class TinyMorphologist(Pipeline): def pipeline_definition(self): self.add_process('nobias', BiasCorrection) + self.add_switch('normalization', ['none', 'spm', 'aims'], ['output']) self.add_process('spm_normalization', SPMNormalization) self.add_process('aims_normalization', AimsNormalization) @@ -104,6 +105,7 @@ def pipeline_definition(self): self.add_process('right_hemi', ProcessHemisphere) self.add_process('left_hemi', ProcessHemisphere) + self.add_link('nobias.output->normalization.none_switch_output') self.add_link('nobias.output->spm_normalization.input') @@ -111,8 +113,11 @@ def pipeline_definition(self): self.add_link('nobias.output->aims_normalization.input') self.add_link('aims_normalization.output->normalization.aims_switch_output') - + + self.export_parameter('nobias', 'output', 'nobias') + self.add_link('normalization.output->split.input') + self.export_parameter('normalization', 'output', 'normalized') self.add_link('split.right_output->right_hemi.input') self.export_parameter('right_hemi', 'output', 'right_hemisphere') self.add_link('split.left_output->left_hemi.input') diff --git a/bv_use_cases/tiny_morphologist/__main__.py b/bv_use_cases/tiny_morphologist/__main__.py index 82b1cab..5733b9a 100644 --- a/bv_use_cases/tiny_morphologist/__main__.py +++ b/bv_use_cases/tiny_morphologist/__main__.py @@ -131,13 +131,18 @@ # Complete outputs following BraiVISA organization # Make the link between BIDS metadata and BrainVISA metadata output_dataset.set_output_paths(tiny_morphologist, + center='whaterver', subject=t1_mri['sub'], - acquisition=t1_mri.get('acq', 'default'), + acquisition=t1_mri['ses'], + extension = 'nii' ) # Add the current TinyMorhpologist pipeline to the main # pipeline that will be executed processing_pipeline.add_process(f'pipeline_{count}', tiny_morphologist) print('Created', f'pipeline_{count}') + for field in tiny_morphologist.fields(): + value = getattr(tiny_morphologist, field.name, None) + print(' ', ('<-' if tiny_morphologist.is_output(field) else '->'), field.name, '=', value) count = count + 1 # # Finally execute all the TinyMorphologist instances # capsul.run(processing_pipeline)