Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add no norm option to scil_bundle_fixel_analysis #1032

Merged
merged 11 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scilpy/tractanalysis/fixel_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ def maps_to_masks(maps, abs_thr, rel_thr, norm, nb_bundles):
rel_thr : float
Value of density maps threshold to obtain density masks, as a ratio of
the normalized density. Must be between 0 and 1.
norm : string, ["fixel", "voxel"]
norm : string, ["fixel", "voxel", "none"]
Way of normalizing the density maps. If fixel, will normalize the maps
per fixel, in each voxel. If voxel, will normalize the maps per voxel.
If none, will not normalize the maps.
nb_bundles : int (N)
Number of bundles (N).

Expand Down Expand Up @@ -140,7 +141,10 @@ def maps_to_masks(maps, abs_thr, rel_thr, norm, nb_bundles):
maps[..., i] /= fixel_sum

# Apply a threshold on the normalized density
masks_rel = maps > rel_thr
if norm == "voxel" or norm == "fixel":
masks_rel = maps > rel_thr
else:
masks_rel = maps > 0
# Compute the fixel density masks from the rel and abs versions
masks = masks_rel * masks_abs

Expand Down
Loading