All good points.

On Wednesday, October 23, 2013, Eleftherios Garyfallidis wrote:

> In dipy/reconst/csdeconv.py:
>
> > +        ci, cj, ck = np.array(data.shape[:3]) / 2
> > +    else:
> > +        ci, cj, ck = center
> > +    roi = data[ci - w: ci + w, cj - w: cj + w, ck - w: ck + w]
> > +    tenfit = ten.fit(roi)
> > +    FA = fractional_anisotropy(tenfit.evals)
> > +    FA[np.isnan(FA)] = 0
> > +    indices = np.where(FA > fa_thr)
> > +    lambdas = tenfit.evals[indices][:, :2]
> > +    S0s = roi[indices][:, np.nonzero(gtab.b0s_mask)[0]]
> > +    S0 = np.mean(S0s)
> > +    l01 = np.mean(lambdas, axis=0)
> > +    evals = np.array([l01[0], l01[1], l01[1]])
> > +    response = (evals, S0)
> > +    ratio = evals[1]/evals[0]
> > +    return response, ratio
>
> @arokem <https://github.com/arokem> concerning your 2nd and 3rd points.
> We don't need to do exactly what mrtrix does. Actually, we also have
> implemented more deconvolution algorithms than what mrtrix has. Look at the
> ConstrainedSDT for example. Indeed, there are many ways to select the
> response functions and it would be nice to have one that works best. What I
> have implemented here is finding the center of the volume and getting an
> small ROI around that, that most likely will have parts of the CC. Of
> course we can make that better by using what Sam did to find the CC voxels.
> That could be a nice future enhancement. But we will need to investigate if
> it works that well for this problem.
>
> Concerning your 1st point. I think that for the time being the response
> estimation (auto_response) should be called before the CSD because we need
> to give it the data too and a couple of parameters which could be
> different. For example the roi_width parameter will be different if you
> have data in 2mm or in 1mm voxel size. Otherwise when someone calls fit
> function we could have a mechanism that checks if the response is None and
> then try to calculate it. But I don't like this idea very much because we
> will need to add the parameters of the auto_response in the CSD model.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/nipy/dipy/pull/259/files#r7177585>
> .
>