source: plugins/resting_state_fc.m @ 67

Last change on this file since 67 was 62, checked in by tjniskan, 11 years ago
  • Added functions for basic fMRI analysis and resting-state
  • Added trend in the "show voxel timeseries" figure. In EPI datas the

the reference image is excluded from the time series and the y-axis
units are changed to "BOLD (%)".

  • Fixed an endiannes bug in an2_readfdf.m
  • Added plugins basic fmri analysis and resting-state analysis

M misclib/fmri_spm_volumes.m
A misclib/fmri_analysis.m
M an2_readfdf.m
M an2_revision.m
M an2_fitmaps.m
M an2_data_read.m
M aedes.m
A plugins/basic_fmri_analysis.m
A plugins/resting_state_fc.m

File size: 1.3 KB
Line 
1function resting_state_fc(DATA,ROI,AddInfo)
2%
3% An Aedes plugin that calculates resting state funtional connectivity from
4% seed ROIs.
5
6
7% Only accept 3D or 4D data
8if AddInfo.isDataMixed || ndims(DATA{1}.FTDATA)==2
9  errordlg('Only 3D or 4D can be used with this plugin.','Error',...
10    'modal');
11  return
12end
13
14% Don't include the reference image from EPIs
15if isfield(DATA{1},'PROCPAR') && isfield(DATA{1}.PROCPAR,'readres')
16  data = DATA{1}.FTDATA(:,:,:,2:end);
17else
18  data=DATA{1}.FTDATA;
19end
20
21% Get the ROIs from current slice/volume
22if ndims(data)==3
23  % Data slice upon which to show the maps
24  slice = data(:,:,1);
25 
26  for ii=1:length(ROI)
27    ROI(ii).voxels{1} = ROI(ii).voxels{1}(:,:,AddInfo.CurrentSlice(3));
28  end
29else
30  slice = data(:,:,:,1);
31  for ii=1:length(ROI)
32    ROI(ii).voxels{1} = ROI(ii).voxels{1}(:,:,:,AddInfo.CurrentVol);
33  end
34end
35
36% Smooth data
37data = fmri_smooth(data,[2 2]);
38%aedes(data)
39
40% Filter data
41data = fmri_filter(data,2.039,'hipass',0.009,...
42  'lowpass',0.08);
43%aedes(data)
44
45% Correlate seeds
46corrmap = fmri_corr(data,ROI);
47
48% Display results in a new Aedes window
49dt = repmat(slice,[1 1 length(corrmap)]);
50rs_maps = zeros(size(corrmap(1).ccc,1),size(corrmap(1).ccc,2),...
51  length(corrmap));
52for kk=1:length(corrmap)
53  rs_maps(:,:,kk) = corrmap(kk).ccc;
54end
55aedes(dt,[],rs_maps)
56
57
58
Note: See TracBrowser for help on using the repository browser.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008