Skip to content

Commit 7f77fe7

Browse files
NF: parrec2nii sets qform with code=2
1 parent 44fd02b commit 7f77fe7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bin/parrec2nii

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def proc_file(infile, opts):
222222
nhdr = nimg.header
223223
nhdr.set_data_dtype(out_dtype)
224224
nhdr.set_slope_inter(slope, intercept)
225+
nhdr.set_qform(affine, code=2)
225226

226227
if 'parse' in opts.minmax:
227228
# need to get the scaled data

nibabel/tests/test_parrec2nii.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[0.86045705, 0., 7.78655376, -27.91161211],
1111
[0., 0., 0., 1.]])
1212

13-
def test_parrec2nii():
13+
def test_parrec2nii_sets_qform_with_code2():
1414
parrec2nii = imp.load_source('parrec2nii', 'bin/parrec2nii')
1515
parrec2nii.verbose.switch = False
1616

@@ -43,3 +43,4 @@ def test_parrec2nii():
4343

4444
infile = 'nonexistent.PAR'
4545
parrec2nii.proc_file(infile, opts)
46+
nhdr.set_qform.assert_called_with(pr_hdr.get_affine(), code=2)

0 commit comments

Comments
 (0)