source: plugins/fmri_plugins/resting_state_fc.m @ 78

Last change on this file since 78 was 78, checked in by tjniskan, 10 years ago
  • Moved fMRI related plugins to their own subdirectories
  • Created a subdirectory for map calculation plugins and added a few

basic plugins for those. At the moment these plugins do not support
masking etc. and I didn't test them at all so be cautious...

  • Made a minor memory optimation to an2_readfid.m
  • Fixed a few issues in files related updating via SVN
  • Disabled some annoying warnings that Matlab R2008a and higher

generate from uitree and uitreenode functions inan2_juigetfiles.m

  • Coded something minor to an2_maptool.m. This is still stub and does

not work at all. Please don't try to use it.

  • Fixed a bug that caused Aedes to fail without generating an error

when reading VNMR FID-files that don't have PROCPAR in the same folder.

  • Fixed a javaFrame -warning (with R2008a and higher) in aedes.m

M an2_revision.m
M an2_data_read.m
M an2_maptool.m
M aedes.m
D plugins/calculate_t2_map.m
D plugins/calculate_t1r_map.m
D plugins/basic_fmri_analysis.m
D plugins/resting_state_fc.m
A plugins/fmri_plugins
A plugins/fmri_plugins/basic_fmri_analysis.m
A plugins/fmri_plugins/resting_state_fc.m
A plugins/map_plugins
A plugins/map_plugins/t2.m
A plugins/map_plugins/t1_3_parameter_fit.m
A plugins/map_plugins/t1_saturation_recovery.m
A plugins/map_plugins/t1_rho.m
A plugins/map_plugins/t2_rho.m
A plugins/map_plugins/t1_inversion_recovery.m
M an2_readfid.m
M an2_check_updates.m
M an2_juigetfiles.m
M an2_update.m

File size: 1.4 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
15%if isfield(DATA{1},'PROCPAR') && isfield(DATA{1}.PROCPAR,'readres')
16%  data = DATA{1}.FTDATA(:,:,:,2:end);
17%else
18  data=DATA{1}.FTDATA;
19%end
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% Do global normalization
37data = fmri_global_norm(data);
38
39% Spatially smooth data
40data = fmri_smooth(data,[2 2]);
41%aedes(data)
42
43% Filter data
44% data = fmri_filter(data,2.039,'hipass',0.009,...
45%   'lowpass',0.08);
46data = fmri_filter(data,2.039,'detrending','on',...
47  'lowpass',0.08);
48%aedes(data)
49
50% Correlate seeds
51corrmap = fmri_corr(data,ROI);
52
53% Display results in a new Aedes window
54dt = repmat(slice,[1 1 length(corrmap)]);
55rs_maps = zeros(size(corrmap(1).ccc,1),size(corrmap(1).ccc,2),...
56  length(corrmap));
57for kk=1:length(corrmap)
58  rs_maps(:,:,kk) = corrmap(kk).ccc;
59end
60aedes(dt,[],rs_maps)
61
62
63
Note: See TracBrowser for help on using the repository browser.

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