Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1304 +/- ##
==========================================
- Coverage 72.91% 72.71% -0.21%
==========================================
Files 295 295
Lines 25453 25549 +96
Branches 3567 3581 +14
==========================================
+ Hits 18560 18577 +17
- Misses 5389 5463 +74
- Partials 1504 1509 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
How does the tensor interpolation work? Linear interpolation of the 3x3 matrix? It is most likely not worth it, but I believe to interpolate a tensor you need Log-Euclidean or Riemannian interpolation. |
gabknight
left a comment
There was a problem hiding this comment.
Deterministic DTI tracking seem to be working fine. Probabilistic tracking is given the same output as det, not sure why. @arnaudbore do you get the expected tractograms on your side?
scil_tracking_local_dev --in_tensor dti.nii.gz DiSCo1_ROIs-binary.nii.gz DiSCo1_mask.nii.gz dti_tracking_prob.tck --step 0.5 --theta 45 --tensor_format dipy --algo prob
Typo in the PR description:
-
--fa_threshold 0.1 \ ---> option not available
-
--step_size 0.5 \ --> --step 0.5
| # For probabilistic tracking, add some noise | ||
| if self.algo == 'prob' and self.line_rng_generator is not None: | ||
| # Add gaussian noise to direction | ||
| noise = self.line_rng_generator.normal(0, 0.1, 3) |
There was a problem hiding this comment.
Can you make the normal std a member of the TensorPropagator class, with these default values? Potentially adding it too to scil_tracking_local_dev.py if these is use cases.
There was a problem hiding this comment.
May be less intuitive, but instead of 'det' or 'prob' could be just set the noise STD, in the doc you could suggest 0.1 std provide good prob results. if STD is 0 (default), you skip this step.
Quick description
DTI Tensor Tracking in scil_tracking_local_dev
Overview
The script now supports tracking from diffusion tensor imaging (DTI) data in addition to ODF-based tracking. This allows streamline tractography using the principal eigenvector of the diffusion tensor.
Usage
Tensor-based tracking
scil_tracking_local_dev.py \ --in_tensor tensor.nii.gz \ input_seed.nii.gz \ input_mask.nii.gz \ output_tractogram.trk \ --fa_threshold 0.1 \ --step_size 0.5 \ --theta 45 \ [other tracking options...]ODF-based tracking (original functionality)
scil_tracking_local_dev.py \ --in_odf odf.nii.gz \ input_seed.nii.gz \ input_mask.nii.gz \ output_tractogram.trk \ --sf_threshold 0.1 \ --step_size 0.5 \ --theta 45 \ [other tracking options...]Key Parameters for Tensor Tracking
--in_tensor
Path to the DTI tensor file (.nii.gz). The tensor must be in lower triangular format with 6 coefficients in the 4th dimension:
This is the standard format output by most DTI fitting tools including
scil_dti_metrics.py.--algo
Algorithm for direction selection:
det: Deterministic tracking (follows principal eigenvector exactly)prob: Probabilistic tracking (adds gaussian noise to eigenvector)probHow It Works
Direction Extraction: At each tracking step, the tensor is interpolated at the current position and decomposed into eigenvalues and eigenvectors.
Principal Direction: The eigenvector corresponding to the largest eigenvalue is used as the tracking direction.
Angle Constraint: The angle between consecutive steps must not exceed
theta(in degrees).Probabilistic Mode: When
--algo probis used, Gaussian noise is added to the direction to introduce variability.Tensor Format
The input tensor file must have shape
(X, Y, Z, 6)with the 6 tensor components in lower triangular order:This corresponds to the full symmetric 3x3 tensor:
Example Workflow
scil_dti_metrics.py \ dwi.nii.gz \ bvals bvecs \ --mask brain_mask.nii.gz \ --tensor tensor.nii.gz \ --fa fa.nii.gzscil_tracking_local_dev.py \ --in_tensor tensor.nii.gz \ wm_seed.nii.gz \ wm_mask.nii.gz \ tractogram.trk \ --fa_threshold 0.15 \ --algo det \ --step_size 0.5 \ --theta 45 \ --nt 1000000Comparison with ODF Tracking
Notes
...
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
...
Checklist