@@ -122,6 +122,8 @@ def test_load(datadir, tmp_path, insert_b0, rotate_bvecs): # noqa: C901
122122 )
123123
124124 if insert_b0 :
125+ assert dwi_h5 .bzero is not None
126+ assert dwi_from_nifti1 .bzero is not None
125127 assert np .allclose (dwi_h5 .bzero , dwi_from_nifti1 .bzero )
126128
127129 assert np .allclose (dwi_h5 .bvals , dwi_from_nifti1 .bvals , atol = 1e-3 )
@@ -146,6 +148,8 @@ def test_load(datadir, tmp_path, insert_b0, rotate_bvecs): # noqa: C901
146148 if not rotate_bvecs : # If we set motion_affines, data WILL change
147149 assert np .allclose (dwi_h5 .dataobj , dwi_from_nifti2 .dataobj )
148150 if insert_b0 :
151+ assert dwi_h5 .bzero is not None
152+ assert dwi_from_nifti2 .bzero is not None
149153 assert np .allclose (dwi_h5 .bzero , dwi_from_nifti2 .bzero )
150154
151155 assert np .allclose (dwi_h5 .gradients , dwi_from_nifti2 .gradients )
@@ -173,6 +177,8 @@ def test_load(datadir, tmp_path, insert_b0, rotate_bvecs): # noqa: C901
173177 if not rotate_bvecs : # If we set motion_affines, data WILL change
174178 assert np .allclose (dwi_h5 .dataobj , dwi_from_nifti3 .dataobj )
175179
180+ assert dwi_h5 .bzero is not None
181+ assert dwi_from_nifti3 .bzero is not None
176182 assert np .allclose (dwi_h5 .bzero , dwi_from_nifti3 .bzero )
177183 assert np .allclose (dwi_h5 .gradients , dwi_from_nifti3 .gradients , atol = 1e-6 )
178184 assert np .allclose (dwi_h5 .bvals , dwi_from_nifti3 .bvals , atol = 1e-6 )
@@ -184,6 +190,7 @@ def test_load(datadir, tmp_path, insert_b0, rotate_bvecs): # noqa: C901
184190 if not rotate_bvecs : # If we set motion_affines, data WILL change
185191 assert np .allclose (dwi_h5 .dataobj , dwi_from_nifti4 .dataobj )
186192
193+ assert dwi_from_nifti4 .bzero is not None
187194 assert np .allclose (dwi_h5 .bzero , dwi_from_nifti4 .bzero )
188195 assert np .allclose (dwi_h5 .gradients , dwi_from_nifti4 .gradients )
189196 assert np .allclose (dwi_h5 .bvals , dwi_from_nifti4 .bvals , atol = 1e-6 )
0 commit comments