Skip to content

Commit 4e20ab4

Browse files
committed
enh: raise base coverage
1 parent 26970f2 commit 4e20ab4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nitransforms/tests/test_base.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""Tests of the base module"""
2+
import numpy as np
3+
4+
from ..base import ImageSpace
5+
6+
7+
def test_ImageSpace(get_data):
8+
im = get_data['RAS']
9+
10+
img = ImageSpace(im)
11+
assert img.affine == np.linalg.inv(img.inverse)
12+
13+
# nd index / coords
14+
idxs = img.ndindex
15+
coords = img.ndcoords
16+
assert len(idxs.shape) == len(coords.shape) == 2
17+
assert idxs.shape[0] == coords.shape[0] == img.ndim == 3
18+
assert idxs.shape[1] == coords.shape[1] == img.nvox == np.prod(im.shape)

0 commit comments

Comments
 (0)