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

TEST: deprecated module

parent 45fbd5c2
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ import pytest ...@@ -8,7 +8,7 @@ import pytest
import fsl.scripts.resample_image as resample_image import fsl.scripts.resample_image as resample_image
import fsl.utils.transform as transform import fsl.transform.affine as affine
from fsl.utils.tempdir import tempdir from fsl.utils.tempdir import tempdir
from fsl.data.image import Image from fsl.data.image import Image
...@@ -22,22 +22,22 @@ def test_resample_image_shape(): ...@@ -22,22 +22,22 @@ def test_resample_image_shape():
resample_image.main('image resampled -s 20,20,20'.split()) resample_image.main('image resampled -s 20,20,20'.split())
res = Image('resampled') res = Image('resampled')
expv2w = transform.concat( expv2w = affine.concat(
img.voxToWorldMat, img.voxToWorldMat,
transform.scaleOffsetXform([0.5, 0.5, 0.5], 0)) affine.scaleOffsetXform([0.5, 0.5, 0.5], 0))
assert np.all(np.isclose(res.shape, (20, 20, 20))) assert np.all(np.isclose(res.shape, (20, 20, 20)))
assert np.all(np.isclose(res.pixdim, (0.5, 0.5, 0.5))) assert np.all(np.isclose(res.pixdim, (0.5, 0.5, 0.5)))
assert np.all(np.isclose(res.voxToWorldMat, expv2w)) assert np.all(np.isclose(res.voxToWorldMat, expv2w))
assert np.all(np.isclose( assert np.all(np.isclose(
np.array(transform.axisBounds(res.shape, res.voxToWorldMat)) - 0.25, np.array(affine.axisBounds(res.shape, res.voxToWorldMat)) - 0.25,
transform.axisBounds(img.shape, img.voxToWorldMat))) affine.axisBounds(img.shape, img.voxToWorldMat)))
resample_image.main('image resampled -s 20,20,20 -o corner'.split()) resample_image.main('image resampled -s 20,20,20 -o corner'.split())
res = Image('resampled') res = Image('resampled')
assert np.all(np.isclose( assert np.all(np.isclose(
transform.axisBounds(res.shape, res.voxToWorldMat), affine.axisBounds(res.shape, res.voxToWorldMat),
transform.axisBounds(img.shape, img.voxToWorldMat))) affine.axisBounds(img.shape, img.voxToWorldMat)))
def test_resample_image_shape_4D(): def test_resample_image_shape_4D():
...@@ -65,9 +65,9 @@ def test_resample_image_dim(): ...@@ -65,9 +65,9 @@ def test_resample_image_dim():
resample_image.main('image resampled -d 0.5,0.5,0.5'.split()) resample_image.main('image resampled -d 0.5,0.5,0.5'.split())
res = Image('resampled') res = Image('resampled')
expv2w = transform.concat( expv2w = affine.concat(
img.voxToWorldMat, img.voxToWorldMat,
transform.scaleOffsetXform([0.5, 0.5, 0.5], 0)) affine.scaleOffsetXform([0.5, 0.5, 0.5], 0))
assert np.all(np.isclose(res.shape, (20, 20, 20))) assert np.all(np.isclose(res.shape, (20, 20, 20)))
assert np.all(np.isclose(res.pixdim, (0.5, 0.5, 0.5))) assert np.all(np.isclose(res.pixdim, (0.5, 0.5, 0.5)))
......
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