Skip to content

Commit

Permalink
FIX: Add a filter that returns a sublist of manual masks if specified…
Browse files Browse the repository at this point in the history
… by "stacks" in the param file right after the datagrabber for masks
  • Loading branch information
sebastientourbier committed Oct 28, 2021
1 parent ba14b90 commit cb7b769
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pymialsrtk/pipelines/anatomical/srr.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def create_workflow(self):
name='brain_masks_bypass',
iterfield=['out_file'])

if self.m_stacks is not None:
custom_masks_filter = Node(interface=preprocess.FilteringByRunid(),
name='custom_masks_filter')
custom_masks_filter.inputs.stacks_id = self.m_stacks

else:
dg = Node(interface=DataGrabber(outfields=['T2ws']),
name='data_grabber')
Expand Down Expand Up @@ -455,7 +460,11 @@ def create_workflow(self):
# Build workflow : connections of the nodes
# Nodes ready : Linking now
if self.use_manual_masks:
self.wf.connect(dg, "masks", brainMask, "out_file")
if self.m_stacks is not None:
self.wf.connect(dg, "masks", custom_masks_filter, "input_files")
self.wf.connect(custom_masks_filter, "output_files", brainMask, "out_file")
else:
self.wf.connect(dg, "masks", brainMask, "out_file")
else:
if self.m_stacks is not None:
self.wf.connect(dg, "T2ws", t2ws_filter_prior_masks, "input_files")
Expand Down

0 comments on commit cb7b769

Please sign in to comment.