# TDT: How to calculate the average decoding accuracy of each significant cluster with TDT

Dear all

By using TDT, I could find accuracy map on the glass brain in the 2nd level.
But, I’m wondering how can I calculate the average decoding accuracy value of each cluster?
I understand I can find the decoding accuracy value in the peak coordinate from each participant via MRIcron.
However, I need to know the significant clusters’ accuracy.
I would be pleased if someone could let me know the way to tackle this matter.

Thank you so much

Dear Rue,

This seems to be a question more related to SPM. I think you can extract the values of a cluster in SPM but I don’t know out of the top of my head how this is done. I guess you could also use SPM to write a cluster mask and then load this mask in. Assuming you have the mask, it would be as simple as

`hdr = spm_vol('youraccuracymap.nii');`
( could also refer to the con-image of your 2nd level analysis)
`vol = spm_read_vols(hdr);`
`maskvol = spm_read_vols(spm_vol('yourclustermask.nii'));`
`cluster_acc = vol(logical(maskvol));`
`mean_cluster_acc = mean(cluster_acc);`

Best,
Martin

Dear Martin

Your code completely worked and demonstrated the average accuracy value of the target cluster.
I also understand if I change spm_vol to each participant’s nii file, I can demonstrate their decoding accuracy respectively.
But I’d like to make sure one more point.
If the accuracy is found to be 0.067, should I multiply the value by 100 and add it to 50% (as a result, 56.7%)?

Sincerely,
Rue

Dear Rue,

If you used accuracy from TDT, then it is already in percent around chance, i.e. it would be 50.067%.

One remark: I’m not sure there is a specific reason for using searchlights and apply results to a ROI afterwards, but I would consider using ROI decoding instead.

Best,
Martin

Dear Martin,

I deeply appreciate your useful comment.
It totally makes sense.

As you said, I administered the searchlight analyses.
But, I found the previous research that conducted searchlight analyses and reported not only each significant cluster’s t-value but their accuracy value as well.
But, I understand if the second-level analyses pass the threshold for significance, the results will be acceptable. Afterward analyses in each cluster would not be necessary.
Thanks a lot, it was so helpful.

Best regards,
Rue