source: plugins/basic_fmri_analysis.m @ 67

Last change on this file since 67 was 67, checked in by tjniskan, 11 years ago
  • Added new options for reading VNMR EPI and RASER data. It is now

possible to automatically reorient EPI and RASER data and remove the
phase image from EPI data. These options can be changed from
Tools->Edit VNMR defaults.

  • Added a possibility to change the overlay parameters when calling

Aedes from the command line and changed the basic_fmri_analysis plugin
accordingly.

  • The "Voxel time-series" figure is now in "Always-on-top" mode.

M misclib/fmri_analysis.m
M an2_revision.m
M an2_data_read.m
M aedes.m
M plugins/basic_fmri_analysis.m
M an2_readfid.m
M an2_readfidprefs.m

File size: 1.8 KB
Line 
1function basic_fmri_analysis(DATA,ROI,AddInfo)
2%
3% This Aedes plugin does a quick basic fMRI analysis.
4%
5
6if AddInfo.isDataMixed
7  return
8end
9
10% Prompt for design and contrast
11prompt={'Stimulus onsets (scans):','Stimulus durations (scans):',...
12  'Contrast vector','Smooth FWHM','TR','P-value for FDR correction'};
13name='Enter parameters for fMRI analysis';
14numlines=1;
15defaultanswer={'30 75 120','15 15 15','1 0','2 2 1','2.039','0.05'};
16
17resp=inputdlg(prompt,name,numlines,defaultanswer);
18if isempty(resp)
19  % Canceled
20  return
21end
22
23% Call fmri_analysis in /misclib
24onset = str2num(resp{1});
25durat = str2num(resp{2});
26contr = str2num(resp{3});
27if length(contr)~=2
28  errordlg('Invalid contrast vector!','Error','modal');
29  return
30end
31smooth_sz = str2num(resp{4});
32TR = str2num(resp{5});
33qFDR = str2num(resp{6});
34
35% if isfield(DATA{1},'PROCPAR') && isfield(DATA{1}.PROCPAR,'readres')
36%   % Remove reference image from VNMR EPI data
37%   DATA{1}.FTDATA = DATA{1}.FTDATA(:,:,:,2:end);
38% end
39
40[maps_out,fdr_th] = fmri_analysis(DATA{1},'TR',TR,...
41  'onsets',onset,'durations',durat,...
42  'contrast',contr,'smooth',smooth_sz,'FDRth',qFDR);
43
44% Resize tmap to EPI time series size
45tmap = maps_out.tmap;
46tmap = repmat(tmap,[1,1,1,size(DATA{1}.FTDATA,4)]);
47
48if ~isempty(fdr_th)
49  fprintf(1,['FDR threshold at p<',num2str(qFDR),': %.3f\n'],fdr_th)
50else
51  fprintf(1,['No significant voxels over FDR threshold at p<',num2str(qFDR),'!\n'])
52end
53
54overlay.FTDATA = tmap;
55overlay.ImageOverlayCmapStr = 'hot';
56overlay.ImageOverlayTholdDirPos = 1;
57overlay.ImageOverlayAlpha = 1;
58if ~isempty(fdr_th)
59  overlay.ImageOverlayThold = fdr_th;
60  overlay.ImOverlayMin = 0;
61else
62  overlay.ImageOverlayAlpha = 0;
63end
64
65
66% Show in Aedes as overlay
67aedes(DATA,[],overlay);
68
69if isempty(fdr_th)
70  warndlg(['No significant voxels over FDR threshold at p < ',...
71    num2str(qFDR),'!'],'No significant voxels!','modal')
72end
73
74
Note: See TracBrowser for help on using the repository browser.

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