source: plugins/fmri_plugins/resting_state_fc.m

Last change on this file was 129, checked in by tjniskan, 9 years ago
  • Added plugin for correlation mapping with filtering/other options
  • Added flipping of 3D ROIs in aedes.m
  • Added possibility of changing ROI color (in the ROI -uimenu)
  • Minor fixes/changes here and there...

M misclib/fmri_spm_volumes.m
M misclib/fmri_filter.m
M aedes_fitmaps.m
M aedes.m
M plugins/save_roi_as_mask.m
M plugins/calc_asl_cbf.m
A plugins/fmri_plugins/correlation_mapping.m
M plugins/fmri_plugins/resting_state_fc.m
M plugins/map_plugins/t1_inversion_recovery.m
M aedes_revision.m

File size: 1.2 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
14data=DATA{1}.FTDATA;
15
16
17% Get the ROIs from current slice/volume
18if ndims(data)==3
19  % Data volume upon which to show the maps
20  vol = data(:,:,1);
21  for ii=1:length(ROI)
22    ROI(ii).voxels{1} = ROI(ii).voxels{1}(:,:,AddInfo.CurrentSlice(3));
23  end
24else
25  vol = data(:,:,:,1);
26  for ii=1:length(ROI)
27    ROI(ii).voxels{1} = ROI(ii).voxels{1}(:,:,:,AddInfo.CurrentVol);
28  end
29end
30
31% Do global normalization
32data = fmri_global_norm(data);
33
34% Spatially smooth data
35data = fmri_smooth(data,[2 2 1]);
36
37% Do fMRI filtering
38data = fmri_filter(data,2,'detrending','on',...
39  'lowpass',0.08);
40
41% Correlate seeds
42corrmap = fmri_corr(data,ROI);
43
44% Display results in a new Aedes window
45dt = repmat(vol,[1 1 1 length(corrmap)]);
46rs_maps = zeros(size(corrmap(1).ccc,1),size(corrmap(1).ccc,2),...
47  size(corrmap(1).ccc,3),length(corrmap));
48for kk=1:length(corrmap)
49  rs_maps(:,:,:,kk) = corrmap(kk).ccc;
50end
51aedes(dt,[],rs_maps)
52
53
54
55
56
57
58
59
60
Note: See TracBrowser for help on using the repository browser.

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