Skip to content

Commit 1fde937

Browse files
committed
FIX: Set slope and intercept to 1/0 if not otherwise provided
1 parent 2a8e2d6 commit 1fde937

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

niworkflows/interfaces/bids.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ def _run_interface(self, runtime):
648648
if new_data is None:
649649
set_consumables(new_header, orig_img.dataobj)
650650
new_data = orig_img.dataobj.get_unscaled()
651+
else:
652+
# Without this, we would be writing nans
653+
# This is our punishment for hacking around nibabel defaults
654+
new_header.set_slope_inter(slope=1., inter=0.)
651655
unsafe_write_nifti_header_and_data(
652656
fname=out_file,
653657
header=new_header,

0 commit comments

Comments
 (0)