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

Merge branch 'master' into 'master'

Master

See merge request !27
parents 52be3354 5938b7fd
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -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)
......
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