|
Doxygen Source Code Documentation
IndiAna.m File Reference
Go to the source code of this file.
|
Functions |
id | Output: (id waver) |
| fprintf (1,'\nOK, let''s roll...\n\n') |
| if (fid==-1) |
| fprintf (2,'Error:File%s does not exist.Please try it again.\n', InBrik) |
| fclose (fid) |
| if (isnumeric(TR)==0|isempty(TR)) |
| fprintf (2,'Error:the input is not a number.Please try it again.\n') |
| if (Censor~=1 &Censor~=0) |
| fprintf (2,'Error:the input is not a valid number.Please try it again.\n') |
end end | if (Censor==1) |
| fprintf (2,'Error:File%s does not exist.Please try it again.\n', Censor_fn) |
| if (isnumeric(N_tasks)==0|isempty(N_tasks)) |
| if (isnumeric(N_runs)==0|isempty(N_runs)) |
end end | if (N_runs==1) |
end end | run (1).first=0 |
end Get the concatenation
points and create a concatenation
file | if (N_runs > 1) |
end Get the concatenation
points and create a concatenation
file | fprintf ('After concatenation, the 1st run usually starts at 0.\n') |
| if (Concat_id< 0) |
| fprintf (2,'Error in creating concatenation file:Failed to write%s to disk.\n', Concat_fn) |
| while (1) |
| fprintf (2,'Halted:Ctrl+c to exit') |
| for (i=1:1:N_runs) |
| fprintf ('Number%i run starts ', i) |
while | run (i).first |
| if (isnumeric(run(i).first)==0|isempty(run(i).first)) |
| fprintf ('Number%i run ends ', i) |
| run (i+1).first |
| fprintf (Concat_id, '%i\n', run(i).first) |
| if (isnumeric(N_TR)==0|isempty(N_TR)) |
while | fprintf ('\nNormalization would automatically covert the regressor coefficients into percent signal change.') |
| if (run_norm~=0 &run_norm~=1) |
| fprintf (2,'Error:the input has to be 0 or 1.Please try it again.\n') |
while | fprintf ('\n3dAutomask uses 3dClipLevel algorithm to find clipping level.') |
| if (run_mask.do~=0 &run_mask.do~=1) |
end end | if (run_mask.do==1) |
if | isempty (run_mask.N_dilate) |
| elseif (isnumeric(run_mask.N_dilate)==0) |
| if (isnumeric(polort)==0|isempty(polort)) |
end end Analysis type | fprintf ('\nYou can run 2 types of analysis:\n\n') |
| fprintf ('(1) Deconvolution+Regression:generating impulse response functions and condition components;\n') |
| fprintf ('(2) Regression:breaking the signal down into various regressor components.\n') |
| if (Run_Type~=1 &Run_Type~=2) |
end end | fprintf ('\n') |
| if (Run_Type==1) |
while | fprintf ('Minimum lags for number%i stimulus ', iT) |
| Task (iT).MinLags = input('is: ') |
| if (isnumeric(Task(iT).MinLags)==0|isempty(Task(iT).MinLags)) |
| if (isnumeric(Task(iT).BasisOpt_struct(1).minlag)==0|isempty(Task(iT).BasisOpt_struct(1).minlag)) |
while | fprintf ('Maximum lags for number%i stimulus ', iT) |
| if (isnumeric(Task(iT).MaxLags)==0|isempty(Task(iT).MaxLags)) |
| if (isnumeric(Task(iT).BasisOpt_struct(1).maxlag)==0|isempty(Task(iT).BasisOpt_struct(1).maxlag)) |
end end end end for regression | fprintf ('\nAvailable basis function options are:\n\n') |
| fprintf ('GAM--Gamma variate\n') |
| fprintf ('tent--tent function\n') |
| fprintf ('MGH--used by Massachusetts General Hospital group\n') |
| fprintf ('SPM1--double canonical Gamma variates\n\n') |
| fprintf ('SPM2--mixture of Gamma variates with time derivative\n\n') |
lower(BasisFunc | flg10 () |
while | fprintf ('\nThe default power paratmeter is:8.6-GAM;2-MGH.\n') |
if | isempty (BasisOpt.gamb) |
if | if (strcmp(lower(BasisFunc),'gam')) |
end | if (strcmp(lower(BasisFunc),'mgh')) |
elseif | isnumeric (BasisOpt.gamb) = = 0 |
while | fprintf ('\nThe default scaling paratmeter is:0.547-GAM;1.25-MGH.\n') |
while | fprintf ('\nThe default delay paratmeter is:0-GAM;2.25-MGH.\n') |
| fprintf ('\nCurrently in each condition minlag and maxlag are set to be the same for all basis functions.\n') |
| fprintf ('The default for both is set to 0.Hit Enter if you want to set them 0.\n') |
while | if (strcmp(lower(BasisFunc),'gam')|strcmp(lower(BasisFunc),'mgh')|strcmp(lower(BasisFunc),'spm1')) |
| elseif (strcmp(lower(BasisFunc),'spm2')) |
end | if (isnumeric(N_basis)==0|isempty(N_basis)) |
end end Total time span of
all basis | functions (i.e.duration of IRF) in seconds BasisOpt.tSpan=0 |
| if ((N_basis > 1)&(strcmp(lower(BasisFunc),'tent'))) |
| if (isnumeric(BasisOpt.tSpan)==0|isempty(BasisOpt.tSpan)) |
end end end | if (N_basis >1) |
| if (isnumeric(Recon_dt)==0|isempty(Recon_dt)) |
while | fprintf ('\nThere are 2 kinds of stimulus file:\n') |
| fprintf ('1.Regular timing indexed with 0s and 1s(TR-locked)) |
| fprintf ('2.Irregular timing(not synchronized with TR).\n') |
| if (Stim_Type~=1 &Stim_Type~=2) |
end end | if (Stim_Type==2) |
while | fprintf ('Specify the precision of your timing files.For example, if time points reach the\n') |
| fprintf ('100th decimal, set it as 0.01 seconds.\n') |
| if (isnumeric(WAV_dt)==0|isempty(WAV_dt)) |
while | fprintf ('Number%i stimulus timing file ', iT) |
| fprintf (2,'Error:File%s does not exist.Please try it again.\n', Task(iT).StimTime) |
while | fprintf ('Number%i stimulus label ', iT) |
| if (ischar(Task(iT).Label)==0|isempty(Task(iT).Label)) |
| fprintf (2,'Error:the input is not a string.Please try it again.\n') |
end end end | fprintf ('\nSometimes covariates are considered in the modeling process.For example, if there were head motion') |
| fprintf ('\nduring the scanning, the variation caused by the motion is better accounted for by adding those') |
| fprintf ('\nparameters from 3dvolreg into the analysis.These regressors will be included as part of the baseline') |
| fprintf ('\nso that the finalthe final full F is interpreted as baseline+pure noise versus baseline+real signal+noise.') |
| if (base~=0 &base~=1) |
| if (base==1) |
| if (isnumeric(N_base)==0|isempty(N_base)) |
end end | if (N_base > 0) |
while | fprintf ('Number%i covariate ', i) |
| stimbase (i).label = input('expression is: ', 's') |
| if (ischar(stimbase(i).label)==0|isempty(stimbase(i).label)) |
while | fprintf ('Number%i covariate 1D file(or file with column specified) ', i) |
| if (ischar(stimbase(i).file)==0|isempty(stimbase(i).file)) |
| if (contrast~=0 &contrast~=1) |
end end | if (contrast==1) |
| if (isnumeric(N_contr)==0|isempty(N_contr)) |
| if (N_contr > 0) |
while | fprintf ('Number%i contrast ', i) |
| contr (i).label |
| if (ischar(contr(i).label)==0|isempty(contr(i).label)) |
| if (ischar(contr(i).expr)==0|isempty(contr(i).expr)) |
end end | if ((contr(i).expr(1)~= '+')|(contr(i).expr(1)~= '-')) |
contrast==0 | N_contr () |
| fprintf (2,'Error%s:Failed to write%s to disk.\n', FuncName, FoutName_log) |
end end Start normalization
or masking | if (run_norm==1|run_mask.do==1) |
end end Start normalization
or masking | if (err) |
end end Start normalization
or masking | fprintf (2,'Error%s:Failed in normalization.\n', preprc_fn) |
number of stimulus types | El (i).labels |
string length for each label | for (j=1:1:length(contr(i).expr)) |
id | cnt () |
otherwise | if (contr(i).expr(j)~= ' ') |
| for (k=1:1:cnt) |
end Make sure if there is
any misspelling of the stimulus
labels | if (size(El(i).order)~=cnt) |
end Make sure if there is
any misspelling of the stimulus
labels | fprintf (2,'Error:Misspelled stimulus label%s.\n', contr(i).expr) |
end end end end some more
setup | fprintf (1,'\n') |
| fprintf (2,'Error%s:Failed in WaverBasisOption.\n', FuncName) |
end end | p (1)-delay of response(relative to onset) 6-gamd in waver-GAM%p(2)-delay of undershoot(relative to onset) 16%p(3)-dispersion of response 1%p(4)-dispersion of undershoot 1 X%p(5)-ratio of response to undershoot 6 X%p(6)-onset(seconds) 0-gamd%p(7)-length of kernel(seconds) 32%p |
| p (6) |
| if (strcmp(lower(BasisFunc),'spm2')) |
| fprintf (2,'Error running spm_bf:Failed in running spm_bf.\n') |
| elseif (Stim_Type==2) |
Make finer stimulus vector | irr_vec (round(vec(i)/WAV_dt)+1) |
Only at those | moments (i.e., 1.5 sec) it is set to 1.end reg_f1 |
end | if (err1|err2) |
end | fprintf (2,'Error%s:failed to write into%s\n', Task(iT).Name(1).str) |
end end this is for calculating
condition number end end else
for other basis function options | fprintf (1,'Creating regressor(s) for task%d...\n', iT) |
end end | fprintf (2,'Error%s:Failed in WaverBasisOption\n', FuncName) |
form the command for Probably
better to put in a modular
function later Irregular timing | if (strcmp(lower(BasisFunc),'gam')|strcmp(lower(BasisFunc),'mgh')) |
| elseif (strcmp(lower(BasisFunc),'tent')) |
end end first log the waver
command | fprintf (2, 'Running:%s\n', comm_Waver) |
| fprintf (foutid_log, '%s\n', comm_Waver) |
| if (s) = system(comm_3dDecon) |
| fprintf (2,'Error%s:calling waver.\n\n\n%s\n', FuncName, w) |
useless from this point on
Now display the results | ShowRegressors (Task) |
end | fprintf (1,'Check the regressors now, and hit Enter key if you want to continue...\n') |
| fprintf (2, '\nCondition Number of design matrix is:%g\n.Continue?', CondNum) |
end | elseif (Run_Type==1) |
end end for | covariates (with stim_base) for(ii |
end end create options for
task effect test with genereal
linear test here we assume
the user implicitly wants
to test all tasks first generate
glt files by calling function
TaskTest m Only for | regression (Run_Type==2) |
No need for | deconvolution (Run_Type==1)%since 3dDeconvolve is supposed to automatically take care of that?gltopt1 |
for regression | if (N_basis~=1) |
| fprintf (2,'Error%s:Failed in ContrastTest.\n', contrfile) |
end end | if (N_basis==1) |
log the command | fprintf (foutid_log, '%s\n', comm_3dDecon) |
| if (PrefixStatus(sprintf('%s%s', statprefix, InBrikView))~=1|PrefixStatus(sprintf('%s%s', fitsprefix, InBrikView))~=1) |
end end | if (~Skip) |
end end | fprintf (1,'Running:%s\n', comm_3dDecon) |
| fprintf (2,'Error%s:calling 3dDeconvolve.\n\n%s\n\n', FuncName, w) |
| fprintf (1, '3dDeconvolve done in%f minutes...\n\n', t/60) |
Load the header of the output
stats brik | fprintf (1,'Recontructing each hemodynamic response function. ') |
| fprintf (2,'Error%s:Failed in BrikInfo.\n', FuncName) |
end end form the dcalc command
for each task type | fprintf (2,'Error%s:Failed in WhichSubBricks.\n', FuncName) |
end end | if (isempty(Task(iT).indx)) |
end end | fprintf (2,'Error%s:Failed to find subbricks.\n', FuncName) |
end end | if (length(Task(iT).indx)~=N_basis) |
end end | fprintf (2,'Error%s:length(Task(iT).indx)~=N_basis(%d,%d).\n', FuncName, length(Task(iT).indx), N_basis) |
| if (strcmp(lower(BasisFunc),'spm1')|strcmp(lower(BasisFunc),'spm2')) |
1:length(expr_str | expr_str () |
| fprintf (fidout,'%g\n', i) |
execute the command add command
to log file | fprintf (foutid_log, '%s\n', comm_3dcalc) |
| fprintf (1,'%s:Now running 3dcalc command(see%s)...\n', FuncName, FoutName_log) |
| fprintf (2,'Error%s:calling 3dcalc.\n\n%s\n\n', FuncName, w) |
add command to log file | fprintf (foutid_log, '%s\n', comm_refit) |
| fprintf (1,'%s:Now running 3drefit command(see%s)...\n', FuncName, FoutName_log) |
| fprintf (2,'Halted:Ctrl+c to exit!') |
end end end end close log file | fclose (foutid_log) |
| fprintf (1,'I am so glad that you have reached this point.Congratulations!Open AFNI and check the results...\n') |
| fprintf (1,'%s:Done.\n\n', FuncName) |
Variables |
script IndiAna | Purpose |
Various output files from
dDeconvolve Key | Terms |
Various output files from
dDeconvolve Key Bethesda MD
clear | all |
| FuncName = 'Decon' |
parameters common to all regressors
EPI time seris brick | flg1 = 0 |
flag for file existence while | InBrik = input('Input dataset (full filename with suffix BRIK): ','s') |
| fid = fopen (InBrik,'r') |
end end Use Ziad s AfniPrefix | m = AfniPrefix (InBrik) |
| flg2 = 0 |
Repition time TR in seconds
while | TR = input('TR (second): ') |
flag for censor file while | Censor = input('\nNeed to censor any time point(s)? (0 - No; 1 - Yes): ') |
while | Censor_fn = input('Censor file name: ','s') |
| fid2 = fopen (Censor_fn,'r') |
end end end | flg3 = 0 |
Number of tasks conditions
regressors to be tested while | N_tasks = input('Number of stimuli/tasks/conditions/regressors: ') |
end end | flg4 = 0 |
Number of runs concatenated
while | N_runs = input('Number of concatenated runs: ') |
| Concat_fn = sprintf('%s_concat.1D', InBrikPrefix) |
| Concat_id = fopen(Concat_fn,'w') |
| pause |
| flg5 = 0 |
end end Numer of TR s for
the whole dataset including
concatenated ones | flg6 = 0 |
while | N_TR = input('Number of TRs for the whole dataset (run 3dinfo on the dataset if you are not sure): ') |
end end | flg7 = 0 |
| run_norm = input('\nWant to normalize the dataset before running deconvolution/regression? (0 - No; 1 - Yes): ') |
run_mask | do = input('\nWant to mask the outside of brain? (0 - No; 1 - Yes): ') |
while run_mask | N_dilate = input('How many times do you want to dilate the mask outwards? (default - 5): ') |
end end end | flg8 = 0 |
| polort = 2 |
| flg9 = 0 |
while | Run_Type = input('\nWhat type of analysis? 1 - Deconvolution; 2 - Regression: ') |
for deconvolution | N_basis = 1 |
| flg10 = 0 |
| BasisFunc = input('Basis function type (GAM, tent, MGH, SPM1, SPM2, ...): ', 's') |
There is a scale factor with | MGH |
There is a scale factor with
but it is OK with | waver |
BasisOpt | gamb = input('Input the Power parameter if different from the default value, otherwise hit Enter: ') |
BasisOpt | gamc = input('Input the scaling parameter if different from the default value, otherwise hit Enter:') |
BasisOpt | gamd = input('Input the delay parameter if different from the default value, otherwise hit Enter:') |
while BasisOpt | minlag = input('Minimum lags (default: 0): ') |
while BasisOpt | maxlag = input('Maximum lags (default: 0): ') |
while BasisOpt | tSpan = input('Total time span of all basis functions in this regressor (sec): ') |
end end end | Recon_dt = 0.1 |
| n |
| Stim_Type = input('\nType of stimulus time files (1 - Regular; 2 - Irregular): ') |
| WAV_dt = input('Irregular timing precision (second): ') |
while | base = input('\n\nDo you want to add some covariates? (1 - yes; 0 - no) ') |
end end | N_base = 0 |
while | contrast = input('\nDo you want to run contrast test? (1 - yes; 0 - no) ') |
while | N_contr = input('How many contrast tests do you want to run? ') |
end end | contr = [] |
end | Others = input('Any options not listed above (hit Enter if none): ', 's') |
All input from the user is
done here | FoutName_log = sprintf('%s_CommandLog', InBrikPrefix) |
| foutid_log = fopen(FoutName_log,'w') |
end If the user requests for
contrast tests | cnt = 0 |
| strlnth = 0 |
| first = 1 |
| next = first+El(i).strln(k)-1 |
default | parameters [bf1 p] = spm_hrf(TR,p) |
get gamma hrf from SPM function
spm_hrf | dp = 1 |
for calculating time derivative | bf2 = (bf1 - spm_hrf(TR,p))/dp |
| D = (bf(:,1) - spm_hrf(TR,p))/dp |
time derivative | bf = [bf D(:)] |
| vec = load(Task(iT).StimTime) |
| Noext = RemoveExtension(Task(iT).StimTime, '.1D|.txt') |
end regular | timing [err, bf] = spm_bf (TR) |
end end | reg1 = conv(bf(:,1), vec) |
use the convolution function
in Matlab | reg2 = conv(bf(:,2), vec) |
end end | irr_vec = zeros(N_TR*TR/WAV_dt, 1) |
use the convolution function
in Matlab | reg_f2 = conv(bf(:,2), irr_vec) |
| end [err1, Task(iT).Name(1).str] = wryte3(reg1(1:N_TR), Task(iT).Name(1).str) |
Ziad s routine for writing
a matrix into a file else | err2 = wryte3(reg2(1:N_TR), Task(iT).Name(2).str) 0 |
form the command for Probably
better to put in a modular
function later Irregular timing | comm_Waver |
| Butt |
switch case | No |
end case | Yes |
end case | Continue = 1 |
Perhaps test the quality of
their regressors by calculating
the condition | number [err, CondNum] = CompCondNum (N_tasks, N_basis, Task, N_TR, polort) |
end end Now create the dDeconvolve
thing | Mandatory_opt1 = '' |
end | Mandatory_opt2 = '' |
| Mandatory_opt3 = '' |
| Mandatory_opt4 = '' |
| gltopt1 = TaskTest(N_runs, polort, N_basis, N_tasks, Task, N_base) sprintf('%s -num_glt %i\\\n', gltopt1, N_tasks+N_contr) |
Here a matrix with N_basis
rows is set for testing each
task end end end create glt
options for contrast tests | gltopt2 = '' |
| contrfile = ContrastTest (N_runs, polort, N_basis, Task, N_tasks, N_contr, El, N_base) |
end The reason for adding
the above line is that with | N_bais |
end end end end | fitsprefix = sprintf('%s_fits', InBrikPrefix) |
| statprefix = sprintf('%s_stat', InBrikPrefix) |
| FitOpts |
| comm_3dDecon |
let s run the dDeconvolve
command check for output prefix | existence |
end case | Skip = 1 |
end end | tic |
end end end | t = toc |
end end | input_str = '' |
| expr_str = '' |
create the junk D file | fidout = fopen('junk.1D', 'w') |
for the dcalc command | comm_3dcalc |
end end for the refit | comm_refit = sprintf('3drefit -epan %s%s', Task(iT).IRFprefix, InBrikView) |
end end end end | done |
Function Documentation
end end for covariates |
( |
with |
stim_base |
) |
|
|
No need for deconvolution |
( |
Run_Type |
= =1 |
) |
|
|
1:length(expr_str expr_str |
( |
|
) |
[static, virtual] |
|
string length for each label for |
( |
j |
= 1:1:length(contr(i).expr) |
) |
|
|
fprintf |
( |
1 |
, |
|
|
'I am so glad that you have reached this point.Congratulations!Open AFNI and check the results...\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Halted:Ctrl+c to exit!' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:calling 3dcalc.\n\n%s\n\n' |
, |
|
|
FuncName |
, |
|
|
w |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:Failed in BrikInfo.\n' |
, |
|
|
FuncName |
|
|
) |
|
|
Load the header of the output stats brik fprintf |
( |
1 |
, |
|
|
'Recontructing each hemodynamic response function. ' |
|
|
) |
|
|
fprintf |
( |
1 |
, |
|
|
'3dDeconvolve done in%f minutes...\n\n' |
, |
|
|
t/ |
60 |
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:calling 3dDeconvolve.\n\n%s\n\n' |
, |
|
|
FuncName |
, |
|
|
w |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:Failed in ContrastTest.\n' |
, |
|
|
contrfile |
|
|
) |
|
|
end fprintf |
( |
1 |
, |
|
|
'Check the regressors |
now, |
|
|
and hit Enter key if you want to continue...\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:calling waver.\n\n\n%s\n' |
, |
|
|
FuncName |
, |
|
|
w |
|
|
) |
|
|
end fprintf |
( |
2 |
, |
|
|
'Error%s:failed to write into%s\n' |
, |
|
|
Task(iT).Name(1). |
str |
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error running spm_bf:Failed in running spm_bf.\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error%s:Failed in WaverBasisOption.\n' |
, |
|
|
FuncName |
|
|
) |
|
|
end Make sure if there is any misspelling of the stimulus labels fprintf |
( |
2 |
, |
|
|
'Error:Misspelled stimulus label%s.\n' |
, |
|
|
contr(i). |
expr |
|
) |
|
|
while fprintf |
( |
'Number%i contrast ' |
, |
|
|
i |
|
|
) |
|
|
fprintf |
( |
'\nso that the finalthe final full F is interpreted as baseline+pure noise versus baseline+real signal+noise.' |
|
) |
|
|
fprintf |
( |
'\nparameters from 3dvolreg into the analysis.These regressors will be included as part of the baseline' |
|
) |
|
|
fprintf |
( |
'\nduring the |
scanning, |
|
|
the variation caused by the motion is better accounted for by adding those' |
|
|
) |
|
|
end end end fprintf |
( |
'\nSometimes covariates are considered in the modeling process.For |
example, |
|
|
if there were head motion' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:the input is not a string.Please try it again.\n' |
|
|
) |
|
|
while fprintf |
( |
'Number%i stimulus label ' |
, |
|
|
iT |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:File%s does not exist.Please try it again.\n' |
, |
|
|
Task(iT). |
StimTime |
|
) |
|
|
fprintf |
( |
'100th |
decimal, |
|
|
set it as 0.01 seconds.\n' |
|
|
) |
|
|
while fprintf |
( |
'Specify the precision of your timing files.For |
example, |
|
|
if time points reach the\n' |
|
|
) |
|
|
fprintf |
( |
'2.Irregular timing(not synchronized with TR).\n' |
|
) |
|
|
fprintf |
( |
'1.Regular timing indexed with 0s and |
1s(TR-locked) |
) |
|
|
while fprintf |
( |
'\nThere are 2 kinds of stimulus file:\n' |
|
) |
|
|
fprintf |
( |
'The default for both is set to 0.Hit Enter if you want to set them 0.\n' |
|
) |
|
|
while fprintf |
( |
'\nThe default delay paratmeter is:0-GAM;2.25-MGH.\n' |
|
) |
|
|
while fprintf |
( |
'\nThe default scaling paratmeter is:0.547-GAM;1.25-MGH.\n' |
|
) |
|
|
while fprintf |
( |
'\nThe default power paratmeter is:8.6-GAM;2-MGH.\n' |
|
) |
|
|
fprintf |
( |
'SPM2--mixture of Gamma variates with time derivative\n\n' |
|
) |
|
|
fprintf |
( |
'SPM1--double canonical Gamma variates\n\n' |
|
) |
|
|
fprintf |
( |
'MGH--used by Massachusetts General Hospital group\n' |
|
) |
|
|
fprintf |
( |
'tent--tent function\n' |
|
) |
|
|
fprintf |
( |
'GAM--Gamma variate\n' |
|
) |
|
|
fprintf |
( |
'(2) Regression:breaking the signal down into various regressor components.\n' |
|
) |
|
|
fprintf |
( |
'(1) Deconvolution+Regression:generating impulse response functions and condition components;\n' |
|
) |
|
|
end end Analysis type fprintf |
( |
'\nYou can run 2 types of analysis:\n\n' |
|
) |
|
|
while fprintf |
( |
'\n3dAutomask uses 3dClipLevel algorithm to find clipping level.' |
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:the input has to be 0 or 1.Please try it again.\n' |
|
|
) |
|
|
while fprintf |
( |
'\nNormalization would automatically covert the regressor coefficients into percent signal change.' |
|
) |
|
|
fprintf |
( |
'Number%i run ends ' |
, |
|
|
i |
|
|
) |
|
|
fprintf |
( |
'Number%i run starts ' |
, |
|
|
i |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Halted:Ctrl+c to exit' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error in creating concatenation file:Failed to write%s to disk.\n' |
, |
|
|
Concat_fn |
|
|
) |
|
|
end Get the concatenation points and create a concatenation file fprintf |
( |
'After |
concatenation, |
|
|
the 1st run usually starts at 0.\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:File%s does not exist.Please try it again.\n' |
, |
|
|
Censor_fn |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:the input is not a valid number.Please try it again.\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:the input is not a number.Please try it again.\n' |
|
|
) |
|
|
fprintf |
( |
2 |
, |
|
|
'Error:File%s does not exist.Please try it again.\n' |
, |
|
|
InBrik |
|
|
) |
|
|
fprintf |
( |
1 |
, |
|
|
'\ |
nOK, |
|
|
let''s roll...\n\n' |
|
|
) |
|
|
end end Total time span of all basis functions |
( |
i.e.duration of |
IRF |
) |
[pure virtual] |
|
end end if |
( |
isempty(Task(iT).indx) |
|
) |
|
|
if |
( |
PrefixStatus(sprintf('%s%s', statprefix, InBrikView))~ |
= 1 | PrefixStatus (sprintf('%s%s', fitsprefix, InBrikView)) ~= 1 |
) |
|
|
end end if |
( |
(contr(i).expr(1)~= '+')|(contr(i).expr(1)~= '-') |
|
) |
|
|
if |
( |
ischar(contr(i).expr) |
= = 0 | isempty(contr(i).expr) |
) |
|
|
if |
( |
ischar(contr(i).label) |
= = 0 | isempty(contr(i).label) |
) |
|
|
if |
( |
isnumeric(N_contr) |
= = 0 | isempty(N_contr) |
) |
|
|
if |
( |
ischar(stimbase(i).file) |
= = 0 | isempty(stimbase(i).file) |
) |
|
|
if |
( |
ischar(stimbase(i).label) |
= = 0 | isempty(stimbase(i).label) |
) |
|
|
if |
( |
ischar(Task(iT).Label) |
= = 0 | isempty(Task(iT).Label) |
) |
|
|
if |
( |
isnumeric(Task(iT).BasisOpt_struct(1).maxlag) |
= = 0 | isempty(Task(iT).BasisOpt_struct(1).maxlag) |
) |
|
|
if |
( |
isnumeric(Task(iT).MaxLags) |
= = 0 | isempty(Task(iT).MaxLags) |
) |
|
|
if |
( |
isnumeric(Task(iT).BasisOpt_struct(1).minlag) |
= = 0 | isempty(Task(iT).BasisOpt_struct(1).minlag) |
) |
|
|
if |
( |
isnumeric(Task(iT).MinLags) |
= = 0 | isempty(Task(iT).MinLags) |
) |
|
|
if |
( |
run_mask. |
do = = 1 |
) |
|
|
if |
( |
isnumeric(N_TR) |
= = 0 | isempty(N_TR) |
) |
|
|
if |
( |
isnumeric(run(i).first) |
= = 0 | isempty(run(i).first) |
) |
|
|
if |
( |
isnumeric(TR) |
= = 0 | isempty(TR) |
) |
|
|
Right now same lags for all regressors and basis functions if isempty |
( |
BasisOpt. |
maxlag |
) |
|
|
if isempty |
( |
run_mask. |
N_dilate |
) |
|
|
elseif isnumeric |
( |
BasisOpt. |
maxlag |
) |
= = 0 |
|
Only at those moments |
( |
i. |
e., |
|
|
1.5 |
sec |
|
) |
|
|
contrast == 0 N_contr |
( |
|
) |
[static, virtual] |
|
id Output: |
( |
id |
waver |
) |
[virtual] |
|
end end create options for task effect test with genereal linear test here we assume the user implicitly wants to test all tasks first generate glt files by calling function TaskTest m Only for regression |
( |
Run_Type |
= =2 |
) |
|
|
end end run |
( |
1 |
|
) |
[pure virtual] |
|
stimbase |
( |
i |
|
) |
= input('expression is: ', 's') |
|
Variable Documentation
Various output files from dDeconvolve Key Bethesda MD clear all |
|
while base = input('\n\nDo you want to add some covariates? (1 - yes; 0 - no) ') |
|
|
Definition at line 405 of file IndiAna.m.
Referenced by AFNI_init_warp(), B2SL_NAME(), DRAW_2D_circle(), DRAW_2D_expand(), DRAW_receiver(), EDIT_blur_volume_3d(), eval_registration(), evaluate_irc(), f__icvt(), FD_brick_to_mri(), glutSolidCone(), glutWireCone(), hbCreateDecodeTables(), IMREG_main(), main(), ncio_ffio_move(), ncio_px_move(), ncio_spx_move(), parse_int(), PCOR_get_perc(), plot_line(), printNumber(), putentries(), putpower(), rd_I(), recvDecodingTables(), wrt_I(), and wrt_IM(). |
time derivative bf = [bf D(:)] |
|
for calculating time derivative bf2 = (bf1 - spm_hrf(TR,p))/dp |
|
|
Initial value: questdlg(sprintf('Check the regressors now ...'),...
'Continue ?', 'Yes', 'No', 'No')
Definition at line 835 of file IndiAna.m. |
flag for censor file while Censor = input('\nNeed to censor any time point(s)? (0 - No; 1 - Yes): ') |
|
|
Definition at line 370 of file WriteBrik.m.
Referenced by AFNI_count_controllers(), f_file_size(), float_file_size(), hilbertdelay_V2(), Read_file(), Read_part_file_delay(), SUMA_append_replace_string(), SUMA_append_string(), SUMA_ConvexHullSurface(), SUMA_Copy_Part_Column(), SUMA_DrawnROI_to_1DDrawROI(), SUMA_EquateSurfaceSize(), SUMA_FindVoxelsInSurface(), SUMA_FindVoxelsInSurface_SLOW(), SUMA_float_file_size(), SUMA_FreeSurfer_Read_eng(), SUMA_FreeSurfer_ReadBin_eng(), SUMA_FreeSurfer_WritePatch(), SUMA_FromIntEdgeToIntEdge(), SUMA_GetEyeAxis(), SUMA_input(), SUMA_IntersectionStrip(), SUMA_isExtension(), SUMA_IV_FaceSetsextract(), SUMA_IV_XYZextract(), SUMA_LoadPrepInVol(), SUMA_MarchingCubesSurface(), SUMA_MaskDsetByClustList(), SUMA_NI_str_ar_2_comp_str(), SUMA_NodePath_to_TriPath_Inters(), SUMA_OpenDrawnROI_1D(), SUMA_Patch2Surf(), SUMA_Pattie_Volume(), SUMA_ProjectSurfaceToSphere(), SUMA_Read_dfile(), SUMA_Read_file(), SUMA_readFScurv(), SUMA_ROIv2dataset(), SUMA_ROIv2Grpdataset(), SUMA_ScaleToMap_Interactive(), SUMA_Show_SureFit(), SUMA_ShowDrawnROI(), SUMA_SureFit_Read_Coord(), SUMA_SureFit_Read_Topo(), SUMA_SurfGridIntersect(), and xdr_shorts(). |
|
Initial value: sprintf('3dcalc %s -prefix %s \\\n -expr ''%s''\n',...
input_str, Task(iT).IRFprefix, expr_str)
Definition at line 936 of file IndiAna.m. |
|
Initial value: sprintf ('3dDeconvolve %s %s %s %s %s %s %s',...
Mandatory_opt1, Mandatory_opt2, Mandatory_opt3, Mandatory_opt4, gltopt1, gltopt2, FitOpts)
Definition at line 822 of file IndiAna.m. |
end end for the refit comm_refit = sprintf('3drefit -epan %s%s', Task(iT).IRFprefix, InBrikView) |
|
|
Initial value: sprintf('waver -dt %g %s -gamb %g -gamc %g -gamd %g -peak 1 -numout %d -tstim `cat %s` > %s',...
TR, Task(iT).BasisOpt_struct(iB).opt, Task(iT).BasisOpt_struct.power, Task(iT).BasisOpt_struct.scale, ...
Task(iT).BasisOpt_struct.delay, N_TR, Task(iT).StimTime, Task(iT).Name(iB).str)
Definition at line 688 of file IndiAna.m. |
Concat_fn = sprintf('%s_concat.1D', InBrikPrefix) |
|
string length for each label switch contr = [] |
|
|
Definition at line 592 of file IndiAna.m.
Referenced by AFNI_splashup(), argsort(), copy_data(), disp_mri_imarr(), disp_range_3dmm(), disp_range_3dmm_res(), glob(), glob3(), integral_doubles(), ListDirectory(), mkscalar(), plx_TXT(), prolog(), qginv(), qginv_(), r_idisp_thd_3dim_dataset(), r_idisp_thd_datablock(), r_idisp_thd_dataxes(), r_idisp_thd_diskptr(), SUMA_FindVoxelsInSurface(), SUMA_FindVoxelsInSurface_SLOW(), SUMA_StretchToFitLeCerveau(), and thd_mask_from_brick(). |
end[err1, Task(iT).Name(1).str] = wryte3(reg1(1:N_TR), Task(iT).Name(1).str) |
|
create the junk D file fidout = fopen('junk.1D', 'w') |
|
for (iT=1:1:N_tasks) if strcmp(El(i).expr(first end end first = 1 |
|
|
Initial value: sprintf(' -fitts %s\\\n -fout -tout -full_first -bucket %s\\\n',...
fitsprefix, statprefix)
Definition at line 820 of file IndiAna.m. |
end end Use Ziad s AfniPrefix which uses RemoveExtension m = AfniPrefix (InBrik) |
|
|
Definition at line 44 of file IndiAna.m.
Referenced by array_to_matrix(), bakvec_(), balanc_(), balbak_(), bandv_(), basym(), bisect_(), bpser(), bqr_(), calc_shift(), calc_stat(), calculate_results(), calculate_ssijkm(), calculate_sum(), calloc_track(), cbabk2_(), cbal_(), cfft(), check_for_valid_inputs(), cinvit_(), cl1_fort(), cl1_solve(), cl1_solve_res(), color_init(), column_to_vector(), combak_(), comhes_(), comlr2_(), comlr_(), comqr2_(), corcol(), correlate(), cortb_(), corth_(), covcol(), csfft(), csfft_cox(), csfft_many(), csfft_print(), csfft_trigconsts(), ctcell_(), cubic_spline(), Daubechies_forward_FWT_1d(), Daubechies_forward_FWT_2d(), Daubechies_inverse_FWT_1d(), Daubechies_inverse_FWT_2d(), DC_init_im_gry(), DC_spectrum_AJJ(), DC_spectrum_ZSS(), dec_indx(), distance(), draw_grids(), E0001(), elmbak_(), elmhes_(), err__fl(), expand_array(), exparg(), ff_(), fft(), FFT_1dcx(), fill_array(), findconst(), gcd(), gratio(), grey_change(), grey_contrast(), grey_init(), gt_num(), Haar_forward_FWT_1d(), Haar_forward_FWT_2d(), Haar_inverse_FWT_1d(), Haar_inverse_FWT_2d(), Haar_ip_FFWT_1d(), Haar_ip_IFWT_1d(), hilbertdelay_V2(), hqr2_(), hqr_(), htrib3_(), htribk_(), ifft(), Ims_rot(), imtql1_(), imtql2_(), imtqlv_(), init_indep_var_matrix(), InitContext(), invit_(), jcopy_markers_setup(), legendre(), legendre_(), lmofn_(), main(), MAIN__(), make_shear_matrix(), malloc(), matrix(), matrix_create(), matrix_destroy(), matrix_enter(), matrix_file_read(), matrix_file_write(), matrix_identity(), matrix_initialize(), matrix_print(), matrix_psinv(), matrix_sprint(), matrix_sumabs(), matrix_to_niml(), MatrixMult(), max_float(), mcw_calloc(), mcw_XtCalloc(), min_float(), minfit_(), motion_fr_dmv(), mri_psinv(), mri_warp3d_align_one(), mri_watershedize(), niml_to_matrix(), orstat_(), ortbak_(), orthes_(), orthogonalise(), PCOR_get_mcor(), permute_dfvec3(), permute_dmat33(), plot_graphs(), plot_line(), plotpak_srface(), process_voxel(), psi(), Put_image(), qSort3(), qzvec_(), ratqr_(), read_comment_extension(), rebak_(), rebakb_(), Ref_im2(), report_evaluation(), report_results(), rfft(), RIC_CalcCoeffAB(), RIC_CorrectDataset(), rsm_(), s_cat(), segment_x_slices(), segment_y_slices(), segment_z_slices(), ShadeVoxel(), sort_clusters(), sort_extrema(), spmpar(), srface_(), SUMA_binTesselate(), SUMA_build_rotmatrix(), SUMA_CreateIcosahedron(), SUMA_divEdge(), SUMA_dPoint_At_Distance(), SUMA_MapSurface(), SUMA_Point_At_Distance(), SUMA_Taubin_Smooth_Coef(), SUMA_Taubin_Smooth_TransferFunc(), svd_(), svd_double(), terminate(), tinvit_(), tql1_(), tql2_(), tqli(), tqlrat_(), trbak1_(), trbak3_(), tridib_(), tsturm_(), udmatrix_copy(), udmatrix_to_vector(), VPCompAC00G(), VPCompAC11B(), VPCompAC1NB(), VPCompAC1NS(), VPCompAC1PB(), VPCompAC31B(), VPCompAC32B(), VPCompAC3NB(), VPCompAC3NS(), VPCompAC3PB(), VPCompAR00G(), VPCompAR11B(), VPCompAR1NB(), VPCompAR1NS(), VPCompAR1PB(), VPCompAR31B(), VPCompAR32B(), VPCompAR3NB(), VPCompAR3NS(), VPCompAR3PB(), vpIdentity3(), vpIdentity4(), VPLoadRotation(), VPLoadScale(), VPLoadTranslation(), vpMatrixVectorMult4(), vpShadeTable(), vpSolveSystem4(), wrt_IM(), x_events_loop(), and Xgamm(). |
while BasisOpt maxlag = input('Maximum lags (default: 0): ') |
|
There is a scale factor with MGH |
|
Right now same lags for all regressors and basis functions if BasisOpt minlag = input('Minimum lags (default: 0): ') |
|
|
Initial value: 1 there has been an option of
% -num_glt already implemented in gltopt1 above to get task effects
if (Run_Type == 1)
Definition at line 801 of file IndiAna.m. |
if run_mask N_dilate = input('How many times do you want to dilate the mask outwards? (default - 5): ') |
|
Number of runs concatenated while N_runs = input('Number of concatenated runs: ') |
|
Number of tasks conditions regressors to be tested while N_tasks = input('Number of stimuli/tasks/conditions/regressors: ') |
|
while N_TR = input('Number of TRs for the whole dataset (run 3dinfo on the dataset if you are not sure): ') |
|
next = first+El(i).strln(k)-1 |
|
|
Definition at line 552 of file IndiAna.m.
Referenced by AddBMotionBlock(), BMotionSearch(), BMotionSearchCross2(), BMotionSearchExhaust(), BMotionSearchNoInterp(), BMotionSearchSimple(), colormap_image_floyd_steinberg(), ComputeBDiffDCTs(), ComputeBMotionBlock(), ComputeBMotionLumBlock(), delete_color_transforms(), DoBIntraCode(), dsort(), eval_vertices(), expand_difference_bounds(), free_all_color_hash_items(), GenBFrame(), GIF_Add_To_Table(), Gif_DeleteStream(), glutDestroyMenu(), gmem(), MotionSufficient(), newvlist(), nextdata(), qh_allstatA(), qh_allstatI(), qh_initstatistics(), qh_mergecycle_facets(), qh_newstats(), qh_printstatistics(), qh_removefacet(), qh_removevertex(), read_ge_files(), restart(), revchain(), scan_ge_files(), simplex_initialize(), simplex_optimization(), SUMA_Extension(), SUMA_GetListNextCommand(), varadd(), varmember(), and volume_search(). |
end end Noext = RemoveExtension(Task(iT).StimTime, '.1D|.txt') |
|
|
Definition at line 591 of file IndiAna.m.
Referenced by calc_full_model(), estimate(), estimate_field(), estpdf(), estpdf_float(), estpdf_short(), form_clusters(), generate_initial_guess(), initialize_full_model(), initialize_program(), initialize_simplex(), random_search(), simplex_initialize(), simplex_optimization(), and write_parameter_vector(). |
|
Definition at line 177 of file IndiAna.m.
Referenced by AFNI_fimmer_compute(), calculate_results(), CORREL_main(), init_indep_var_matrix(), L1F_main(), L1F_worker(), LSQ_main(), LSQ_worker(), main(), output_results(), quadrant_fimfunc(), read_input_data(), report_results(), RT_fim_recurse(), spearman_fimfunc(), THD_generic_detrend(), and write_bucket_data(). |
use the convolution function in Matlab reg_f2 = conv(bf(:,2), irr_vec) |
|
run_norm = input('\nWant to normalize the dataset before running deconvolution/regression? (0 - No; 1 - Yes): ') |
|
Repition time TR in seconds while TR = input('TR (second): ') |
|
while BasisOpt tSpan = input('Total time span of all basis functions in this regressor (sec): ') |
|
vec = load(Task(iT).StimTime) |
|
|
Definition at line 598 of file IndiAna.m.
Referenced by absfft_func(), backward_solve_inplace(), calculate_results(), DC_Err(), DC_Fit(), DC_IRF(), DELAY_main(), detrend(), DSET2_func(), EXP0D_worker(), EXTRACT_main(), FIM_edit_time_series(), forward_solve_inplace(), fourier_1D(), GRA_pin_choose_CB(), hbAssignCodes(), hbCreateDecodeTables(), huber_func(), intvec_to_niml(), L1F_detrend(), L1F_fitter(), L1F_worker(), linear3_func(), log10_func(), LSQ_detrend(), LSQ_fitter(), LSQ_worker(), main(), MCW_choose_CB(), median3_func(), niml_to_intvec(), NL_error(), NL_fitter(), NL_worker(), normalize(), osfilt3_func(), PARSER_1deval(), quotize_float_vector(), quotize_int_vector(), r_idisp_vec3d(), r_idisp_vec3f(), r_idisp_vec3i(), robust_covar(), RWC_blank_time_series(), RWC_max_ts(), RWC_medfilt_time_series(), RWC_min_ts(), RWC_norm_ts(), RWC_read_time_series(), ssqrt_func(), SUMA_BinarySuck(), SUMA_BrainVoyager_Read_vmr(), SUMA_OpenDX_Read_CruiseVolHead(), UC_unusuality(), update_PCOR_references(), update_references(), WA_err(), WA_fit(), WA_fwt(), and WA_sgnl(). |
|