Skip to content

Commit 4994a10

Browse files
committed
Keep working.
1 parent 259356b commit 4994a10

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

src/fmripost_aroma/interfaces/resampler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
from nipype.interfaces.base import (
44
BaseInterfaceInputSpec,
55
File,
6-
InputMultiObject,
76
SimpleInterface,
87
TraitedSpec,
9-
isdefined,
108
traits,
119
)
1210

src/fmripost_aroma/workflows/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from fmripost_aroma import config
4141
from fmripost_aroma.interfaces.bids import DerivativesDataSink
4242
from fmripost_aroma.interfaces.reportlets import AboutSummary, SubjectSummary
43+
from fmripost_aroma.workflows.resampling import init_resample_raw_wf
4344

4445

4546
def init_fmripost_aroma_wf():
@@ -256,7 +257,8 @@ def init_single_subject_wf(subject_id: str):
256257
)
257258

258259
bids_info = pe.Node(
259-
BIDSInfo(bids_dir=config.execution.bids_dir, bids_validate=False), name="bids_info"
260+
BIDSInfo(bids_dir=config.execution.bids_dir, bids_validate=False),
261+
name="bids_info",
260262
)
261263

262264
summary = pe.Node(
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""Workflows to resample data."""
2+
3+
from nipype.interfaces import utility as niu
4+
from nipype.pipeline import engine as pe
5+
6+
7+
def init_resample_raw_wf(bold_file, functional_cache):
8+
"""Resample raw BOLD data to MNI152NLin6Asym:res-2mm space."""
9+
from fmriprep.workflows.bold.stc import init_bold_stc_wf
10+
from niworkflows.engine.workflows import LiterateWorkflow as Workflow
11+
12+
from fmripost_aroma.interfaces.resampler import Resampler
13+
14+
workflow = Workflow(name="resample_raw_wf")
15+
16+
inputnode = pe.Node(
17+
niu.IdentityInterface(fields=["bold_file", "mask_file"]),
18+
name="inputnode",
19+
)
20+
inputnode.inputs.bold_file = bold_file
21+
inputnode.inputs.mask_file = functional_cache["bold_mask"]
22+
23+
outputnode = pe.Node(
24+
niu.IdentityInterface(fields=["bold_std", "bold_mask_std"]),
25+
name="outputnode",
26+
)
27+
28+
stc_wf = init_bold_stc_wf(name="resample_stc_wf")
29+
workflow.connect([
30+
(inputnode, stc_wf, [
31+
('bold_file', 'inputnode.bold_file'),
32+
('mask_file', 'inputnode.mask_file'),
33+
]),
34+
]) # fmt:skip
35+
36+
resample_bold = pe.Node(
37+
Resampler(space="MNI152NLin6Asym", resolution="2"),
38+
name="resample_bold",
39+
)
40+
workflow.connect([
41+
(stc_wf, resample_bold, [('outputnode.bold_file', 'bold_file')]),
42+
(resample_bold, outputnode, [('output_file', 'bold_std')]),
43+
]) # fmt:skip
44+
45+
resample_bold_mask = pe.Node(
46+
Resampler(space="MNI152NLin6Asym", resolution="2"),
47+
name="resample_bold_mask",
48+
)
49+
workflow.connect([
50+
(inputnode, resample_bold_mask, [('mask_file', 'bold_file')]),
51+
(resample_bold_mask, outputnode, [('output_file', 'bold_mask_std')]),
52+
]) # fmt:skip
53+
54+
return workflow

0 commit comments

Comments
 (0)