Skip to content
Snippets Groups Projects
Commit fffeab28 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: use new resample module

parent c04931e4
No related branches found
No related tags found
No related merge requests found
......@@ -17,9 +17,10 @@ import mock
import pytest
import tests
import fsl.utils.transform as transform
import fsl.data.atlases as atlases
import fsl.data.image as fslimage
import fsl.utils.transform as transform
import fsl.utils.image.resample as resample
import fsl.data.atlases as atlases
import fsl.data.image as fslimage
datadir = op.join(op.dirname(__file__), 'testdata')
......@@ -286,7 +287,7 @@ def test_prepareMask():
np.array(np.random.random(ashape), dtype=np.float32),
xform=atlas.voxToWorldMat)
goodmask2, xf = goodmask1.resample(m2shape)
goodmask2, xf = resample.resample(goodmask1, m2shape)
goodmask2 = fslimage.Image(goodmask2, xform=xf)
wrongdims = fslimage.Image(
......
......@@ -14,6 +14,7 @@ import pytest
import fsl.data.atlases as fslatlases
import fsl.data.image as fslimage
import fsl.utils.transform as transform
import fsl.utils.image.resample as resample
import fsl.utils.cache as cache
from . import (testdir, make_random_mask)
......@@ -256,7 +257,8 @@ def _gen_mask_query(atlas, qtype, qin, maskres):
# aggresively to make sure there
# is no overlap between the different
# resolutions
mask, xform = mask.resample(a.shape[:3], dtype=np.float32, order=1)
mask, xform = resample.resample(
mask, a.shape[:3], dtype=np.float32, order=1)
mask[mask < 1.0] = 0
mask[a_zmask == 0] = 0
......@@ -279,7 +281,8 @@ def _eval_mask_query(atlas, query, qtype, qin):
if maskres == res:
rmask = mask[:]
else:
rmask = mask.resample(atlas.shape[:3], dtype=np.float32, order=0)[0]
rmask = resample.resample(
mask, atlas.shape[:3], dtype=np.float32, order=0)[0]
rmask = np.array(rmask, dtype=np.bool)
......
......@@ -16,6 +16,7 @@ import scipy.ndimage as ndi
import pytest
import fsl.utils.transform as transform
import fsl.utils.image.resample as resample
import fsl.data.atlases as fslatlases
import fsl.data.image as fslimage
import fsl.scripts.atlasq as fslatlasq
......@@ -329,7 +330,8 @@ def _gen_mask_query(atlas, use_label, q_type, q_in, res):
# resampled into the atlas resolution,
# it is still either in or out of the
# atlas space
mask, xform = mask.resample(a.shape[:3], dtype=np.float32, order=1)
mask, xform = resample.resample(
mask, a.shape[:3], dtype=np.float32, order=1)
thres = np.percentile(mask[mask > 0], 75)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment