Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
dependencies: [latest, pre]
include:
- python-version: "3.9"
dependencies: min
exclude:
# Do not test pre-releases for versions out of SPEC0
- python-version: "3.9"
dependencies: pre
- python-version: "3.10"
dependencies: pre
# LTS branch: Test minimum supported and container-distributed Pythons
python-version: ["3.10", "3.12"]
dependencies: [latest]

env:
DEPENDS: ${{ matrix.dependencies }}
Expand Down Expand Up @@ -153,7 +145,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
check: ['style', 'spellcheck']
check: ['spellcheck']

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion niworkflows/func/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def init_enhance_and_skullstrip_bold_wf(
fixed_image=str(bold_template),
fixed_image_mask=str(brain_mask),
metric=('Mattes', 32, 'Regular', 0.2),
transform=('Affine', 0.1),
transform=('Rigid', 0.1),
search_factor=(20, 0.12),
principal_axes=False,
convergence=(10, 1e-6, 10),
Expand Down
53 changes: 0 additions & 53 deletions niworkflows/interfaces/tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,71 +22,18 @@
#
"""Test images module."""

import time
from pathlib import Path

import nibabel as nb
import numpy as np
import pytest
from nipype.interfaces import nilearn as nl
from nipype.pipeline import engine as pe

from niworkflows.testing import has_afni

from .. import images as im


@pytest.mark.parametrize(
('nvols', 'nmasks', 'ext', 'factor'),
[
(200, 3, '.nii', 1.1),
],
)
def test_signal_extraction_equivalence(tmp_path, nvols, nmasks, ext, factor):
nlsignals = str(tmp_path / 'nlsignals.tsv')
imsignals = str(tmp_path / 'imsignals.tsv')

vol_shape = (64, 64, 40)

img_fname = str(tmp_path / ('img' + ext))
masks_fname = str(tmp_path / ('masks' + ext))

random_data = np.random.random(size=vol_shape + (nvols,)) * 2000
random_mask_data = np.random.random(size=vol_shape + (nmasks,)) < 0.2

nb.Nifti1Image(random_data, np.eye(4)).to_filename(img_fname)
nb.Nifti1Image(random_mask_data.astype(np.uint8), np.eye(4)).to_filename(masks_fname)

se1 = nl.SignalExtraction(
in_file=img_fname,
label_files=masks_fname,
class_labels=[f'a{i}' for i in range(nmasks)],
out_file=nlsignals,
)
se2 = im.SignalExtraction(
in_file=img_fname,
label_files=masks_fname,
class_labels=[f'a{i}' for i in range(nmasks)],
out_file=imsignals,
)

tic = time.time()
se1.run()
toc = time.time()
se2.run()
toc2 = time.time()

tab1 = np.loadtxt(nlsignals, skiprows=1)
tab2 = np.loadtxt(imsignals, skiprows=1)

assert np.allclose(tab1, tab2)

t1 = toc - tic
t2 = toc2 - toc

assert t2 < t1 / factor


@pytest.mark.parametrize(
('shape', 'mshape'),
[
Expand Down
2 changes: 1 addition & 1 deletion niworkflows/workflows/epi/refmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _post_merge(in_file, in_xfms):
"""
Massage output from ``SpatialReference``.

If the previous ``SpatialReference`` node by-passed the execution of
If the previous ``SpatialReference`` node bypassed the execution of
``mri_robust_template`` (hence, there was only one input file), the
single-file is forwarded to the output.

Expand Down
Loading