Skip to content

Commit 8339116

Browse files
authored
Merge pull request #1032 from karanphil/add_no_norm_to_fixel_analysis
Add no norm option to scil_bundle_fixel_analysis
2 parents 546f1a9 + 754cc96 commit 8339116

File tree

3 files changed

+183
-139
lines changed

3 files changed

+183
-139
lines changed

scilpy/tractanalysis/fixel_density.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def maps_to_masks(maps, abs_thr, rel_thr, norm, nb_bundles):
110110
rel_thr : float
111111
Value of density maps threshold to obtain density masks, as a ratio of
112112
the normalized density. Must be between 0 and 1.
113-
norm : string, ["fixel", "voxel"]
113+
norm : string, ["fixel", "voxel", "none"]
114114
Way of normalizing the density maps. If fixel, will normalize the maps
115115
per fixel, in each voxel. If voxel, will normalize the maps per voxel.
116+
If none, will not normalize the maps.
116117
nb_bundles : int (N)
117118
Number of bundles (N).
118119
@@ -140,7 +141,10 @@ def maps_to_masks(maps, abs_thr, rel_thr, norm, nb_bundles):
140141
maps[..., i] /= fixel_sum
141142

142143
# Apply a threshold on the normalized density
143-
masks_rel = maps > rel_thr
144+
if norm == "voxel" or norm == "fixel":
145+
masks_rel = maps > rel_thr
146+
else:
147+
masks_rel = maps > 0
144148
# Compute the fixel density masks from the rel and abs versions
145149
masks = masks_rel * masks_abs
146150

0 commit comments

Comments
 (0)