0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

".clusters" command: can I get the width of the significant clusters ? #228

Closed Xlcandy closed 2 years ago

Xlcandy commented 2 years ago

"***.clusters" command returns detailed information about the significant clusters including endpoints. Can I get the "width"(larger endpoint minus smaller endpoint) of the individual clusters in a simple way? And I would like to get the sum of all significant cluster widths in a single t-test result.

ζˆͺ屏2022-09-16 上午11 47 16
0todd0000 commented 2 years ago

Try using spmi.extent to get the width of a single cluster.

I suggest using a list comprehension to get the widths of all clusters, like this:

extents = [c.extent for c in spmi.clusters]

or getting the total excursion set extent as:

total_extent = sum( [c.extent for c in spmi.clusters] )

However, please note that there is no straightforward parametric probability for total_extent; its probabilistic meaning is somewhat elusive. Thus I do not recommend using total_extent for reporting purposes.

Xlcandy commented 2 years ago

Okay! I got it. Thank you very much, Todd! Have a nice day!

0todd0000 commented 2 years ago

πŸ™‚