Skip to content

Commit 6c45568

Browse files
authored
Merge pull request #679 from effigies/fix/set_TR
FIX: Set pixdim[4] to match RepetitionTime
2 parents cfc0c8f + 70f6769 commit 6c45568

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

niworkflows/interfaces/bids.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,17 @@ def _run_interface(self, runtime):
607607
(4, 4) if self.inputs.space in STANDARD_SPACES else (2, 2)
608608
)
609609

610-
if curr_codes != xcodes or curr_units != units:
610+
curr_zooms = zooms = hdr.get_zooms()
611+
if "RepetitionTime" in self.inputs.get():
612+
zooms = curr_zooms[:3] + (self.inputs.RepetitionTime,)
613+
614+
if (curr_codes, curr_units, curr_zooms) != (xcodes, units, zooms):
611615
self._results["fixed_hdr"][i] = True
612616
new_header = hdr.copy()
613617
new_header.set_qform(nii.affine, xcodes[0])
614618
new_header.set_sform(nii.affine, xcodes[1])
615619
new_header.set_xyzt_units(*units)
620+
new_header.set_zooms(zooms)
616621

617622
if data_dtype == "source": # match source dtype
618623
try:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ install_requires =
2828
matplotlib >= 2.2.0
2929
nibabel >= 3.0.1
3030
nilearn >= 0.2.6, != 0.5.0, != 0.5.1
31-
nipype >= 1.5.1
31+
nipype >= 1.5.1, != 1.7.0
3232
nitransforms >= 20.0.0rc3,<20.2
3333
numpy
3434
packaging

0 commit comments

Comments
 (0)