# Version 3.0 dwi2response gives nan

**URL:** <https://community.mrtrix.org/t/version-3-0-dwi2response-gives-nan/1232>\
**Category:** Uncategorized\
**Tags:** dwi2response\
**Created:** [October 11, 2017, 1:42pm UTC](https://community.mrtrix.org/t/version-3-0-dwi2response-gives-nan/1232 "2017-10-11T13:42:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)\
**Post date:** [October 12, 2017, 3:27am UTC](https://community.mrtrix.org/t/version-3-0-dwi2response-gives-nan/1232/3 "2017-10-12T03:27:27Z")

</div>

Just one further clarification:

The reason the behaviour has changed for you is because in [_MRtrix3_ Release Candidate 1](https://community.mrtrix.org/t/mrtrix3-version-3-0-release-candidate-1/851/4), `dwi2response` was altered to use the new `amp2response` command, as opposed to `sh2response`. The details of this command can be found [here](https://www.researchgate.net/publication/307862932_Constrained_linear_least_squares_estimation_of_anisotropic_response_function_for_spherical_deconvolution).

- `sh2response` simply rotates the SH decomposition of each single-fibre voxel so that the fibre is aligned with the z-axis, then averages across voxels. In this situation, _l_\>0, _m_=0 terms will be dominated by _noise_: the signal intensity shouldn’t be influenced by fibre orientation at _b_=0!

- `amp2response` is encountering a fundamental issue in obtaining a solution. It uses the signals from all single-fibre voxels at once; but it’s facing a conflict between having a signal intensity that shouldn’t vary as a function of angle from the fibre orientation, and a constraint that forces monotonicity as a function of angle from the fibre orientation (details in the abstract linked above). Hence the `NaN` result.

So I’d argue that `NaN` is in fact the more sensible answer of the two, since it’s highlighted the error in your -`lmax` option 😃

---

_[View the full topic](https://community.mrtrix.org/t/version-3-0-dwi2response-gives-nan/1232)._
