Skip to content

Commit

Permalink
#16 partially working parameters completion
Browse files Browse the repository at this point in the history
  • Loading branch information
sapetnioc committed Feb 3, 2022
1 parent effd14b commit c3a41b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bv_use_cases/tiny_morphologist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,27 @@ 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)
self.add_process('split', SplitBrain)
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')
self.add_link('spm_normalization.output->normalization.spm_switch_output')

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')
Expand Down
7 changes: 6 additions & 1 deletion bv_use_cases/tiny_morphologist/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c3a41b5

Please sign in to comment.