Skip to content

Commit 281b236

Browse files
committed
Merge remote-tracking branch 'upstream/master' into loadbidslayout
2 parents 2ba8dac + e31573b commit 281b236

File tree

30 files changed

+339
-123
lines changed

30 files changed

+339
-123
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
os: ['ubuntu-18.04']
30-
python-version: [3.6, 3.7, 3.8, 3.9]
29+
os: ['ubuntu-latest']
30+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
3131
check: ['test']
3232
pip-flags: ['']
3333
depends: ['REQUIREMENTS']

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Kshitij Chawla <[email protected]>
121121
Leonie Lampe <[email protected]>
122122
Lukas Snoek <[email protected]>
123123
124+
Maria de Fatima Dias <[email protected]> <[email protected]>
124125
Martin Perez-Guevara <[email protected]>
125126
126127

.zenodo.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
},
264264
{
265265
"affiliation": "CIBIT, UC",
266-
"name": "Machado, F\u00e1tima",
266+
"name": "Dias, Maria de Fatima",
267267
"orcid": "0000-0001-8878-1750"
268268
},
269269
{
@@ -439,7 +439,8 @@
439439
},
440440
{
441441
"affiliation": "Sagol School of Neuroscience, Tel Aviv University",
442-
"name": "Baratz, Zvi"
442+
"name": "Baratz, Zvi",
443+
"orcid": "0000-0001-7159-1387"
443444
},
444445
{
445446
"affiliation": "University of Iowa",

nipype/algorithms/confounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ def compute_noise_components(
14351435
else:
14361436
u = np.full((M.shape[0], 1), np.nan, dtype=np.float32)
14371437

1438-
variance_explained = (s ** 2) / np.sum(s ** 2)
1438+
variance_explained = (s**2) / np.sum(s**2)
14391439
cumulative_variance_explained = np.cumsum(variance_explained)
14401440

14411441
num_components = int(components_criterion)

nipype/algorithms/icc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def ICC_rep_anova(Y):
116116
# Sum Square Error
117117
predicted_Y = dot(dot(dot(X, pinv(dot(X.T, X))), X.T), Y.flatten("F"))
118118
residuals = Y.flatten("F") - predicted_Y
119-
SSE = (residuals ** 2).sum()
119+
SSE = (residuals**2).sum()
120120

121121
residuals.shape = Y.shape
122122

nipype/algorithms/metrics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def _run_interface(self, runtime):
337337
if self.inputs.weighting != "none":
338338
weights = weights / np.array(volumes1)
339339
if self.inputs.weighting == "squared_vol":
340-
weights = weights ** 2
340+
weights = weights**2
341341
weights = weights / np.sum(weights)
342342

343343
both_data = np.zeros(data1.shape)
@@ -500,7 +500,7 @@ def _run_interface(self, runtime):
500500
volumes = np.sum((refdata + tstdata) > 0, axis=1).reshape((-1, ncomp))
501501
weights = 1.0 / volumes
502502
if self.inputs.weighting == "squared_vol":
503-
weights = weights ** 2
503+
weights = weights**2
504504

505505
weights = weights / np.sum(weights)
506506
dices = 2.0 * jaccards / (jaccards + 1.0)
@@ -591,7 +591,7 @@ def _run_interface(self, runtime):
591591

592592
# Scale the difference
593593
if self.inputs.metric == "sqeuclidean":
594-
errvector = diffvector ** 2
594+
errvector = diffvector**2
595595
if comps > 1:
596596
errvector = np.sum(errvector, axis=1)
597597
else:

nipype/algorithms/tests/test_ErrorMap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ def test_errormap(tmpdir):
7575

7676
errmap.inputs.metric = "euclidean"
7777
result = errmap.run()
78-
assert result.outputs.distance == np.float32(1.25 * (2 ** 0.5))
78+
assert result.outputs.distance == np.float32(1.25 * (2**0.5))

nipype/info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def get_nipype_gitversion():
5757
"Programming Language :: Python :: 3.6",
5858
"Programming Language :: Python :: 3.7",
5959
"Programming Language :: Python :: 3.8",
60+
"Programming Language :: Python :: 3.9",
61+
"Programming Language :: Python :: 3.10",
6062
"Topic :: Scientific/Engineering",
6163
]
6264
PYTHON_REQUIRES = ">= 3.6"
@@ -169,7 +171,6 @@ def get_nipype_gitversion():
169171
"sphinx-argparse",
170172
"sphinx>=2.1.2",
171173
"sphinxcontrib-apidoc",
172-
"sphinxcontrib-napoleon",
173174
],
174175
"duecredit": ["duecredit"],
175176
"nipy": ["nitime", "nilearn", "dipy", "nipy", "matplotlib"],

nipype/interfaces/ants/registration.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
418418
"BSpline",
419419
"MultiLabel",
420420
"Gaussian",
421+
"GenericLabel",
421422
argstr="%s",
422423
usedefault=True,
423424
)
@@ -426,6 +427,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
426427
traits.Tuple(
427428
traits.Float(), traits.Float() # Gaussian/MultiLabel (sigma, alpha)
428429
),
430+
traits.Tuple(traits.Str()), # GenericLabel (interpolator)
429431
)
430432

431433
write_composite_transform = traits.Bool(
@@ -1291,15 +1293,12 @@ def _format_arg(self, opt, spec, val):
12911293
do_center_of_mass_init,
12921294
)
12931295
elif opt == "interpolation":
1294-
if (
1295-
self.inputs.interpolation
1296-
in [
1297-
"BSpline",
1298-
"MultiLabel",
1299-
"Gaussian",
1300-
]
1301-
and isdefined(self.inputs.interpolation_parameters)
1302-
):
1296+
if self.inputs.interpolation in [
1297+
"BSpline",
1298+
"MultiLabel",
1299+
"Gaussian",
1300+
"GenericLabel",
1301+
] and isdefined(self.inputs.interpolation_parameters):
13031302
return "--interpolation %s[ %s ]" % (
13041303
self.inputs.interpolation,
13051304
", ".join(
@@ -1592,14 +1591,17 @@ class MeasureImageSimilarity(ANTSCommand):
15921591
output_spec = MeasureImageSimilarityOutputSpec
15931592

15941593
def _metric_constructor(self):
1595-
retval = '--metric {metric}["{fixed_image}","{moving_image}",{metric_weight},' "{radius_or_number_of_bins},{sampling_strategy},{sampling_percentage}]".format(
1596-
metric=self.inputs.metric,
1597-
fixed_image=self.inputs.fixed_image,
1598-
moving_image=self.inputs.moving_image,
1599-
metric_weight=self.inputs.metric_weight,
1600-
radius_or_number_of_bins=self.inputs.radius_or_number_of_bins,
1601-
sampling_strategy=self.inputs.sampling_strategy,
1602-
sampling_percentage=self.inputs.sampling_percentage,
1594+
retval = (
1595+
'--metric {metric}["{fixed_image}","{moving_image}",{metric_weight},'
1596+
"{radius_or_number_of_bins},{sampling_strategy},{sampling_percentage}]".format(
1597+
metric=self.inputs.metric,
1598+
fixed_image=self.inputs.fixed_image,
1599+
moving_image=self.inputs.moving_image,
1600+
metric_weight=self.inputs.metric_weight,
1601+
radius_or_number_of_bins=self.inputs.radius_or_number_of_bins,
1602+
sampling_strategy=self.inputs.sampling_strategy,
1603+
sampling_percentage=self.inputs.sampling_percentage,
1604+
)
16031605
)
16041606
return retval
16051607

nipype/interfaces/ants/resampling.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,15 +504,11 @@ def _format_arg(self, opt, spec, val):
504504
elif opt == "transforms":
505505
return self._get_transform_filenames()
506506
elif opt == "interpolation":
507-
if (
508-
self.inputs.interpolation
509-
in [
510-
"BSpline",
511-
"MultiLabel",
512-
"Gaussian",
513-
]
514-
and isdefined(self.inputs.interpolation_parameters)
515-
):
507+
if self.inputs.interpolation in [
508+
"BSpline",
509+
"MultiLabel",
510+
"Gaussian",
511+
] and isdefined(self.inputs.interpolation_parameters):
516512
return "--interpolation %s[ %s ]" % (
517513
self.inputs.interpolation,
518514
", ".join(

0 commit comments

Comments
 (0)