Yes - thanks for the suggestion. Applying that now.


On Tue, Mar 11, 2014 at 3:44 PM, Matthew Brett <notifications@github.com>wrote:

> In dipy/core/geometry.py:
>
> > @@ -859,8 +862,17 @@ def vec2vec_rotmat(u, v):
> >      R = np.array([[cosa, -sina, 0], [sina, cosa, 0], [0, 0, 1]])
> >      Rp = np.dot(Pt, np.dot(R, P))
> >
> > +    # Everything's fine, up to a sign reversal:
> > +    rot_back = np.dot(Rp, v)
> > +    sign_reverser = np.sign((np.sign(rot_back) == np.sign(u)) - 0.5).squeeze()
> > +
> > +    # Multiply each line by it's reverser and reassmble the matrix:
> > +    Rp = np.array([np.array(Rp[i,:]) *
> > +                   sign_reverser[i] for i in range(3)]).squeeze()
>
> Sorry - maybe not following - but can this be done by broadcasting maybe
> with a newaxis ?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/nipy/dipy/pull/334/files#r10498203>
> .
>