Add 'all' option to --stat in compute_coherence() function#28
Open
giuliabiolo wants to merge 5 commits intodice-lab-vr:release/v1.3.0from
Open
Add 'all' option to --stat in compute_coherence() function#28giuliabiolo wants to merge 5 commits intodice-lab-vr:release/v1.3.0from
giuliabiolo wants to merge 5 commits intodice-lab-vr:release/v1.3.0from
Conversation
daducci
reviewed
Mar 17, 2026
| Percentage of streamlines to keep (randomly): 0=discard all, 1=keep all; | ||
| this filter is applied after all others. | ||
| scalars_filename : str, optional | ||
| Path to the file (.tsf) containing one scalar per streamline's coordinate |
Collaborator
There was a problem hiding this comment.
I think that it will be more useful if the additional file to be filtered could be either a .tsf or a .txt/.npy (in case I have only one scalar value per streamline).
Member
There was a problem hiding this comment.
Ah ok, I know what you mean. Yes!
| Path to the file (.txt, .npy, .tsf) that will contain the estimated coherence weights. | ||
| stat : {'min', 'mean', 'max', 'all'}, default='min' | ||
| Summary statistic to use once the coherence is computed for all segments of a streamline. | ||
| If 'all' is specified, the coherence of each segment will be saved in a .tsf file; otherwise, the summary statistic will be saved in a .txt or .npy file. When a .tsf file is produced, each point of a streamline is assigned a weight corresponding to the average coherence of the segments centered on that point. For the first and last points, the weight is computed using only the following or preceding segment, respectively. |
Collaborator
There was a problem hiding this comment.
We could add that the "trimmed" points (i.e., those for which both segments connected to them have been discarded) will have a value of -1 in the .tsf file.
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.
Added support for the 'all' value in the '--stat' parameter of compute_coherence(). When selected, coherence is computed for each segment along the streamlines and saved to a .tsf file.