From 716f5b18a2ffb7ce110871728f5aa9badb5243b0 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Tue, 5 Dec 2017 13:02:53 +1030
Subject: [PATCH] More memory reduction in unit tests

---
 tests/test_atlasq_query.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tests/test_atlasq_query.py b/tests/test_atlasq_query.py
index c3fc1c6f2..928afdbd8 100644
--- a/tests/test_atlasq_query.py
+++ b/tests/test_atlasq_query.py
@@ -29,7 +29,7 @@ def setup_module():
         raise Exception('FSLDIR is not set - atlas tests cannot be run')
 
 
-atlases  = ['harvardoxford-cortical', 'talairach']
+atlases  = ['harvardoxford-subcortical', 'talairach']
 
 # False: do not use the --label flag
 # True:  use the --label flag
@@ -118,7 +118,10 @@ def _get_atlas(aid, use_label, res):
     if atlas is None:
         atlas = fslatlases.loadAtlas(aid,
                                      loadSummary=use_label,
-                                     resolution=res)
+                                     resolution=res,
+                                     indexed=True,
+                                     loadData=False,
+                                     calcRange=False)
         _atlases[aid] = atlas
     return atlas
 
@@ -438,10 +441,17 @@ def test_bad_mask(seed):
 
         for atlasID, use_label in it.product(atlases, use_labels):
 
-            atlas  = fslatlases.loadAtlas(atlasID, loadSummary=use_label)
+            atlas  = fslatlases.loadAtlas(
+                atlasID,
+                loadSummary=use_label,
+                indexed=True,
+                loadData=False,
+                calcRange=False)
             ashape = list(atlas.shape[:3])
 
-            wrongdims  = fslimage.Image(np.random.random(list(ashape) + [10]))
+            wrongdims  = fslimage.Image(
+                np.array(np.random.random(list(ashape) + [2]),
+                            dtype=np.float32))
             wrongspace = fslimage.Image(
                 np.random.random((20, 20, 20)),
                 xform=transform.concat(atlas.voxToWorldMat,
-- 
GitLab