I tried this but it caused failing tests ... maybe I overlooked some detail.
but also I checked, it's certainly not a bottleneck.
I can try once more though.

On Wed, Jan 30, 2013 at 12:10 AM, Eric89GXL <notifications@github.com>wrote:

> In mne/fiff/bti/raw.py:
>
> > +
> > +def _convert_head_shape(idx_points, dig_points):
> > +    """ Helper function """
> > +
> > +    fp = idx_points.astype('>f8')
> > +    dp = np.sum(fp[2] * (fp[0] - fp[1]))
> > +    tmp1, tmp2 = np.sum(fp[2] ** 2), np.sum((fp[0] - fp[1]) ** 2)
> > +    dcos = -dp / np.sqrt(tmp1 * tmp2)
> > +    dsin = np.sqrt(1. - dcos * dcos)
> > +    dt = dp / np.sqrt(tmp2)
> > +
> > +    idx_points_nm = np.ones((len(fp), 3), dtype='>f8')
> > +    for idx, f in enumerate(fp):
> > +        idx_points_nm[idx, 0] = dcos * f[0] - dsin * f[1] + dt
> > +        idx_points_nm[idx, 1] = dsin * f[0] + dcos * f[1]
> > +        idx_points_nm[idx, 2] = f[2]
>
> I /think/ this could be vectorized equivalently as:
>
> idx_points_nm = np.array([dcos * fp[:, 0] - dsin * fp[:, 1] + dt,
>                           dsin * fp[:, 0] + dcos * fp[:, 1],
>                           fp[:, 2]], order='F', dtype='>f8').T
>
> Should be faster.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mne-tools/mne-python/pull/385/files#r2818188>.
>
>