How should I add covariance for inter-subject similarity analysis?

Hi nltools experts,

I have collected a clinical dataset containing the patients’ resting-state fMRI and the clinical symptom score (evaluated by clinical doctors), and I aim to examine the shared pattern between the brain activity and the symptoms.

Following the tutorial about inter-subject similarity analysis, I have built the neural similarity matrix and the symptom similarity matrix. However, given that the age and head motion in clinical dataset have an impact to the result, I also want to regressor out the effect of these covariance. Do you have any advice about that?

Thanks in advance.