# Streamlines produced by ACT expected to start/end in the GM?

**URL:** https://community.mrtrix.org/t/streamlines-produced-by-act-expected-to-start-end-in-the-gm/8816
**Category:** Uncategorized
**Tags:** connectomics, tractography
**Created:** [August 18, 2026, 6:25am UTC](https://community.mrtrix.org/t/streamlines-produced-by-act-expected-to-start-end-in-the-gm/8816 "2026-08-18T06:25:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jhlegarreta](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jhlegarreta/32/4369_2.png) [@jhlegarreta](https://community.mrtrix.org/u/jhlegarreta)
#### Post date: [August 18, 2026, 6:25am UTC](https://community.mrtrix.org/t/streamlines-produced-by-act-expected-to-start-end-in-the-gm/8816/1 "2026-08-18T06:25:50Z")

</div>

Hi,  
I am trying to understand the effect of `tckgen` (called with iFDOD2+ACT) and `tckedit`.

Am I understanding correctly that `tckgen` called with iFDOD2+ACT, e.g.

```bash
tckgen \
  -algorithm ifod2 \
  -act "${5ttgen_fname}" \
  -backtrack \
  -seed_grid_per_voxel "${gmwmi_fname}" ${grid_size} \
  -nthreads ${n_threads} \
  -minlength ${min_length} \
  -maxlength ${max_length} \
  -select ${strml_count} \
  ${fod_fname} \
  ${tractogram_fname}

```

should produce a tractogram with streamlines ending/starting in the GM, regardless of the step size employed for propagation?

I have computed the binary mask resulting from the union of the cortical and subcortical GM from the result of the `5ttgen` voume, and visualizing `cgm_sgm_mask.mif` seems to have correctly included all cortical and subcortical GM.

I have then called `tckedit` on the tractogram with that mask and not all of the streamlines are kept:

```bash
mrconvert 5ttgen.mif -coord 3 0 tmp_cgm.mif
mrconvert 5ttgen.mif -coord 3 1 tmp_sgm.mif
mrcalc tmp_cgm.mif tmp_sgm.mif -add | mrthreshold - cgm_sgm_mask.mif

```

```bash
tckedit ${in_tractogram_fname} ${out_tractogram_fname} -include cgm_sgm_mask.mif

```

What am I missing here?

Thank you.
