the criterion of remaining subjects,afeter scrubbing

Submitted by HermioneLin on

Dear all,

I want to use the data preprocessed to do the later analysis such as build a martix. But some subjects has limited timeseries when I finished scrubbing,which may result in a strange result. So I want to know how many time timeseries left in a subject( for my case ,the total time series are 180,first 5 were revoved at the very beginning part) is enough for further analysis.

Sincerely,

Lin

 

YAN Chao-Gan

Tue, 12/11/2018 - 10:15

Here is some code to know that. We should add an output in the next release:

FD = load([Cfg.WorkingDir,filesep,'RealignParameter',filesep,Cfg.SubjectID{i},filesep,FunSessionPrefixSet{iFunSession},Cfg.Covremove.HeadMotionScrubbingRegressors.FDType,'_',Cfg.SubjectID{i},'.txt']);

                TemporalMask=ones(length(FD),1);

                Index=find(FD > Cfg.Covremove.HeadMotionScrubbingRegressors.FDThreshold);

                TemporalMask(Index)=0;

                IndexPrevious=Index;

                for iP=1:Cfg.Covremove.HeadMotionScrubbingRegressors.PreviousPoints

                    IndexPrevious=IndexPrevious-1;

                    IndexPrevious=IndexPrevious(IndexPrevious>=1);

                    TemporalMask(IndexPrevious)=0;

                end

                IndexNext=Index;

                for iN=1:Cfg.Covremove.HeadMotionScrubbingRegressors.LaterPoints

                    IndexNext=IndexNext+1;

                    IndexNext=IndexNext(IndexNext<=length(FD));

                    TemporalMask(IndexNext)=0;

                end

                

                BadTimePointsIndex = find(TemporalMask==0);