From 222f31f6d87587ac3a57dcc1baf869a79a4a27df Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Thu, 11 Apr 2019 12:55:50 +0100
Subject: [PATCH] TEST: Test adjustment for compressed voxelwise EVs

---
 tests/test_featdesign.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/test_featdesign.py b/tests/test_featdesign.py
index dd821127e..5c5d1a7e3 100644
--- a/tests/test_featdesign.py
+++ b/tests/test_featdesign.py
@@ -412,3 +412,19 @@ def test_VoxelwiseEVs():
             exp = img.dataobj[x, y, z, :]
             assert np.all(ev1.image[x, y, z, :] == exp)
             assert np.all(ev2.image[x, y, z, :] == exp)
+
+
+def test_compressed_voxelwise_ev():
+
+    testcases = [((1, 1, 10, 10), (0, 0, 5)),
+                 ((1, 10, 1, 10), (0, 5, 0)),
+                 ((10, 1, 1, 10), (5, 0, 0))]
+
+    with tempdir():
+
+        for shape, vox in testcases:
+            img = tests.make_random_image('vev.nii.gz',  shape)
+            vev = featdesign.VoxelwiseEV(0, 0, 'ev1', 'vev.nii.gz')
+            x, y, z = vox
+
+            assert np.all(vev.getData(5, 5, 5) == img.dataobj[x, y, z, :])
-- 
GitLab