TheAxonLab / hcph-sops

SOPs of the HCPh project
https://www.axonlab.org/hcph-sops/
Creative Commons Attribution 4.0 International
0 stars 6 forks source link

ENH: implement a QC checkpoint after denoising and FC extraction #444

Closed celprov closed 4 months ago

celprov commented 4 months ago

Summary:

This PR implements 3 new visualizations to assess the quality of the denoising: an overlay of the FC distributions, the distribution of QC-FC (correlation of FC with 3 fd-related IQMS), a scatterplot of the correlation of QC-FC with the euclidean distance.

To be able to generate those three plots, a few major functions needed to be implemented:

Additionally, I added arguments to funconn.py to increase the flexibility of the denoising it can perform.

What the three plots look like:

group_fc_dist group_QC-FC group_QC-FC_euclidean

PS don't pay attention if the distributions looks non-gaussian, I ran only a few permutation on my laptop, this is based on a few subjects and on the QCT because that's the MRIQC derivatives I had. For now, they just to give an idea of what the plot looks like, not scientifically relevant.

Here is a list of the major changes:

enh: plot the FC distribution and save the image

enh: plot the distributions of correlations between FC and 3 IQMs (fd_mean, fd_num and fd_perc) (QC-FC) and compute the percent match between QC-FC and a QC-FC obtained from a permutation test enh: find the derivative folder containing "mriqc", load the IQMs from the group tsv and keep only one row per subject.

enh: plot the QC-FC vs euclidean distance relationship, compute the significance of the correlation and save the image enh: compute the centers of mass of the DiFumo atlas' regions enh: obtain the distance matrix by computing the euclidean distance between the regions' centers of mass

enh: add denoising strategy as an argument to funconn to be able to modify the confounds used for regression enh: add motion as an argument to funconn to modify the type of motion regressors used

enh: implement some unit tests to verify the behavior of basic functions

fix: disable the possibility to not save the FC matrices in funconn.py as we need them saved for running funconn_group.py

Closes #384, #438