[Mrtrix-discussion] dwi2response failed to find SH peak
Robert Smith
robert.smith at florey.edu.au
Wed Nov 26 19:47:09 PST 2014
OK, so it's not *lmax* that's the problem; though I've modified
dwi2response to make sure that at least *lmax*=4 is used.
Looking at the output, you don't seem to have the most up-to-date code.
Could you please download the most up-to-date version and re-compile, and
see what happens? If that's not enough, could you try restarting your
processing from the very beginning (i.e. DICOM import) with the newest
code, and see if you get the same result?
I'm suspecting it may have something to do with those b=0 volumes, which
currently have a direction of [0 0 0]. There's a chance that the particular
code version you have is attempting to re-scale those vectors to unit
length and correct the b-value accordingly, which is resulting in an
infinite b-value, and therefore dwi2response is selecting those b=0 volumes
as the largest b-value shell to use in response function estimation. We've
made some changes to both the DICOM import code and b-value scaling in the
presence of non-unit-length direction vectors, so a simple code update may
well fix it; and if it doesn't, there's a couple of extra debugging console
outputs in the code that may provide us with more clues.
Rob
--
*Robert Smith, Ph.D*
Research Officer, Imaging Division
The Florey Institute of Neuroscience and Mental Health
Melbourne Brain Centre - Austin Campus
245 Burgundy Street
Heidelberg Vic 3084
Ph: +61 3 9035 7128
Fax: +61 3 9035 7301
www.florey.edu.au
On Tue, Nov 25, 2014 at 9:05 PM, Rafa X <rromero3000 at gmail.com> wrote:
> Hi Robert,
> Thanks for your quick response.
> Yes, I set Imax=2 but just to try if it finished early.
> I also ran the standard command:
>
> dwi2response dwi_ec.nii.gz responseText.txt -mask $path_BRAIN -info
> -debug -grad $path_bvec
>
> dwi_ec.nii.gz is the same nifti file that has been already used to track
> using camino and FSL
>
> My file $path_bvec contains bvec and bvals (including B=0):
>
> 0 0 0 0
> -0.30179 -0.49892 -0.8124 991.4
> 0.10011 -0.38886 -0.91584 990.33
> 0.19261 -0.95699 0.21697 1001.3
> 0.96169 0.1229 -0.24506 991.74
> 0.81411 -0.41851 0.40257 993.57
> -0.0014986 0.43766 -0.89914 990.66
> 0.082206 0.46978 0.87895 991.88
> 0.53567 -0.3644 -0.76175 990.15
> 0.24235 0.95847 0.15032 1001.1
> -0.6289 -0.59437 -0.50121 994.41
> 0.030908 0.97349 -0.22662 1000.7
> 0.75847 -0.048936 0.64987 988.95
> -0.75647 0.10047 0.64627 989.69
> 0 0 0 0
> -0.8253 0.54219 -0.15784 997.19
> 0.31397 0.040865 -0.94855 986.34
> 0.012679 -0.41192 0.91113 991.6
> -0.40493 0.89486 -0.18775 1000.5
> 0.30856 0.7896 -0.5304 995.3
> 0.52242 0.44816 0.72542 992.35
> 0.61055 0.72178 0.32599 997.16
> -0.56095 0.64767 -0.51562 994.84
> 0.2649 -0.93084 -0.25172 999.8
> -0.56309 -0.81605 -0.13037 1000.4
> -0.8855 -0.45957 -0.068378 996.81
> 0.39443 0.038652 0.91811 987.12
> 0 0 0 0
> 0.61303 -0.7892 0.036731 1000.4
> -0.28526 -0.9044 0.31732 999.4
> -0.23313 0.73144 0.64082 995.66
> -0.18955 0.95018 0.24743 1000.5
> -0.68422 -0.67696 0.27122 998.05
> -0.21528 -0.8244 -0.52347 996.61
> -0.43117 0.35928 -0.82765 989.07
> 0.44837 -0.41746 0.79037 991.41
> 0.61614 -0.67367 -0.4081 995.81
> -0.7349 -0.36356 0.57249 991.98
> 0.21674 0.78146 0.5851 996.89
> -0.86797 -0.20532 -0.45219 991.11
> -0.90577 0.34166 0.2507 994.46
> 0 0 0 0
> -0.43297 -0.19225 0.88067 988.45
> 0.84657 0.31401 0.42979 992.85
> 0.98331 -0.043749 0.17661 992.18
> 0.20102 -0.71986 -0.66438 994.31
> -0.13258 0.77961 -0.61207 994.49
> -0.95696 -0.15066 0.24804 992.64
> -0.58805 -0.10555 -0.80191 988.32
> 0.85492 -0.27751 -0.43829 991.46
> 0.56033 0.81795 -0.13034 999.37
> 0.062488 -0.7816 0.62064 996.28
> -0.032125 0.01453 0.99938 987.96
> -0.1674 0.0029333 -0.98589 986.29
> 0 0 0 0
> 0.72326 0.098618 -0.6835 988.64
> -0.80104 0.26152 -0.53846 990.25
> -0.6094 0.769 0.19305 999.45
> 0.48647 -0.73744 0.46854 996.41
> 0.87567 0.48285 0.0079515 997.79
> 0.43991 0.45803 -0.77245 990.63
> 0.74572 0.50959 -0.42921 993.29
> -0.3702 -0.62767 0.68482 993.32
> -0.375 0.30795 0.87438 990.07
> -0.98695 0.099977 -0.12619 993.52
> 0.89561 -0.44332 -0.036746 996.72
> -0.6239 0.53885 0.56603 994.18
> -0.1654 -0.98069 -0.10436 1002.3
> 0 0 0 0
>
> And the output of the dwi2response command is:
>
> dwi2response [INFO]: opening image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"...
> dwi2response [DEBUG]: sanitising image information...
> dwi2response [DEBUG]: voxel accessor for image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
> initialised with start = 95, strides = [ -1 96 9216 ]
> dwi2response [INFO]: opening image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
> dwi2response [DEBUG]: sanitising image information...
> dwi2response [DEBUG]: loading image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
> dwi2response: uncompressing image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
> 100%
> dwi2response [DEBUG]: image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
> loaded
> dwi2response [DEBUG]: voxel accessor for image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
> initialised with start = 95, strides = [ -1 96 9216 ]
> dwi2response [DEBUG]: image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
> unloaded
> dwi2response [DEBUG]: searching for suitable gradient encoding...
> dwi2response [INFO]: found 69x4 diffusion-weighted encoding
> dwi2response [INFO]: Diffusion gradient encoding data clustered into 2
> shells
> dwi2response [DEBUG]: loading image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"...
> dwi2response: uncompressing image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"... 100%
> dwi2response [DEBUG]: image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz" loaded
> dwi2response [DEBUG]: voxel accessor for image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
> initialised with start = 95, strides = [ -1 96 9216 645120 ]
> dwi2response: initialising response function... 100%
> dwi2response [INFO]: Initial response function is [331.3299255
> -81.32884216 0 0 0]
> dwi2response: optimising response function.. . dwi2response [DEBUG]:
> voxel accessor for image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
> initialised with start = 95, strides = [ -1 96 9216 645120 ]
> dwi2response [DEBUG]: voxel accessor for image
> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
> initialised with start = 95, strides = [ -1 96 9216 ]
> dwi2response [DEBUG]: initialising threads...
> dwi2response [DEBUG]: launching 1 thread "run thread"...
> dwi2response [DEBUG]: launched thread "run thread" [ID 140450999523072]
> dwi2response [DEBUG]: waiting for completion of thread "run thread" [ID
> 140450999523072]...
> dwi2response [DEBUG]: failed to find SH peak!
> dwi2response [DEBUG]: failed to find SH peak!
> dwi2response [DEBUG]: failed to find SH peak!
> dwi2response [DEBUG]: failed to find SH peak!
> dwi2response [DEBUG]: failed to find SH peak!
> and then I repeat this line many times
>
> Thankss the support!
>
> 2014-11-24 22:18 GMT+00:00 Robert Smith <robert.smith at florey.edu.au>:
>
>> Hi,
>>
>> The "failed to find SH peak!" error is not entirely uncommon,
>> especially if the input mask contains some non-brain voxels.
>>
>> It's a little hidden, but the problem lies here:
>> dwi2response [INFO]: Initial response function is [331.3299255
>> -81.32884216]
>> This indicates that the algorithm is using lmax = 2: this makes it
>> impossible to identify voxels with crossing fibres and remove them from the
>> single-fibre mask, so the algorithm will take much longer (normally
>> dwi2response runs CSD only on the single-fibre voxels from the previous
>> iteration, so each subsequent iteration takes less time).
>>
>> I would take a close look at your gradient table (presumably already
>> stored as a bvecs/bvals pair or external MRtrix format text file, given you
>> are using compressed niftis). It's possible that the table is either
>> corrupt, or is being erroneously split into two b-value shells when in
>> reality only one is present:
>> dwi2response [INFO]: Diffusion gradient encoding data clustered into 2
>> shells
>> It also appears to not include any b=0 volumes (not that that should
>> matter, the command won't use the b=0's, it's just slightly unusual to not
>> have any).
>>
>> If the problem's not immediately obvious, feel free to copy & paste the
>> file contents here. I'll also add some extra debugging outputs / sanity
>> checks to the code to hopefully give more interpretable feedback in such
>> circumstances.
>>
>> Cheers
>> Rob
>>
>>
>> --
>>
>> *Robert Smith, Ph.D*
>> Research Officer, Imaging Division
>>
>> The Florey Institute of Neuroscience and Mental Health
>> Melbourne Brain Centre - Austin Campus
>> 245 Burgundy Street
>> Heidelberg Vic 3084
>> Ph: +61 3 9035 7128
>> Fax: +61 3 9035 7301
>> www.florey.edu.au
>>
>> On Tue, Nov 25, 2014 at 2:11 AM, Rafa X <rromero3000 at gmail.com> wrote:
>>
>>> Hi Mrtrix expert,
>>> I'm new on mrtrix and I'm trying to run dwi2response (using -grad) but
>>> it has been days in a loop that said "failed to find SH peak!". Below you
>>> can see the output provided by "-info -debug".
>>>
>>>
>>> dwi2response [INFO]: opening image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"...
>>> dwi2response [DEBUG]: sanitising image information...
>>> dwi2response [DEBUG]: voxel accessor for image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
>>> initialised with start = 95, strides = [ -1 96 9216 ]
>>> dwi2response [INFO]: opening image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
>>> dwi2response [DEBUG]: sanitising image information...
>>> dwi2response [DEBUG]: loading image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
>>> dwi2response: uncompressing image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"...
>>> 100%
>>> dwi2response [DEBUG]: image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
>>> loaded
>>> dwi2response [DEBUG]: voxel accessor for image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
>>> initialised with start = 95, strides = [ -1 96 9216 ]
>>> dwi2response [DEBUG]: image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec_brain_mask.nii.gz"
>>> unloaded
>>> dwi2response [DEBUG]: searching for suitable gradient encoding...
>>> dwi2response [INFO]: found 69x4 diffusion-weighted encoding
>>> dwi2response [INFO]: Diffusion gradient encoding data clustered into 2
>>> shells
>>> dwi2response [DEBUG]: loading image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"...
>>> dwi2response: uncompressing image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"... 100%
>>> dwi2response [DEBUG]: image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz" loaded
>>> dwi2response [DEBUG]: voxel accessor for image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
>>> initialised with start = 95, strides = [ -1 96 9216 645120 ]
>>> dwi2response: initialising response function... 100%
>>> dwi2response [INFO]: Initial response function is [331.3299255
>>> -81.32884216]
>>> dwi2response: optimising response function.. . dwi2response [DEBUG]:
>>> voxel accessor for image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
>>> initialised with start = 95, strides = [ -1 96 9216 645120 ]
>>> dwi2response [DEBUG]: voxel accessor for image
>>> "/home/rr480/Code/KirstieDTI/SUB_DATA/22566/DTI/MRI0/dti_ec.nii.gz"
>>> initialised with start = 95, strides = [ -1 96 9216 ]
>>> dwi2response [DEBUG]: initialising threads...
>>> dwi2response [DEBUG]: launching 1 thread "run thread"...
>>> dwi2response [DEBUG]: launched thread "run thread" [ID 140638269503232]
>>> dwi2response [DEBUG]: waiting for completion of thread "run thread" [ID
>>> 140638269503232]...
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>> dwi2response [DEBUG]: failed to find SH peak!
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20141127/c5eafb3d/attachment-0001.html>
More information about the Mrtrix-discussion
mailing list