Open
Conversation
added 10 commits
February 10, 2026 22:47
…ive support in local_dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick description
This PR adds multi-label Region-Adaptive Propagation (RAP) “switch” policies and integrates them into scil_tracking_local_dev.py, allowing tracking parameters to change based on an integer label map.
Main changes
• Multi label RAP policies (JSON) (per label: algo, theta in degrees, step_size), while keeping backward compatibility with the legacy single-policy format.
• Dynamic parameter switching during tracking: when entering a RAP label region (switch between det/prob, update theta, update step_size).
• CLI integration (--rap_mask, --rap_method switch, --rap_params (JSON policy file)
The goal here is to allow the tracking behavior to be changed conditionally on external information (here: a labeled RAP mask)
Type of change
Check the relevant options.
Provide data, screenshots, command line to test (if relevant)
Data: we use the FiberCup dataset (Tractometer).
RAP mask: integer label map (0...N).
Example JSON:
{
"1": {"algo": "det", "theta": 35, "step_size": 0.5},
"2": {"algo": "prob", "theta": 35, "step_size": 0.5},
"3": {"algo": "prob", "theta": 10, "step_size": 0.25}
}
Command line (local dev)
python -m scilpy.cli.scil_tracking_local_dev
<fodf.nii.gz> <seed_mask.nii.gz> <tracking_mask.nii.gz> out_rap_switch.trk
--algo prob --theta 35 --step 0.5 --min_length 10 --max_length 200
--rap_mask <rap_label_mask.nii.gz>
--rap_method switch
--rap_params <rap_policies.json>
-v INFO -f
Notes:
In some cases streamlines can exit voxel bounds, saving may require disabling bbox validation or filtering invalid streamlines prior to writing.
Do not pay attention to the modification of scil_local_tracking_rafael, was changed for tests at beginning
Next step: Implementation of stopping propagation when the next point is outside valid voxel bounds to reduce invalid streamlines
Checklist