Skip to content

Commit be923ba

Browse files
committed
Merge remote-tracking branch 'upstream/maint/1.4.x'
2 parents 15b5c25 + deb3df1 commit be923ba

File tree

5 files changed

+57
-27
lines changed

5 files changed

+57
-27
lines changed

.circleci/config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ jobs:
276276

277277
test_package:
278278
docker:
279-
- image: circleci/python:3.8.5
279+
- image: cimg/python:3.9
280280
working_directory: /tmp/src/niworkflows
281281
steps:
282282
- checkout
@@ -300,7 +300,7 @@ jobs:
300300
301301
deploy_pypi:
302302
docker:
303-
- image: circleci/python:3.8.5
303+
- image: cimg/python:3.9
304304
working_directory: /tmp/src/niworkflows
305305
steps:
306306
- checkout
@@ -375,7 +375,7 @@ jobs:
375375
376376
build_docs:
377377
docker:
378-
- image: circleci/python:3.8.5
378+
- image: cimg/python:3.9
379379
environment:
380380
- FSLOUTPUTTYPE: NIFTI
381381
- SUBJECTS_DIR: /tmp/subjects
@@ -392,6 +392,11 @@ jobs:
392392
command: |
393393
python -m pip install --no-cache-dir -U "pip>=20.3"
394394
python -m pip install --no-cache-dir -r docs/requirements.txt
395+
eval "$(pyenv init -)"
396+
- run:
397+
name: Install Niworkflows
398+
command: |
399+
python -m pip install .
395400
- run:
396401
name: Build only this commit
397402
command: |

CHANGES.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ This release upgrades the Dockerfile to use FSL6, and includes some new interfac
99
* FIX: Scipy docs path (#681)
1010
* TEST: Drop excessively long interface equivalence tests (#674)
1111

12+
1.4.6 (March 09, 2022)
13+
======================
14+
Patch release in the 1.4.x series.
15+
16+
* FIX: Unlink destination files before saving derivative (#683)
17+
* FIX: Set pixdim[4] to match RepetitionTime (#679)
18+
1219
1.4.5 (December 13, 2021)
1320
=========================
1421
Patch release in the 1.4.x series.
@@ -160,15 +167,22 @@ A list of prominent changes can be found below. (With thanks to Lea Waller for t
160167
* ``NormalizeMotionParams`` now under ``confounds``.
161168
* ``FMRISummary``, ``CompCorVariancePlot``, ``ConfoundsCorrelationPlot`` from ``plotting``
162169

170+
1.3.6 (March 09, 2022)
171+
======================
172+
Bug-fix release in the 1.3.x series
173+
174+
* FIX: Set pixdim[4] to match RepetitionTime (#679)
175+
* DOC: Fix doc builds for 1.3.x series (#692)
176+
163177
1.3.5 (October 01, 2021)
164178
========================
165179
Bug-fix release in the 1.3.x series
166180

167-
* FIX: Set slope and intercept to 1/0 if not otherwise provided (#649)
168-
* FIX: DerivativesDataSink warning when it has multiple source files [backport #573] (#647)
169-
* FIX: `FSDetectInputs` mutually exclusive options for `ReconAll` (#646)
170-
* MNT: Update some version pinning and correct for *pandas* warning about keyword arguments (#645)
171-
* CI: Use datalad-managed test data [BACKPORT] (#653)
181+
* FIX: Set slope and intercept to 1/0 if not otherwise provided (#649)
182+
* FIX: DerivativesDataSink warning when it has multiple source files [backport #573] (#647)
183+
* FIX: `FSDetectInputs` mutually exclusive options for `ReconAll` (#646)
184+
* MNT: Update some version pinning and correct for *pandas* warning about keyword arguments (#645)
185+
* CI: Use datalad-managed test data [BACKPORT] (#653)
172186

173187
1.3.4 (June 8, 2021)
174188
====================

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ sphinx ~= 4.2
1010
sphinxcontrib-apidoc
1111
sphinxcontrib-napoleon
1212
templateflow
13+
nitransforms >= 20.0.0rc3

niworkflows/interfaces/bids.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,17 @@ def _run_interface(self, runtime):
630630
(4, 4) if self.inputs.space in STANDARD_SPACES else (2, 2)
631631
)
632632

633-
if curr_codes != xcodes or curr_units != units:
633+
curr_zooms = zooms = hdr.get_zooms()
634+
if "RepetitionTime" in self.inputs.get():
635+
zooms = curr_zooms[:3] + (self.inputs.RepetitionTime,)
636+
637+
if (curr_codes, curr_units, curr_zooms) != (xcodes, units, zooms):
634638
self._results["fixed_hdr"][i] = True
635639
new_header = hdr.copy()
636640
new_header.set_qform(nii.affine, xcodes[0])
637641
new_header.set_sform(nii.affine, xcodes[1])
638642
new_header.set_xyzt_units(*units)
643+
new_header.set_zooms(zooms)
639644

640645
if data_dtype == "source": # match source dtype
641646
try:
@@ -664,6 +669,7 @@ def _run_interface(self, runtime):
664669
new_header.set_data_dtype(data_dtype)
665670
del nii
666671

672+
out_file.unlink(missing_ok=True)
667673
if new_data is new_header is None:
668674
_copy_any(orig_file, str(out_file))
669675
else:
@@ -704,9 +710,11 @@ def _run_interface(self, runtime):
704710
legacy_metadata[key] = self._metadata.pop(key)
705711
if legacy_metadata:
706712
sidecar = out_file.parent / f"{_splitext(str(out_file))[0]}.json"
713+
sidecar.unlink(missing_ok=True)
707714
sidecar.write_text(dumps(legacy_metadata, sort_keys=True, indent=2))
708715
# The future: the extension is the first . and everything after
709716
sidecar = out_file.parent / f"{out_file.name.split('.', 1)[0]}.json"
717+
sidecar.unlink(missing_ok=True)
710718
sidecar.write_text(dumps(self._metadata, sort_keys=True, indent=2))
711719
self._results["out_meta"] = str(sidecar)
712720
return runtime

niworkflows/interfaces/confounds.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,26 @@ class _ExpandModelInputSpec(BaseInterfaceInputSpec):
8080
Formula for generating model expansions. By default, the
8181
32-parameter expansion will be generated. Note that any expressions
8282
to be expanded *must* be in parentheses, even if they include only
83-
a single variable (e.g., ``(x)^2``, not ``x^2``). Examples:
84-
85-
* ``rps + wm + csf + gsr`` : 9-parameter model. ``rps`` denotes realignment
86-
parameters, ``wm`` denotes mean white matter signal, ``csf`` denotes mean
87-
cerebrospinal fluid signal, and ``gsr`` denotes mean global signal.
88-
* ``(dd1(rps + wm + csf + gsr))^^2`` : 36-parameter expansion.
89-
``rps + wm + csf + gsr`` denotes that realignment parameters and mean
90-
WM, CSF, and global signals should be included. ``dd1`` denotes that
91-
these signals should be augmented with their first temporal
92-
derivatives. ``^^2`` denotes that the original signals and temporal
93-
derivatives should be augmented with quadratic expansions.
94-
* ``(dd1(rps))^^2`` : 24-parameter expansion. ``rps`` denotes that
95-
realignment parameters should be included. ``dd1`` and ``^^2`` denote
96-
temporal derivative and quadratic expansions as above.
97-
* ``(dd1(rps + wm + csf + gsr))^^2 + others`` : generate all expansion
98-
terms necessary for a 36-parameter model as above, and
99-
concatenate those expansion terms to all other regressor columns
100-
in the confounds file.
83+
a single variable (e.g., ``(x)^2``, not ``x^2``).
84+
85+
Examples:
86+
87+
* ``rps + wm + csf + gsr`` : 9-parameter model. ``rps`` denotes realignment
88+
parameters, ``wm`` denotes mean white matter signal, ``csf`` denotes mean
89+
cerebrospinal fluid signal, and ``gsr`` denotes mean global signal.
90+
* ``(dd1(rps + wm + csf + gsr))^^2`` : 36-parameter expansion.
91+
``rps + wm + csf + gsr`` denotes that realignment parameters and mean
92+
WM, CSF, and global signals should be included. ``dd1`` denotes that
93+
these signals should be augmented with their first temporal
94+
derivatives. ``^^2`` denotes that the original signals and temporal
95+
derivatives should be augmented with quadratic expansions.
96+
* ``(dd1(rps))^^2`` : 24-parameter expansion. ``rps`` denotes that
97+
realignment parameters should be included. ``dd1`` and ``^^2`` denote
98+
temporal derivative and quadratic expansions as above.
99+
* ``(dd1(rps + wm + csf + gsr))^^2 + others`` : generate all expansion
100+
terms necessary for a 36-parameter model as above, and
101+
concatenate those expansion terms to all other regressor columns
102+
in the confounds file.
101103
102104
""",
103105
)

0 commit comments

Comments
 (0)