0todd0000 / spm1d

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

Exact value where data exceed threshold #128

Closed annabitel closed 4 years ago

annabitel commented 4 years ago

Hi all, I am looking for the way to find exact value of x (Time (%)) where data exceed a threshold. How can I do this? Ideally if it is possible to draw the line on the plot like the green one in example below:

image

Thank you for help in advance.

m-a-robinson commented 4 years ago

Hello,

You can find this in "clusters" with the "endpoints" keyword. Cluster details are stored in the inference object (usually referred to in the example code as ti or spmi).

Example to print details of all clusters (this also gives you an overview of all cluster-related information). print(ti.clusters)

Example to print the details of the first [0] cluster endpoints only ti.clusters[0].endpoints

Once you know the exact x-axis location, you can use this to draw your vertical line in the correct place. Check out axvline

Regards Mark

annabitel commented 4 years ago

Thank you a lot!