Skip to content

Commit

Permalink
Bit more work.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Aug 2, 2024
1 parent 17df33c commit 455a8b6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/fmripost_aroma/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,22 @@ def init_single_run_wf(bold_file):
]
all_xfms = pe.Node(niu.Merge(2), name='all_xfms')
all_xfms.inputs.in1 = xfms
workflow.connect([(template_iterator_wf, all_xfms, [('outputnode.anat2std', 'in2')])])
workflow.connect([

Check warning on line 456 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L454-L456

Added lines #L454 - L456 were not covered by tests
(template_iterator_wf, all_xfms, [('outputnode.anat2std_xfm', 'in2')]),
]) # fmt:skip

resample_std_wf = init_resample_volumetric_wf(

Check warning on line 460 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L460

Added line #L460 was not covered by tests
bold_file=bold_file,
precomputed=functional_cache,
functional_cache=functional_cache,
run_stc=False,
name=_get_wf_name(bold_file, 'resample_std'),
)
workflow.connect([

Check warning on line 466 in src/fmripost_aroma/workflows/base.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/base.py#L466

Added line #L466 was not covered by tests
(template_iterator_wf, resample_std_wf, [
('outputnode.space', 'inputnode.space'),
('outputnode.resolution', 'inputnode.resolution'),
('outputnode.cohort', 'inputnode.cohort'),
]),
(all_xfms, resample_std_wf, [('out', 'inputnode.transforms')]),
(resample_std_wf, denoise_wf, [
('outputnode.bold_std', 'inputnode.bold'),
Expand Down
26 changes: 20 additions & 6 deletions src/fmripost_aroma/workflows/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
def init_resample_volumetric_wf(
bold_file,
functional_cache,
space,
run_stc,
name='resample_volumetric_wf',
):
Expand All @@ -19,8 +18,6 @@ def init_resample_volumetric_wf(
Path to BOLD file.
functional_cache : dict
Dictionary with paths to functional data.
space : niworkflows.utils.spaces.Reference
Spatial reference.
run_stc : bool
Whether to run STC.
name : str
Expand All @@ -34,7 +31,16 @@ def init_resample_volumetric_wf(
workflow = Workflow(name=name)

inputnode = pe.Node(
niu.IdentityInterface(fields=['bold_file', 'mask_file']),
niu.IdentityInterface(
fields=[
'bold_file',
'mask_file',
'space',
'resolution',
'cohort',
'transforms',
],
),
name='inputnode',
)
inputnode.inputs.bold_file = bold_file
Expand Down Expand Up @@ -62,19 +68,27 @@ def init_resample_volumetric_wf(
workflow.connect([(inputnode, stc_buffer, [('bold_file', 'bold_file')])])

resample_bold = pe.Node(
Resampler(space=space.space, **space.spec),
Resampler(),
name='resample_bold',
)
workflow.connect([
(inputnode, resample_bold, [
('space', 'space'),
('resolution', 'resolution'),
]),
(stc_buffer, resample_bold, [('outputnode.bold_file', 'bold_file')]),
(resample_bold, outputnode, [('output_file', 'bold_std')]),
]) # fmt:skip

resample_bold_mask = pe.Node(
Resampler(space=space.space, **space.spec),
Resampler(),
name='resample_bold_mask',
)
workflow.connect([
(inputnode, resample_bold_mask, [
('space', 'space'),
('resolution', 'resolution'),
]),
(inputnode, resample_bold_mask, [('mask_file', 'bold_file')]),
(resample_bold_mask, outputnode, [('output_file', 'bold_mask_std')]),
]) # fmt:skip
Expand Down

0 comments on commit 455a8b6

Please sign in to comment.