If there are functions that already do these things, they should be used
here, instead of calling out to nibabel.


On Thu, Jun 20, 2013 at 1:02 PM, Emmanuel Caruyer
<notifications@github.com>wrote:

> In doc/examples/reconst_dti.py:
>
> >  nib.save(evecs_img, 'tensor_evecs.nii.gz')
> >
> >  """
> > +Now, lets get the tensor coefficients D and format them for them
> > +as D = [dxx, dxy, dxz, dyy, dyz, dzz] for visualisation in the Fibernavigator
> > +(https://github.com/scilus/fibernavigator).
> > +"""
> > +
> > +tensor_vals = lower_triangular(tenfit.quadratic_form)
> > +correct_order = [0,1,3,2,4,5]
> > +tensor_vals_reordered = tensor_vals[:,:,:,correct_order]
> > +nib.save(nib.Nifti1Image(tensor_vals_reordered.astype(np.float32), img.get_affine()),
> > +         'tensors_coefs.nii.gz')
> > +
> > +
>
> @Garyfallidis <https://github.com/Garyfallidis> It is useful whenever you
> want to use your tensors in Slicer, Camino or other softs relying on this.
> BTW this is already implemented in dipy/io/utils.nifti1_symmat, my bad...
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/nipy/dipy/pull/204/files#r4805857>
> .
>