Skip to content

Commit 361bd77

Browse files
committed
ruff & longitudinal func smoothing test
1 parent 576de70 commit 361bd77

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/rbc/bids/longitudinal/functional.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from rbc.bids import Bids
1616
from rbc.workflows.longitudinal.functional import FunctionalLongOutputs
1717

18+
1819
def _smooth_label(fwhm: float, precision: int | None = None) -> str:
1920
"""Format FWHM as a BIDS-safe label (e.g. 6.0 -> 'sm6', 0.1 -> 'sm0p1').
2021

src/rbc/cli/longitudinal/functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from dataclasses import dataclass
66
from typing import TYPE_CHECKING, Literal
77

8-
from rbc.cli.base import _validate_task, _validate_positive
8+
from rbc.cli.base import _validate_positive, _validate_task
99
from rbc.cli.longitudinal._base import LongitudinalBaseArgs, add_fs_license_argument
1010
from rbc.orchestration import Filters, RunnerConfig
1111
from rbc.orchestration.longitudinal.functional import run

src/rbc/workflows/longitudinal/functional.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import logging
1212
from typing import TYPE_CHECKING, NamedTuple
1313

14-
from rbc.core.functional import apply_regression, apply_regression_bandpass
1514
from rbc.core.common import smooth as apply_smooth
15+
from rbc.core.functional import apply_regression, apply_regression_bandpass
1616
from rbc.core.longitudinal.transform import (
1717
compose_transform,
1818
func_transform,
@@ -37,7 +37,7 @@ class FunctionalLongOutputs(NamedTuple):
3737
in longitudinal template space, keyed by strategy name.
3838
cleaned_bold: Per-regressor nuisance-regressed + bandpass-filtered
3939
BOLD in longitudinal template space, keyed by strategy name.
40-
cleaned_bold_smooth: Per-regressor spatially smoothed nuisance-regressed
40+
cleaned_bold_smooth: Per-regressor spatially smoothed nuisance-regressed
4141
+ bandpass-filtered in longitudinal template space, or *None*.
4242
"""
4343

@@ -120,7 +120,7 @@ def longitudinal_process(
120120
brain_mask_file=long_mask,
121121
regressor_file=reg_file,
122122
).regressed_bold
123-
123+
124124
# Optionally smooth cleaned BOLD (export-only)
125125
cleaned_bold_smooth: dict[str, Path] | None = None
126126
if smooth is not None:
@@ -134,7 +134,7 @@ def longitudinal_process(
134134
long_mask,
135135
fwhm=smooth,
136136
)
137-
137+
138138
return FunctionalLongOutputs(
139139
bold_to_long_xfm=bold_to_tpl_xfm,
140140
sbref=long_sbref,

tests/unit/bids/test_longitudinal_functional.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ def _dummy(name: str) -> Path:
105105
"36-parameter": _dummy("cleaned_36p.nii.gz"),
106106
"aCompCor": _dummy("cleaned_acompcor.nii.gz"),
107107
},
108+
cleaned_bold_smooth={
109+
"36-parameter": _dummy("cleaned_36p_smooth.nii.gz"),
110+
"aCompCor": _dummy("cleaned_acompcor_smooth.nii.gz"),
111+
},
108112
)
109113

110114

0 commit comments

Comments
 (0)