[dipy] trouble with RESTORE method

59 views
Skip to first unread message

Ryan Muetzel

unread,
Apr 16, 2014, 10:19:08 AM4/16/14
to nipy...@googlegroups.com
Dear all,

I am attempting to use the dipy reconstruction with the RESTORE method/fit. The commands work just fine if I use the default WLS, and the nonlinear method...however, when I try the restore method, I get the error below.

The commands I'm using follow the example on the dipy website exactly (including the computation of the sigma), except that I'm using data from our scanner.  I'm using 35 direction DTI data plus 3b=0s, in case that is helpful.

Any ideas on what I'm doing wrong?  As I mention above....when i use the WLS or nonlinear methods, the process finishes without error, and I get similar maps to what I see from FSLs DTIFIT.

Let me know if you have any suggestions for me! 

All the best,

Ryan


>>> dti_restore_fit = dti_restore.fit(data)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/dipy-0.7.1-py2.7-linux-x86_64.egg/dipy/reconst/dti.py", line 621, in fit
    *self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/dipy-0.7.1-py2.7-linux-x86_64.egg/dipy/reconst/dti.py", line 1460, in restore_fit_tensor
    Dfun=_nlls_jacobian_func)
  File "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py", line 278, in leastsq
    raise TypeError('Improper input: N=%s must not exceed M=%s' % (n,m))
TypeError: Improper input: N=7 must not exceed M=3

Ariel Rokem

unread,
Apr 16, 2014, 12:23:31 PM4/16/14
to nipy...@googlegroups.com
Hi Ryan, 

This kind of error usually shows up when the estimate of the noise (sigma) is too small. How are you estimating the noise? 

Why are you interested in using RESTORE? Do you have reason to believe the data contains outliers? 

Cheers, 

Ariel 

--

---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Muetzel

unread,
Apr 16, 2014, 12:48:12 PM4/16/14
to nipy...@googlegroups.com
Hi Ariel,

Thank you for your reply! 

The sigma is being estimated from the 2nd method mentioned here:

http://nipy.org/dipy/examples_built/restore_dti.html

Namely,  the average standard deviation in the b=0 images (corrected for the bias resulting from having so few b0 images).  We are using GE data (with asset / parallel imaging), and thus I'm not sure it's possible to use the information outside of the brain to compute the sigma (because of how the recon is done).  We could turn to the ventricles, however, the data are from children, where in many cases the ventricles are quite small, and I'm not sure how consistent/valid the sigma would be across subjects.

In response to your second point -- no, we don't have particularly noisy data (although, they are kids who tend to move a bit more than adults).  We are mostly exploring alternative options to the standard tensor fit. This is in response to some of the recent literature we've seen where this is done, and to comments from reviewers that I've seen posted to the FSL list (reviewer suggesting the default way of computing the tensor in FSL is not sufficient). That all being said...when comparing the nonlinear fit to the standard fit from FSL, we see nearly identical results, at least in terms of FA.

Thanks again for the reply.

All the best,

Ryan

Ariel Rokem

unread,
Apr 18, 2014, 1:06:35 PM4/18/14
to nipy...@googlegroups.com
Hi Ryan, 

Sorry for the delay in responding! 

On Wed, Apr 16, 2014 at 9:48 AM, Ryan Muetzel <muet...@gmail.com> wrote:
Hi Ariel,

Thank you for your reply! 

The sigma is being estimated from the 2nd method mentioned here:

http://nipy.org/dipy/examples_built/restore_dti.html

Namely,  the average standard deviation in the b=0 images (corrected for the bias resulting from having so few b0 images).  We are using GE data (with asset / parallel imaging), and thus I'm not sure it's possible to use the information outside of the brain to compute the sigma (because of how the recon is done).  We could turn to the ventricles, however, the data are from children, where in many cases the ventricles are quite small, and I'm not sure how consistent/valid the sigma would be across subjects.

That seems reasonable. I am also doing measurements with GE and indeed, you can't use the corner to estimate the noise in these measurements. Estimating sigma based on 3 b=0 measurements might not be great, so I would look closely at those estimates. In particular, the error you are seeing is what happens when RESTORE considers most of the measurements to be outliers. This might also arise in the (small minority of) voxels in which the tensor model does not provide a good fit for the data, regardless of the noise. For example, in the centrum semi-ovale. Remember that RESTORE assumes that the tensor model is the right model for the data. 

 
In response to your second point -- no, we don't have particularly noisy data (although, they are kids who tend to move a bit more than adults).  We are mostly exploring alternative options to the standard tensor fit. This is in response to some of the recent literature we've seen where this is done, and to comments from reviewers that I've seen posted to the FSL list (reviewer suggesting the default way of computing the tensor in FSL is not sufficient). That all being said...when comparing the nonlinear fit to the standard fit from FSL, we see nearly identical results, at least in terms of FA.

That's not surprising to me. Despite what people sometimes say in the literature, the distribution of the marginals in the log-signal domain really is not that different from the distribution in the signal domain, so I have also observed that non-linear least squares gives almost identical results to the WLS and OLS solutions in several b values. 

Again - sorry for the delay in responding. 

Cheers, 

Ariel 


 
Thanks again for the reply.

All the best,

Ryan







On Wednesday, April 16, 2014 4:19:08 PM UTC+2, Ryan Muetzel wrote:
Dear all,

I am attempting to use the dipy reconstruction with the RESTORE method/fit. The commands work just fine if I use the default WLS, and the nonlinear method...however, when I try the restore method, I get the error below.

The commands I'm using follow the example on the dipy website exactly (including the computation of the sigma), except that I'm using data from our scanner.  I'm using 35 direction DTI data plus 3b=0s, in case that is helpful.

Any ideas on what I'm doing wrong?  As I mention above....when i use the WLS or nonlinear methods, the process finishes without error, and I get similar maps to what I see from FSLs DTIFIT.

Let me know if you have any suggestions for me! 

All the best,

Ryan


>>> dti_restore_fit = dti_restore.fit(data)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/dipy-0.7.1-py2.7-linux-x86_64.egg/dipy/reconst/dti.py", line 621, in fit
    *self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/dipy-0.7.1-py2.7-linux-x86_64.egg/dipy/reconst/dti.py", line 1460, in restore_fit_tensor
    Dfun=_nlls_jacobian_func)
  File "/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py", line 278, in leastsq
    raise TypeError('Improper input: N=%s must not exceed M=%s' % (n,m))
TypeError: Improper input: N=7 must not exceed M=3

Ariel Rokem

unread,
Apr 18, 2014, 1:12:38 PM4/18/14
to nipy...@googlegroups.com
On Fri, Apr 18, 2014 at 10:06 AM, Ariel Rokem <aro...@gmail.com> wrote:
Hi Ryan, 

Sorry for the delay in responding! 

On Wed, Apr 16, 2014 at 9:48 AM, Ryan Muetzel <muet...@gmail.com> wrote:
Hi Ariel,

Thank you for your reply! 

The sigma is being estimated from the 2nd method mentioned here:

http://nipy.org/dipy/examples_built/restore_dti.html

Namely,  the average standard deviation in the b=0 images (corrected for the bias resulting from having so few b0 images).  We are using GE data (with asset / parallel imaging), and thus I'm not sure it's possible to use the information outside of the brain to compute the sigma (because of how the recon is done).  We could turn to the ventricles, however, the data are from children, where in many cases the ventricles are quite small, and I'm not sure how consistent/valid the sigma would be across subjects.

That seems reasonable. I am also doing measurements with GE and indeed, you can't use the corner to estimate the noise in these measurements. Estimating sigma based on 3 b=0 measurements might not be great, so I would look closely at those estimates. In particular, the error you are seeing is what happens when RESTORE considers most of the measurements to be outliers. This might also arise in the (small minority of) voxels in which the tensor model does not provide a good fit for the data, regardless of the noise. For example, in the centrum semi-ovale. Remember that RESTORE assumes that the tensor model is the right model for the data. 


P.S. There is a PR on dipy implementing the PIESNO noise-estimation method (https://github.com/nipy/dipy/pull/337). Samuel mentioned there that he has successfully used it with RESTORE. That PR is probably very closely to be being merged, but for the time being you might want to switch to that branch (hoping you are comfortable with git and with installing dipy yourself). Samuel might be able to share a draft implementation of the example he mentioned in the discussion on that PR for you to try out. 
Reply all
Reply to author
Forward
0 new messages