# Can I down-sample a larger tractogram to mimic a smaller one?

**URL:** https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978
**Category:** Uncategorized
**Tags:** tractography
**Created:** [October 11, 2018, 6:20pm UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978 "2018-10-11T18:20:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Xiaoping\_Wu](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/x/ebca7d/32.png) [@Xiaoping\_Wu](https://community.mrtrix.org/u/Xiaoping_Wu)
#### Post date: [October 11, 2018, 6:20pm UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/1 "2018-10-11T18:20:48Z")

</div>

Hello MRtrix experts,

I have a large set of tracks that has been generated by applying `tckgen -select 100M ...`. Now I want to have another smaller set, say one that has 10M tracks in it. Could I just run `tckedit 100M.tck -number 10M 10M.tck` or should I run `tckgen` again (ie apply `tckgen -select 10M...`)?

Thanks much,  
xiaoping

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [October 12, 2018, 9:08am UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/2 "2018-10-12T09:08:43Z")

</div>

Assuming you’re using a fully random [seeding mechanism](https://mrtrix.readthedocs.io/en/latest/reference/commands/tckgen.html#tractography-seeding-mechanisms-at-least-one-must-be-provided), then that’s fine: all streamlines are generated from random locations, there should be no systematic difference between the first and last 10M streamlines (or indeed any other arbitrary selection of 10M streamlines).

On the other hand, if you used a deterministic seeding strategy (i.e. `-seed_random_per_voxel` or `-seed_grid_per_voxel`), then there will be a systematic difference between earlier and later streamlines. Not too sure how to address that with the current functionality offered in `tckedit`, unfortunately…

---

<div class="post-metadata">

### Author: ![Xiaoping\_Wu](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/x/ebca7d/32.png) [@Xiaoping\_Wu](https://community.mrtrix.org/u/Xiaoping_Wu)
#### Post date: [October 12, 2018, 12:54pm UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/3 "2018-10-12T12:54:06Z")

</div>

Thanks for your response.  
Is it true that the seeding strategies `-seed_gmwmi` and `-seed_dynamic` are random?  
Thanks,  
xiaoping

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [October 12, 2018, 2:19pm UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/4 "2018-10-12T14:19:51Z")

</div>

> [@Xiaoping\_Wu](#):
>
> Is it true that the seeding strategies `-seed_gmwmi` and `-seed_dynamic` are random?

I’m pretty sure they are, but @rsmith would be better placed to confirm this…

---

<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: [November 25, 2018, 3:49am UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/5 "2018-11-25T03:49:59Z")

</div>

> Not too sure how to address that with the current functionality offered in `tckedit` , unfortunately

I did at some point (I think prior to `tckedit even`) have a command that extracted a random subset of a tractogram; i.e. for a fixed number of desired output streamlines, the indices of those streamlines that would be extracted was randomised. Not sure how difficult it would be to incorporate into `tckedit`…

---

<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: [November 25, 2018, 3:55am UTC](https://community.mrtrix.org/t/can-i-down-sample-a-larger-tractogram-to-mimic-a-smaller-one/1978/6 "2018-11-25T03:55:39Z")

</div>

> Is it true that the seeding strategies `-seed_gmwmi` and `-seed_dynamic` are random?

“Random” is not quite the right word to be using here. What’s requisite for the streamlines extracted via `tckedit -number` to be a representative subset of the larger tractogram is for the streamlines to be _order-independent_.

This _is_ the case for `-seed_gmwmi`, since each streamline seed point is derived entirely independently of any other tractogram information.

While `-seed_dynamic` contains stochasic elements, and hence could be described as “random”, it is _not_ order-independent: the probability of seeding from each fixel constantly evolves over time as the tractogram is generated; initially, there is no track density information, and so seeding behaves comparably to the `-seed_image` option, but as the tractogram gets increasingly dense, the probabilities of seeding in fixels densely reconstructed vs. sparsely reconstructed diverges. So the seed locations of streamlines in the latter part of the tractogram are _not_ independent of those streamlines that were generated in the earlier part of the tractogram, and thus using `tckedit -number` is not going to be an entirely representative subset. Combining it with the `-skip` option to sample a batch of streamlines from later in the tractogram may be more representative, but there are no guarantees.
