help > RE: Motion measure as covariates
Jul 6, 2018  10:07 AM | Larry Lai
RE: Motion measure as covariates
Dear CONN users

What are the differences between QC_mean motion and newly created "compute mean motion"?

Should I mean centered these covariates for within group analysis? For example, Group1_FD, and Group2_FD.


Best wishes 
Larry
Originally posted by Alfonso Nieto-Castanon:
Dear Hannes,

That is a very good question. One potential way to do this is the following: first you create a new condition in your project that explicitly excludes the invalid scans; then, since CONN has already computed the framewise displacement timeseries you just need to use the 'compute summary measures' functionality to estimate the average displacement restricted to this condition.

Doing this manually is perhaps a bit involved, so you could do that a bit more simply with the following steps:

1) install the attached patch (this is just to make this process a bit simpler; this patch is for release 17f, copy the attached file to your conn distribution folder overwriting the files with the same name there)

2) copy and paste the following commands in Matlab command line. That will create this new condition in your CONN project named "validscans" that includes all of the data but explicitly excludes outlier samples (those identified in your project's 'scrubbing' first-level covariate for each subject/session)

cov = conn_module('get','Setup.l1covariates');
idx = find(strcmp(cov.names,'scrubbing'));
files = {};
for nsub=1:numel(cov.files)
 for nses=1:numel(cov.files{nsub}{idx})
   R = double(all(cov.files{nsub}{idx}{nses}{3}==0,2));
   files{nsub}{nses} = fullfile(fileparts(cov.files{nsub}{idx}{nses}{1}),'validscans.mat');
   save(files{nsub}{nses},'R');
 end
end
conn_batch('Setup.covariates.names',{'QA_valid'},'Setup.covariates.files',{files},'Setup.covariates.add',true);
conn_batch('Setup.conditions.names',{'validscans'},'Setup.conditions.param',numel(cov.names),'Setup.conditions.add',true);
conn_process setup_conditions;

3) now, to compute mean motion, for example, while disregarding invalid scans, go to Setup.covariates, and select the QA_timeseries covariate (this covariate contains two timeseries, the second one is the framewise displacement timeseries that we want to average). Then select 'covariate tools' and 'compute summary measures', select 'raw values', 'average', and 'do not aggregate' in the first three fields, check the 'condition-specific measures', and select there your new 'validscans' condition, and click 'Ok'.

That will create a couple of new second-level covariates, the one named "average of QA_timeseries raw values at validscans measure2" represents the average framewise displacement across valid-scans only. 

Hope this helps
Alfonso



Originally posted by hannes berg:
Dear CONN users

does anybody know a simple way to get motion measures (like mean composite motion) AFTER the scrubbing procedure? I want to use this data for a comparison of motion differences between groups in order to assess effectivness of scrubbing. 

Thank you in advance

Hannes

Threaded View

TitleAuthorDate
hannes berg Jun 15, 2017
Alfonso Nieto-Castanon Jun 16, 2017
RE: Motion measure as covariates
Larry Lai Jul 6, 2018
Jordon Tng Jul 6, 2018
hannes berg Jun 16, 2017
Jeff Browndyke Jun 16, 2017
Alfonso Nieto-Castanon Jun 16, 2017
Jordon Tng Aug 1, 2018
Jeffrey Johnson Oct 28, 2019
Jeff Browndyke Jun 18, 2017
hannes berg Jun 16, 2017