Commit 1a068608 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Merge branch 'v1.0' into 'v1.0'

V1.0

See merge request !28
parents bef96d26 a7786c5c
Pipeline #764 canceled with stages
in 18 seconds
......@@ -235,7 +235,7 @@ variables:
# Linux builds for wxPython are currently not
# on pypi, but are available at this url.
- pip install -f https://wxpython.org/Phoenix/release-extras/linux/gtk3/debian-8/ wxpython
- pip install --only-binary wxpython -f https://wxpython.org/Phoenix/snapshot-builds/linux/gtk3/debian-8/ wxpython
# All other deps can be installed as
# normal. scipy is required by nibabel,
......
......@@ -42,7 +42,7 @@ def callFSL(*args):
log.debug('callfsl: {}'.format(' '.join(args)))
result = sp.check_output(args)
result = sp.check_output(args).decode('utf-8')
log.debug('result: {}'.format(result))
......
......@@ -62,6 +62,8 @@ def scaleOffsetXform(scales, offsets):
if not isinstance(scales, collections.Sequence): scales = [scales]
if not isinstance(offsets, collections.Sequence): offsets = [offsets]
if not isinstance(scales, list): scales = list(scales)
if not isinstance(offsets, list): offsets = list(offsets)
lens = len(scales)
leno = len(offsets)
......@@ -90,7 +92,8 @@ def compose(scales, offsets, rotations, origin=None):
:arg offsets: Sequence of three offset values.
:arg rotations: Sequence of three rotation values, in radians.
:arg rotations: Sequence of three rotation values, in radians, or
a rotation matrix of shape ``(3, 3)``.
:arg origin: Origin of rotation - must be scaled by the ``scales``.
If not provided, the rotation origin is ``(0, 0, 0)``.
......@@ -98,6 +101,12 @@ def compose(scales, offsets, rotations, origin=None):
preRotate = np.eye(4)
postRotate = np.eye(4)
rotations = np.array(rotations)
if rotations.shape == (3,):
rotations = axisAnglesToRotMat(*rotations)
if origin is not None:
preRotate[ 0, 3] = -origin[0]
preRotate[ 1, 3] = -origin[1]
......@@ -116,7 +125,8 @@ def compose(scales, offsets, rotations, origin=None):
offset[ 0, 3] = offsets[0]
offset[ 1, 3] = offsets[1]
offset[ 2, 3] = offsets[2]
rotate[:3, :3] = axisAnglesToRotMat(*rotations)
rotate[:3, :3] = rotations
return concat(offset, postRotate, rotate, preRotate, scale)
......
......@@ -41,7 +41,7 @@ import re
import string
__version__ = '1.0.3'
__version__ = '1.0.4'
"""Current version number, as a string. """
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment