Skip to content

Add 'all' option to --stat in compute_coherence() function#28

Open
giuliabiolo wants to merge 5 commits intodice-lab-vr:release/v1.3.0from
giuliabiolo:release/v1.3.0
Open

Add 'all' option to --stat in compute_coherence() function#28
giuliabiolo wants to merge 5 commits intodice-lab-vr:release/v1.3.0from
giuliabiolo:release/v1.3.0

Conversation

@giuliabiolo
Copy link
Collaborator

@giuliabiolo giuliabiolo commented Mar 17, 2026

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.

@giuliabiolo giuliabiolo changed the title Coherence: added tsf support Add 'all' option to --stat in compute_coherence() function 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Collaborator

@ilariagabusi ilariagabusi Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants