Skip to content

Commit 988e76b

Browse files
committed
BF: apparently dicom wrappers still do not have affine property, reverting
See PR in nibabel to RF for this: nipy/nibabel#796
1 parent 1aff185 commit 988e76b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dcmstack/dcmmeta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ def from_dicom_wrapper(klass, dcm_wrp, meta_dict=None):
15331533
data = dcm_wrp.get_data()
15341534

15351535
#The Nifti patient space flips the x and y directions
1536-
affine = np.dot(np.diag([-1., -1., 1., 1.]), dcm_wrp.affine)
1536+
affine = np.dot(np.diag([-1., -1., 1., 1.]), dcm_wrp.get_affine())
15371537

15381538
#Make 2D data 3D
15391539
if len(data.shape) == 2:

test/test_dcmmeta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ def test_from_dicom():
11431143
nw = dcmmeta.NiftiWrapper.from_dicom(src_dcm, meta)
11441144
hdr = nw.nii_img.header
11451145
eq_(nw.nii_img.shape, (192, 192, 1))
1146-
ok_(np.allclose(np.dot(np.diag([-1., -1., 1., 1.]), src_dw.affine),
1146+
ok_(np.allclose(np.dot(np.diag([-1., -1., 1., 1.]), src_dw.get_affine()),
11471147
nw.nii_img.affine)
11481148
)
11491149
eq_(hdr.get_xyzt_units(), ('mm', 'sec'))

0 commit comments

Comments
 (0)