m2m_tract_filter

Extract a bundle of streamlines from an aligned tractogram.

Keep streamlines if any coordinate in the streamline is within the distance between the center of each voxel and the corner of the voxel.

>>> m2m_tract_filter.py path/to/input.trk path/to/output.trk path/to/reference.nii.gz
     [see (a) or (b) to ROI filters]
  1. Streamlines in a sphere:

Add to the command line:

>>> --sphere --center x y z --radius r

Use –donwload_sphere to download the spherical mask and precise its path

  1. Streamlines in a binary mask:

Add to the command line:

>>> --in_mask path_to_mask

usage: m2m_tract_filter.py [-h] [--sphere] [--center CENTER CENTER CENTER]
                           [--radius RADIUS]
                           [--download_sphere DOWNLOAD_SPHERE]
                           [--in_mask IN_MASK] [-f]
                           in_tract out_tract reference

Positional Arguments

in_tract

Path to input tractogram (trk)

out_tract

Path to output tractogram (trk)

reference

Path to reference volume (.nii.gz)

Named Arguments

--sphere

Keep streamlines inside a spherical mask. Precise its center and radius.

Default: False

--center

Center of the spherical mask. MI-brain coordinates (in voxels)

--radius

Radius of the spherical mask (in voxels).

--download_sphere

Path to .nii.gz spherical mask

--in_mask

Keep streamlines inside a ROI. Path to .nii.gz binary mask.

-f

Force overwriting of the output files.

Default: False

Author : Mahdi