Skip to content

Commit

Permalink
Start addressing review.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Jan 12, 2025
1 parent b90c126 commit 375ce6e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
15 changes: 0 additions & 15 deletions src/fmripost_aroma/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,6 @@ def init_single_run_wf(bold_file):
bold_MNI6_wf.inputs.inputnode.target_mask = mni6_mask
bold_MNI6_wf.inputs.inputnode.target_ref_file = mni6_mask

# Warp desc-preproc_fieldmap to boldref space
# Warp the mask as well
fieldmap_to_boldref = pe.Node(
ApplyTransforms(),
name='fieldmap_to_boldref',
)
workflow.connect([
(inputnode, fieldmap_to_boldref, [
('fmap', 'input_image'), # XXX: not right
('fmap2boldref', 'transforms'),
('bold_mask_native', 'reference_image'),
]),
]) # fmt:skip

# Pass transforms and warped fieldmap to bold_MNI6_wf
workflow.connect([
(inputnode, bold_MNI6_wf, [
Expand All @@ -510,7 +496,6 @@ def init_single_run_wf(bold_file):
# use mask as boldref?
('bold_mask_native', 'inputnode.bold_ref_file'),
]),
(fieldmap_to_boldref, bold_MNI6_wf, [('output_image', 'fmap')]),
# Resample BOLD to MNI152NLin6Asym, may duplicate bold_std_wf above
(stc_buffer, bold_MNI6_wf, [('bold_file', 'inputnode.bold_file')]),
(bold_MNI6_wf, mni6_buffer, [('outputnode.bold_file', 'bold')]),
Expand Down
23 changes: 17 additions & 6 deletions src/fmripost_aroma/workflows/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import nipype.pipeline.engine as pe
from fmriprep.interfaces.resampling import DistortionParameters, ResampleSeries
from niworkflows.interfaces.nibabel import GenerateSamplingReference
from niworkflows.interfaces.utility import KeySelect


def init_bold_volumetric_resample_wf(
Expand Down Expand Up @@ -81,6 +80,8 @@ def init_bold_volumetric_resample_wf(
further images into the BOLD series' space.
"""
from fmripost_aroma.interfaces.misc import ApplyTransforms

Check warning on line 83 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L83

Added line #L83 was not covered by tests

workflow = pe.Workflow(name=name)

Check warning on line 85 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L85

Added line #L85 was not covered by tests

inputnode = pe.Node(

Check warning on line 87 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L87

Added line #L87 was not covered by tests
Expand Down Expand Up @@ -145,19 +146,29 @@ def init_bold_volumetric_resample_wf(
if not fieldmap_id:
return workflow

Check warning on line 147 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L147

Added line #L147 was not covered by tests

# Warp desc-preproc_fieldmap to boldref space
# Warp the mask as well
fieldmap_to_boldref = pe.Node(

Check warning on line 151 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L151

Added line #L151 was not covered by tests
ApplyTransforms(),
name='fieldmap_to_boldref',
)
workflow.connect([

Check warning on line 155 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L155

Added line #L155 was not covered by tests
(inputnode, fieldmap_to_boldref, [
('fmap', 'input_image'), # XXX: not right
('fmap2boldref', 'transforms'),
('bold_mask_native', 'reference_image'),
]),
]) # fmt:skip

distortion_params = pe.Node(

Check warning on line 163 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L163

Added line #L163 was not covered by tests
DistortionParameters(metadata=metadata),
name='distortion_params',
run_without_submitting=True,
)
workflow.connect([

Check warning on line 168 in src/fmripost_aroma/workflows/resample.py

View check run for this annotation

Codecov / codecov/patch

src/fmripost_aroma/workflows/resample.py#L168

Added line #L168 was not covered by tests
(inputnode, fmap_select, [
('fmap', 'fmap_ref'),
('fmap_id', 'keys'),
]),
(inputnode, distortion_params, [('bold_file', 'in_file')]),
# Inject fieldmap correction into resample node
(fmap_select, resample, [('fmap', 'fieldmap')]),
(fieldmap_to_boldref, resample, [('fmap', 'fieldmap')]),
(distortion_params, resample, [
('readout_time', 'ro_time'),
('pe_direction', 'pe_dir'),
Expand Down

0 comments on commit 375ce6e

Please sign in to comment.