Skip to content

Rename sh2power to sh2metric, new "entropy" operation#2985

Merged
Lestropie merged 15 commits intodevfrom
sh2metric
Apr 25, 2026
Merged

Rename sh2power to sh2metric, new "entropy" operation#2985
Lestropie merged 15 commits intodevfrom
sh2metric

Conversation

@Lestropie
Copy link
Copy Markdown
Member

@Lestropie Lestropie commented Sep 3, 2024

Had previously thought about this from the perspective of registration, but have also been looking at a collaborator dataset where doing satisfactory masking for FBA has been difficult, and using that to revised FBA documentation (#2685).

Here is the WM FOD l=0 image, which you can see doesn't do a very good job of separating what one would like to analyse vs. not:

Screenshot from 2024-09-03 16-13-43

Then this is the entropy of the WM FOD template (normalised & inverted):

Screenshot from 2024-09-03 16-14-08


  • Implement the Spherical Harmonic Entropy (SHE) metric as per:
    https://arxiv.org/pdf/1805.08084
    This may yield the same or similar result much faster

  • Add command-line option to modify the direction set that's used for amplitude sampling

  • Implement entropy operations for:

    • mrmath
    • fixel2voxel
  • Revisit templated entropy calculation code
    For some reason had trouble specifying the logarithm function as a template. The switch statement should get optimised out by the compiler, but maybe I'll have another go before merging.

Includes checking out a new test data commit that moves existing test data and adds new test data.
@Lestropie Lestropie self-assigned this Sep 3, 2024
github-actions[bot]

This comment was marked as outdated.

@Lestropie
Copy link
Copy Markdown
Member Author

Was potentially a little too idealistic about this metric being useful as a scalar surrogate for multi-contrast registration (as multiple SH images can be provided as input to the entropy calculation). Kind of interesting, and maybe useful in specific use cases such as the unusual template above, but not a game-changer.

Single-subject HCP data:
MSMT_tissues
MSMT_entropy

Conflicts:
	cpp/cmd/sh2metric.cpp
	cpp/cmd/sh2power.cpp
	cpp/core/math/entropy.h
	testing/binaries/data
github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

Lestropie and others added 8 commits April 24, 2026 16:27
Conflicts:
	cpp/cmd/sh2power.cpp
	cpp/core/dwi/tractography/SIFT2/tckfactor.cpp
	testing/CMakeLists.txt
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Affects the set of directions used to sample SH amplitudes in computation of entropy.
Generated-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lestropie Lestropie marked this pull request as ready for review April 24, 2026 12:45
github-actions[bot]

This comment was marked as outdated.

Lestropie and others added 3 commits April 24, 2026 23:17
Prompt: "In file cpp/cmd/sh2metric.cpp, add capability to compute the complement of the SH entropy normalised to the [0.0, 1.0] range. Add new command-line option "-invnorm". The type of scaling to apply---normalisation as currently implemented, the complement of the normalised value, or no normalisation---should be represented as an enumeration.".

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@Lestropie Lestropie merged commit 265e3d8 into dev Apr 25, 2026
6 checks passed
@Lestropie Lestropie deleted the sh2metric branch April 25, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant