DTI `min_signal`

This should deal with issues raised here: 

https://github.com/nipy/dipy/pull/496

without reverting. Still needs a bit of a refactor, to remove spurious checks and references to `min_signal`
Yes - I came to the conclusion that would be the best way about it. In
particular, otherwise some voxels might have a single zero somewhere in
their signal (one of our tests had that), and these would raise an error in
the SVD because log(signal) would evaluate to -inf.

BTW - could you hold off on merging this for another hour or so? I need to
check in with Bago about something, before we go through with this. I'll
let you know when you have the all-clear on this. Sorry about this -
refactoring here has uncovered some unexpected bumps.


On Fri, Dec 12, 2014 at 10:58 AM, Eleftherios Garyfallidis <
notifications@github.com> wrote:
>
> In dipy/reconst/dti.py
> <https://github.com/nipy/dipy/pull/498#discussion-diff-21765090>:
>
> > +            e_s += " positive."
> > +            raise ValueError(e_s)
> > +
> > +        max_d = self.kwargs.get('max_d', 0.003)
> > +        # preallocate:
> > +        params_in_mask = np.zeros((data_in_mask.shape[0], 12))
> > +        params_in_mask[:, 3:] = np.eye(3).ravel()
> > +        # We'll start by dealing with voxels that have no signal (s0 and d_sig
> > +        # are both all equal to 0), and with voxels with very large diffusivity
> > +        # (s0 is non-zero, but d_sig is all 0):
> > +        nz_s0 = np.nonzero(data_in_mask[..., self.gtab.b0s_mask])[0]
> > +        nz_d_sig = np.nonzero(data_in_mask[..., ~self.gtab.b0s_mask])[0]
> > +        # These are the actually interesting (non-zero d_sig and non-zero b0):
> > +        idx_to_fit = so.intersect1d(nz_s0, nz_d_sig)
> > +        to_fit = data_in_mask[idx_to_fit]
> > +        to_fit = np.maximum(to_fit, min_signal)
>
> Okay so now your strategy is to make sure that no signal is less that
> min_signal in the data.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/nipy/dipy/pull/498/files#r21765090>.
>