Skip to content

Commit

Permalink
Run ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 21, 2024
1 parent 4bc9a8f commit 4a63d15
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qsiprep/utils/shm.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,15 @@ def calculate_max_order(n_coeffs):
Notes
-----
The calculation in this function proceeds according to the following
logic:
The calculation in this function proceeds according to the following logic.
.. math::
n = \frac{1}{2} (L+1) (L+2)
\rarrow 2n = L^2 + 3L + 2
\rarrow L^2 + 3L + 2 - 2n = 0
\rarrow L^2 + 3L + 2(1-n) = 0
\rarrow L_{1,2} = \frac{-3 \pm \sqrt{9 - 8 (1-n)}}{2}
\rarrow L{1,2} = \frac{-3 \pm \sqrt{1 + 8n}}{2}
\rarrow L_{1,2} = \frac{-3 \\pm \\sqrt{9 - 8 (1-n)}}{2}
\rarrow L{1,2} = \frac{-3 \\pm \\sqrt{1 + 8n}}{2}
Finally, the positive value is chosen between the two options.
"""
Expand Down Expand Up @@ -932,9 +932,11 @@ def anisotropic_power(sh_coeffs, norm_factor=0.00001, power=2, non_negative=True
Notes
----------
Calculate AP image based on a IxJxKxC SH coefficient matrix based on the
equation:
following equation.
.. math::
AP = \sum_{l=2,4,6,...}{\frac{1}{2l+1} \sum_{m=-l}^l{|a_{l,m}|^n}}
AP = \\sum_{l=2,4,6,...}{\\frac{1}{2l+1} \\sum_{m=-l}^l{|a_{l,m}|^n}}
Where the last dimension, C, is made of a flattened array of $l$x$m$
coefficients, where $l$ are the SH orders, and $m = 2l+1$,
Expand Down

0 comments on commit 4a63d15

Please sign in to comment.