Skip to content

Commit

Permalink
Merge branch 'master' into added_mrtrix3_functions
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies authored Mar 17, 2024
2 parents bc595b8 + f1a8909 commit bff1028
Show file tree
Hide file tree
Showing 55 changed files with 207 additions and 93 deletions.
3 changes: 2 additions & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ skip = .git,*.pdf,*.svg,external
# Reson - short journal name
# ALS, FWE - neuroimaging specific abbrevs
# Comision - foreign word used
ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,suh,noo,reson,als,fwe,crasher,comision,afile
# expad - AFNI flag
ignore-words-list = te,inport,objekt,jist,nd,hel,inout,fith,whos,fot,ue,shs,smal,nam,filetest,suh,noo,reson,als,fwe,crasher,comision,afile,expad
10 changes: 10 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Tue Feb 27 14:28:18 2024 -0500 - [email protected] - STY: black 2024.2 [ignore-rev]
f1cbc1c941f8d02659f8ef245aac0862efb80ccf
# Mon Sep 11 13:36:40 2023 +0200 - [email protected] - run black for nipype/interfaces/spm/preprocess.py
b9cac5e993143febb01ade42e56b41009427a4b6
# Wed Jul 5 16:31:45 2023 -0400 - [email protected] - STY: Run black and fix typo
34a4ac6eeff8d4924b40875c45df5d84a97da90b
# Wed Jul 5 11:30:42 2023 -0400 - [email protected] - STY: black
3b89ca85faf2428ecf7844de9c0db4aa7c329c93
# Wed Jul 5 09:49:31 2023 -0400 - [email protected] - STY: black
4a6a7d9d25d5d1e1f0eb55828dede58f8b9c9f80
# Wed Apr 5 14:01:05 2023 -0400 - [email protected] - STY: black [ignore-rev]
a9ce9b78a402ebacf7726ad6454bb75b1447f52f
# Wed Sep 14 14:12:07 2022 -0400 - [email protected] - STY: Black
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
groups:
actions-infrastructure:
patterns:
- "actions/*"
7 changes: 4 additions & 3 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
submodules: recursive
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
Expand All @@ -71,12 +71,13 @@ jobs:
- name: Run tests
run: tools/ci/check.sh
if: ${{ matrix.check != 'skiptests' }}
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ always() }}
- name: Upload pytest test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: test-results.xml
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3
- run: pip install --upgrade build twine
- name: Build sdist and wheel
run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
Expand All @@ -59,11 +59,11 @@ jobs:
matrix:
package: ['wheel', 'sdist']
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3
- name: Display Python version
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
Expand All @@ -145,14 +145,15 @@ jobs:
- name: Run tests
run: tools/ci/check.sh
if: ${{ matrix.check != 'skiptests' }}
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
if: ${{ always() }}
- name: Upload pytest test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.deb-depends }}
path: test-results.xml
if: ${{ always() && matrix.check == 'test' }}

Expand All @@ -162,7 +163,7 @@ jobs:
needs: [stable, test-package]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
27 changes: 16 additions & 11 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -891,16 +891,6 @@
"name": "Mihai, Paul Glad",
"orcid": "0000-0001-5715-6442"
},
{
"affiliation": "Department of Psychology, Stanford University",
"name": "Gorgolewski, Krzysztof J.",
"orcid": "0000-0003-3321-7583"
},
{
"affiliation": "MIT, HMS",
"name": "Ghosh, Satrajit",
"orcid": "0000-0002-5312-6729"
},
{
"affiliation": "University of Tübingen and MPI for Biological Cybernertics",
"name": "Bannert, Michael M.",
Expand All @@ -909,12 +899,27 @@
{
"affiliation": "Research Centre Juelich",
"name": "Wu, Jianxiao",
"orcid": "0000-0002-4866-272X",
"orcid": "0000-0002-4866-272X"
},
{
"affiliation": "Department of Neurology, BG-University Hospital Bergmannsheil Bochum, Germany",
"name": "Butry, Lionel"
},
{
"affiliation": "Lund University",
"name": "Anijärv, Toomas Erik",
"orcid": "0000-0002-3650-4230"
},
{
"affiliation": "Department of Psychology, Stanford University",
"name": "Gorgolewski, Krzysztof J.",
"orcid": "0000-0003-3321-7583"
},
{
"affiliation": "MIT, HMS",
"name": "Ghosh, Satrajit",
"orcid": "0000-0002-5312-6729"
}
],
"keywords": [
"neuroimaging",
Expand Down
6 changes: 3 additions & 3 deletions nipype/algorithms/modelgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ def _generate_standard_design(
sessinfo[i]["cond"][cid]["pmod"][j]["poly"] = info.pmod[
cid
].poly[j]
sessinfo[i]["cond"][cid]["pmod"][j][
"param"
] = info.pmod[cid].param[j]
sessinfo[i]["cond"][cid]["pmod"][j]["param"] = (
info.pmod[cid].param[j]
)

sessinfo[i]["regress"] = []
if hasattr(info, "regressors") and info.regressors is not None:
Expand Down
6 changes: 3 additions & 3 deletions nipype/algorithms/rapidart.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,9 @@ def _detect_outliers_core(self, imgfile, motionfile, runidx, cwd=None):
if displacement is not None:
dmap = np.zeros((x, y, z, timepoints), dtype=np.float64)
for i in range(timepoints):
dmap[
voxel_coords[0], voxel_coords[1], voxel_coords[2], i
] = displacement[i, :]
dmap[voxel_coords[0], voxel_coords[1], voxel_coords[2], i] = (
displacement[i, :]
)
dimg = Nifti1Image(dmap, affine)
dimg.to_filename(displacementfile)
else:
Expand Down
1 change: 1 addition & 0 deletions nipype/caching/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Using nipype with persistence and lazy recomputation but without explicit
name-steps pipeline: getting back scope in command-line based programming.
"""

import os
import hashlib
import pickle
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class AlignEpiAnatPy(AFNIPythonCommand):
>>> al_ea.cmdline # doctest: +ELLIPSIS
'python2 ...align_epi_anat.py -anat structural.nii -epi_base 0 -epi_strip 3dAutomask -epi \
functional.nii -save_skullstrip -suffix _al -tshift off -volreg off'
>>> res = allineate.run() # doctest: +SKIP
>>> res = al_ea.run() # doctest: +SKIP
See Also
--------
Expand Down
1 change: 0 additions & 1 deletion nipype/interfaces/ants/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
are preserved for backwards compatibility.
"""


import os
from glob import glob

Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/ants/registration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The ants module provides basic functions for interfacing with ants
functions.
"""

import os

from ...utils.filemanip import ensure_list
Expand Down
4 changes: 4 additions & 0 deletions nipype/interfaces/ants/resampling.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""ANTS Apply Transforms interface
"""

import os

from .base import ANTSCommand, ANTSCommandInputSpec
Expand Down Expand Up @@ -349,6 +350,7 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec):
"MultiLabel",
"Gaussian",
"BSpline",
"GenericLabel",
argstr="%s",
usedefault=True,
)
Expand All @@ -357,6 +359,7 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec):
traits.Tuple(
traits.Float(), traits.Float() # Gaussian/MultiLabel (sigma, alpha)
),
traits.Tuple(traits.Str()), # GenericLabel
)
transforms = InputMultiObject(
traits.Either(File(exists=True), "identity"),
Expand Down Expand Up @@ -497,6 +500,7 @@ def _format_arg(self, opt, spec, val):
"BSpline",
"MultiLabel",
"Gaussian",
"GenericLabel",
] and isdefined(self.inputs.interpolation_parameters):
return "--interpolation {}[ {} ]".format(
self.inputs.interpolation,
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/ants/segmentation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wrappers for segmentation utilities within ANTs."""

import os
from glob import glob
from ...external.due import BibTeX
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/ants/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ANTs' utilities."""

import os
from warnings import warn
from ..base import traits, isdefined, TraitedSpec, File, Str, InputMultiObject
Expand Down
8 changes: 5 additions & 3 deletions nipype/interfaces/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,11 @@ def run(self, cwd=None, ignore_exception=None, **inputs):
"""
rtc = RuntimeContext(
resource_monitor=config.resource_monitor and self.resource_monitor,
ignore_exception=ignore_exception
if ignore_exception is not None
else self.ignore_exception,
ignore_exception=(
ignore_exception
if ignore_exception is not None
else self.ignore_exception
),
)

with indirectory(cwd or os.getcwd()):
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/c3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convert3D is a command-line tool for converting 3D images between common file formats."""

import os
from glob import glob

Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/cmtk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CMP implements a full processing pipeline for creating connectomes with dMRI data."""

from .cmtk import ROIGen, CreateMatrix, CreateNodes
from .nx import NetworkXMetrics, AverageNetworks
from .parcellation import Parcellate
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/dcm2nii.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""dcm2nii converts images from the proprietary scanner DICOM format to NIfTI."""

import os
import re
from copy import deepcopy
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/diffusion_toolkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Diffusion Toolkit performs data reconstruction and fiber tracking on diffusion MR images."""

from .base import Info
from .postproc import SplineFilter, TrackMerge
from .dti import DTIRecon, DTITracker
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/dipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DIPY is a computational neuroimaging tool for diffusion MRI."""

from .tracks import StreamlineTractography, TrackDensityMap
from .tensors import TensorMode, DTI
from .preprocess import Resample, Denoise
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/dipy/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Interfaces to the reconstruction algorithms in dipy
"""

import os.path as op

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/dtitk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<http://dti-tk.sourceforge.net/pmwiki/pmwiki.php>`_ command line tools.
"""

from .registration import (
Rigid,
Affine,
Expand Down
6 changes: 3 additions & 3 deletions nipype/interfaces/fsl/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,9 +1059,9 @@ def _list_outputs(self):
if os.path.exists(out_shell_alignment_parameters):
outputs["out_shell_alignment_parameters"] = out_shell_alignment_parameters
if os.path.exists(out_shell_pe_translation_parameters):
outputs[
"out_shell_pe_translation_parameters"
] = out_shell_pe_translation_parameters
outputs["out_shell_pe_translation_parameters"] = (
out_shell_pe_translation_parameters
)
if os.path.exists(out_outlier_map):
outputs["out_outlier_map"] = out_outlier_map
if os.path.exists(out_outlier_n_stdev_map):
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/fsl/tests/test_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def func():
"center": ("-c 54 75 80", [54, 75, 80]),
"threshold": ("-t", True),
"mesh": ("-e", True),
"surfaces": ("-A", True)
"surfaces": ("-A", True),
# 'verbose': ('-v', True),
# 'flags': ('--i-made-this-up', '--i-made-this-up'),
}
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/mipav/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MIPAV enables quantitative analysis and visualization of multimodal medical images."""

from .developer import (
JistLaminarVolumetricLayering,
JistBrainMgdmSegmentation,
Expand Down
1 change: 1 addition & 0 deletions nipype/interfaces/mne/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""MNE is a software for exploring, visualizing, and analyzing human neurophysiological data."""

from .base import WatershedBEM
Loading

0 comments on commit bff1028

Please sign in to comment.