Skip to content

Commit

Permalink
Fix test case that does not account for the reorientation
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Oct 15, 2021
1 parent acb5186 commit a3fee0f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions napari_nibabel/_tests/test_nibabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ def test_reader(tmp_path):

# write some fake data in NIFTI-1 format
my_test_file = str(tmp_path / "myfile.nii")
original_data = np.random.rand(20, 20)
nii = nib.Nifti1Image(original_data, affine=np.eye(4))
original_data = np.random.rand(20, 20, 1)

# Set affine to an LPS affine here so internal reorientation will not be
# needed.
nii = nib.Nifti1Image(original_data, affine=np.diag((-1, -1, 1, 1)))
nii.to_filename(my_test_file)
np.save(my_test_file, original_data)

Expand Down

0 comments on commit a3fee0f

Please sign in to comment.