Skip to content

Commit

Permalink
Merge pull request #911 from 36000/tracking_fixes
Browse files Browse the repository at this point in the history
[FIX] Updating DIPY tracking params
  • Loading branch information
36000 authored Oct 18, 2022
2 parents 7cfbf8c + 63ca696 commit 101db5b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions AFQ/tractography.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def track(params_file, directions="prob", max_angle=30., sphere=None,
seed_mask=None, seed_threshold=0, n_seeds=1, random_seeds=False,
rng_seed=None, stop_mask=None, stop_threshold=0, step_size=0.5,
min_length=20, max_length=250, odf_model="CSD",
min_length=50, max_length=250, odf_model="CSD",
tracker="local"):
"""
Tractography
Expand Down Expand Up @@ -77,7 +77,7 @@ def track(params_file, directions="prob", max_angle=30., sphere=None,
Defaults to 0 (this means that if no stop_mask is passed,
we will stop only at the edge of the image).
step_size : float, optional.
The size of a step (in voxels) of tractography. Default: 0.5
The size of a step (in mm) of tractography. Default: 0.5
min_length: int, optional
The miminal length (mm) in a streamline. Default: 20
max_length: int, optional
Expand Down Expand Up @@ -114,10 +114,8 @@ def track(params_file, directions="prob", max_angle=30., sphere=None,

# We need to calculate the size of a voxel, so we can transform
# from mm to voxel units:
R = affine[0:3, 0:3]
vox_dim = np.mean(np.diag(np.linalg.cholesky(R.T.dot(R))))
min_length = int((min_length / vox_dim) / step_size)
max_length = int((max_length / vox_dim) / step_size)
min_length = int(min_length / step_size)
max_length = int(max_length / step_size)

logger.info("Generating Seeds...")
if isinstance(n_seeds, int):
Expand Down

0 comments on commit 101db5b

Please sign in to comment.