From e59b7851c61765aefaa631d78b0c1eb4af68f062 Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 11 Oct 2022 11:17:33 -0700 Subject: [PATCH 1/3] [WIP] understanding DIPY tracking params --- AFQ/tractography.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/AFQ/tractography.py b/AFQ/tractography.py index 185e3cd7c..1c84c5430 100644 --- a/AFQ/tractography.py +++ b/AFQ/tractography.py @@ -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 @@ -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): From aa8bc5c0789b655e88d0569c149d9a5fe125bfcf Mon Sep 17 00:00:00 2001 From: 36000 Date: Tue, 11 Oct 2022 16:15:58 -0700 Subject: [PATCH 2/3] give more leeway on length --- AFQ/tractography.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFQ/tractography.py b/AFQ/tractography.py index 1c84c5430..a1e439e9c 100644 --- a/AFQ/tractography.py +++ b/AFQ/tractography.py @@ -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=20, max_length=300, odf_model="CSD", tracker="local"): """ Tractography From 63ca696a9c4c49a83a16b5b097a0d6dc849882be Mon Sep 17 00:00:00 2001 From: 36000 Date: Wed, 12 Oct 2022 09:18:37 -0700 Subject: [PATCH 3/3] back to defaults --- AFQ/tractography.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFQ/tractography.py b/AFQ/tractography.py index a1e439e9c..9cc2fca2a 100644 --- a/AFQ/tractography.py +++ b/AFQ/tractography.py @@ -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=300, odf_model="CSD", + min_length=50, max_length=250, odf_model="CSD", tracker="local"): """ Tractography