# Tcksift warnings

**URL:** <https://community.mrtrix.org/t/tcksift-warnings/2791>\
**Category:** Uncategorized\
**Created:** [September 8, 2019, 6:14am UTC](https://community.mrtrix.org/t/tcksift-warnings/2791 "2019-09-08T06:14:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LiuYuchen](https://community.mrtrix.org/user_avatar/community.mrtrix.org/liuyuchen/32/2896_2.png) [@LiuYuchen](https://community.mrtrix.org/u/LiuYuchen)\
**Post date:** [September 8, 2019, 6:14am UTC](https://community.mrtrix.org/t/tcksift-warnings/2791/1 "2019-09-08T06:14:47Z")

</div>

> **tckgen …/WM\_FOD.mif 10M.tck -seed\_image …/…/b0\_brain\_mask.nii.gz -select 10M**  
> tckgen: [100%] uncompressing image “…/…/b0\_brain\_mask.nii.gz”  
> ,10 -exclusive 1M.tck path tck\_roi/tck  
> tckgen: [100%] 10967223 seeds, 10729185 streamlines, 10000000 selected  
> **[liuyc@head01 tournier]$ tcksift 10M.tck …/WM\_FOD.mif 1M.tck -term\_number 1M**  
> tcksift: [100%] Creating homogeneous processing mask  
> tcksift: [100%] segmenting FODs  
> tcksift: [100%] mapping tracks to image  
> tcksift: Iteration Removed Remaining Cost fn  
> tcksift: [.] 2344 18 2427589 5.28%  
> tcksift: [WARNING] filtering has reached quantisation error but desired termination criterion has not been met;  
> tcksift: [WARNING] disabling cost function quantisation check  
> tcksift: [done] 13559 0 1245815 4.01%  
> tcksift: [WARNING] algorithm terminated before any user-specified termination criterion was met  
> tcksift: [100%] Writing filtered tracks output file

Here are warnings I have received when performing _tcksift_, while the number of sifted tracks is still below 1M, are those right tracks?

Another question is that, when I calculate the correlation of two subjects’ ROI-ROI (AAL2) tracks number, the pearson’s correlation is very high (1-2,3-4,5-6 are same person, the number are their correlation ), it seems unreasonable to me, what could be possible reasons for this high correlation?  
 ![image](https://community.mrtrix.org/uploads/default/original/2X/6/66cf719d6ecb9f6aa484d89e29759fcb195145ec.png)

---

<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 7, 2019, 9:49am UTC](https://community.mrtrix.org/t/tcksift-warnings/2791/2 "2019-10-07T09:49:32Z")

</div>

> Here are warnings I have received when performing _tcksift_ , while the number of sifted tracks is still below 1M, are those right tracks?

Seeing the phrase “right tracks” makes me uneasy 🙃

The terminal output is faithful to what’s going on, if expressed in a more general way. The SIFT algorithm is literally unable to find a single streamline that it predicts will lead to a decrease in the cost function. So instead of removing streamlines and increasing the cost function, it instead terminates with a greater number of streamlines remaining than what you requested. The “quantisation error” one is a little more cryptic, but the criterion is described in the relevant [manuscript](https://www.sciencedirect.com/science/article/abs/pii/S1053811912011615).

> Another question is that, when I calculate the correlation of two subjects’ ROI-ROI (AAL2) tracks number, the pearson’s correlation is very high (1-2,3-4,5-6 are same person, the number are their correlation ), it seems unreasonable to me, what could be possible reasons for this high correlation?

Is this literally the Pearson correlation coefficient calculated across all edges in the full AAL2 atlas? If so, this is the result of calculating a Pearson correlation coefficient on data that vary by many orders of magnitude; it is simply not designed to handle such data. If anything, performing a Pearson correlation on the logarithms of those values would make more sense, since the noise in structural connectomes is approximately multiplicative.

---

<div class="post-metadata">

**Author:** ![mlm144](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/b782af/32.png) [@mlm144](https://community.mrtrix.org/u/mlm144)\
**Post date:** [January 5, 2022, 12:25am UTC](https://community.mrtrix.org/t/tcksift-warnings/2791/3 "2022-01-05T00:25:21Z")

</div>

This may be a dumb a question, but if my goal is to have tcksift terminate once the cost function reaches 0 (no streamlines exist whose removal would improve the cost function) then should I use the option “term\_ratio value” and set it to 0? Or if I leave off all termination options, will tcksift automatically end when quantisation error reaches 0?

Thanks!  
Mags

---

<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:** [January 7, 2022, 6:56am UTC](https://community.mrtrix.org/t/tcksift-warnings/2791/4 "2022-01-07T06:56:21Z")

</div>

Welcome Mags!

I think you’re referring to terminating when the cost function _gradient_ reaches zero; having a cost function of zero would imply no numerical difference between tractogram and fixel data, which will never be possible.

In the absence of any termination options being specified, the algorithm will cease when the quantisation termination criterion is reached; this isn’t “a quantisation error of zero”, but the point at which the magnitude of quantisation exceeds the magnitude of the model improvements. If you want filtering to proceed beyond this point and instead terminate once the algorithm literally cannot find a single streamline that can be removed and result in a cost function decrease, then simply request that the algorithm terminate at a point beyond that which can actually be achieved; the most intuitive I think would be `-term_number 1`.

Cheers  
Rob
