Skip to content
Permalink
Browse files

DEBUG: listspike

  • Loading branch information...
tiborauer committed May 28, 2019
1 parent acb537a commit dab6ef1fafaaeec8bc9f8e02cf812125d9972802
Showing with 9 additions and 17 deletions.
  1. +9 −17 aa_modules/aamod_listspikes.m
@@ -11,17 +11,9 @@
resp='';

switch task
case 'domain'
resp='session'; % this module needs to be run once per session
case 'description'
resp='Run list spikes';
case 'summary'
resp='List spikes\n';
case 'report'
dirn = aas_getsesspath(aap,i,j);
spfn = fullfile(dirn,'spikesandmoves.mat');
load(spfn);
aap.report.html=strcat(aap.report.html,sprintf('Spikes %d Moves %d<br>',size(spikes,1),size(moves,1)));
spl = load(aas_getfiles_bystream(aap,subj,sess,'listspikes'));
aap.report.html=strcat(aap.report.html,sprintf('Spikes %d Moves %d<br>',size(spl.TSspikes,1),size(spl.Mspikes,1)));
case 'doit'

subjname = aas_prepare_diagnostic(aap,subj);
@@ -34,16 +26,16 @@
% spm_realign.

% Load the movement parameters
rp = aas_getfiles_bystream(aap,subj,sess,'realignment_parameter'); % aas_movPars(aap,subj, [1 0 0; 0 0 0]);
rp = spm_load(rp);
Mfn = cellstr(aas_getfiles_bystream(aap,subj,sess,'realignment_parameter')); % aas_movPars(aap,subj, [1 0 0; 0 0 0]);
rp = spm_load(Mfn{strcmp(spm_file(Mfn, 'ext'),'txt')});
nsess = length(aap.acq_details.sessions);


% Load up differnces through time as produced by tsdiffana
tdfn = aas_getimages_bystream(aap,subj,sess,'tsdiffana');

try
load (tdfn, 'td', 'globals', 'slicediff');
qa = load (tdfn);
catch
aas_log(aap,1,sprintf('%s not found: Please run tsdiffana first',tdfn));
end
@@ -52,10 +44,10 @@
rotlimit_radians=aap.tasklist.currenttask.settings.rotlimit_degrees*pi/180;

%% Now find big changes from one image to the next
% td = mean (across voxels) of square difference between one volume and the next
% globals = mean global value across an image
% qa.qa.global.diff = mean (across voxels) of square difference between one volume and the next
% qa.qa.global.mean = mean global value across an image

tm = td/(mean(globals).^2); % RC/KM added .^2 16/6/2008
tm = qa.qa.global.diff/(mean(qa.qa.global.mean).^2); % RC/KM added .^2 16/6/2008

switch aap.tasklist.currenttask.settings.tmbaseline
case 'zero'
@@ -85,7 +77,7 @@

badimages=[false; (Rtm > tmlimit)];

TSspikes=[find(badimages),tm(badimages(2:end)),slicediff(badimages(2:end))];
TSspikes=[find(badimages),tm(badimages(2:end)),qa.qa.slice.diff(badimages(2:end))];

%% Now find big movements
% shift to sync with scan number

0 comments on commit dab6ef1

Please sign in to comment.
You can’t perform that action at this time.