Skip to content

Commit 40ca558

Browse files
committed
FIX: Set pixdim[4] to match RepetitionTime
1 parent cfc0c8f commit 40ca558

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
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 out_entities["suffix"] == "bold":
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:

0 commit comments

Comments
 (0)