RF - move around some of the predict stuff

Just a little bit of cleanup of the predict code. @arokem can you look over this when you have time.
Yes - agreed. In that case, should also eliminate the tests of that
function around:
https://github.com/nipy/dipy/blob/master/dipy/reconst/tests/test_csdeconv.py#L283

On Fri, Sep 19, 2014 at 10:31 AM, MrBago <notifications@github.com> wrote:

> In dipy/reconst/csdeconv.py:
>
> > -    if np.iterable(S0):
> > -        # If it's an array, we need to give it one more dimension:
> > -        S0 = S0[..., None]
> > -
> > -    # This is the key operation: convolve and multiply by S0:
> > -    pre_pred_sig = S0 * np.dot(predict_matrix, sh_coeff)
> > -
> > -    # Now put everything in its right place:
> > -    pred_sig = np.zeros(pre_pred_sig.shape[:-1] + (gtab.bvals.shape[0],))
> > -    pred_sig[..., ~gtab.b0s_mask] = pre_pred_sig
> > -    pred_sig[..., gtab.b0s_mask] = S0
> > -
> > -    return pred_sig
> > -
> > +    model = ConstrainedSphericalDeconvModel(gtab, response, sh_order=sh_order)
> > +    return model.predict(sh_coeff)
>
> I don't quite get the question, but I think yes. Subclasses will get the
> predict method of the CSDmodel and can override it if it's appropriate.
> Calling fit.predict on any fit defers to the model which makes initiative
> sense, you apply a diffusion "model" to the fit to get the signal. It also
> makes coding sense, many models can return the same type of fit object (ie
> CSDmodel and QballModel both return an ShHarmFit) and predict will work in
> both cases because the fit just defers to the model that created it.
>
> I think this module level function is superfluous, I'm happy to remove it
> altogether if you do not need it.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/nipy/dipy/pull/415/files#r17797444>.
>