Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Norm.m File Reference

Go to the source code of this file.


Functions

Originally dClipLevel was
used to generate a cliplevel
for each then a step function
chops off those voxel outside
of the brain But due to the
concern of losing the sensitive
amygdala and orbitofrontal
it might be better to run
which is roughly equivalent
to dClipLevel but would protect
amygdala and orbitofrontal
cortex regions from being
masked create command for
executing dAutomask 
if (run_mask.do==1)
 fprintf (2, '\nRunning:%s\n', automask)
 fprintf (foutid_log, '%s\n', automask)
 if (s)
 fprintf (2,'Error during 3dAutomask:\n\n%s\n\n', w)
 while (1)
 fprintf (2,'Halted:Ctrl+c to exit')
If no do masking if (run_norm==0)
 fprintf (2, '\nRunning:%s\n', mask_signal)
 fprintf (foutid_log, '%s\n', mask_signal)
 fprintf (2,'Error during 3dcalc:\n\n%s\n\n', w)
 for (i=1:1:N_runs)
 fprintf (2, '\nRunning:%s\n', get_mean)
 fprintf (foutid_log, '%s\n', get_mean)
 fprintf (2,'Error at running 3dTstat:\n\n\n%s\n', w)
 fprintf (2, '\nRunning:%s\n', norm_signal)
 fprintf (foutid_log, '%s\n', norm_signal)
end Concatenate all runs back
together 
fprintf (2, '\nRunning:%s\n', concat)
 fprintf (foutid_log, '%s\n', concat)
 fprintf (2,'Error during running 3dTcat:\n\n%s\n\n', w)
end end end Don t forget to
remove those temporary files
above 
fprintf (2, '\nRemoving:%s\n', rm_cmmd)
 fprintf (foutid_log, '%s\n', rm_cmmd)
 fprintf (2,'Error during rm:\n\n%s\n\n', w)

Variables

 function [err, out_fn]
Bethesda Maryland Define the
function name for easy referencing 
FuncName = 'Norm'
Debug Flag DBG = 1
initailize return variables err = 1
 rm_cmmd = AfniPrefix (InBrik) 'rm -f '
Originally dClipLevel was
used to generate a cliplevel
for each 
run
Originally dClipLevel was
used to generate a cliplevel
for each then a step function
chops off those voxel outside
of the brain But due to the
concern of losing the sensitive
amygdala and orbitofrontal 
cortex
Originally dClipLevel was
used to generate a cliplevel
for each then a step function
chops off those voxel outside
of the brain But due to the
concern of losing the sensitive
amygdala and orbitofrontal
it might be better to run 
dAutomask
Originally dClipLevel was
used to generate a cliplevel
for each then a step function
chops off those voxel outside
of the brain But due to the
concern of losing the sensitive
amygdala and orbitofrontal
it might be better to run
which is roughly equivalent
to dClipLevel but would protect
amygdala and orbitofrontal
cortex regions from being
masked create command for
executing dAutomask 
automask_fn = sprintf('%s_msk', InBrikPrefix)
 automask = sprintf('3dAutomask -dilate %i -prefix %s %s%s', run_mask.N_dilate, automask_fn, InBrikPrefix, InBrikView)
 pause
If no normalization
If no do masking out_fn = sprintf('%s_mask', InBrikPrefix)
 mask_signal = sprintf('3dcalc -fscale -a %s%s \\\n', InBrikPrefix, InBrikView)
 concat = sprintf('3dTcat -prefix %s ', out_fn)
store each mean dataset in
a temporary 
file
store each mean dataset in
a temporary and delete it
before leaving this function 
mean_fn = sprintf('%s_mean%i', InBrikPrefix, i)
 get_mean = sprintf('3dTstat -mean -prefix %s %s%s''[%i..%i]''', mean_fn, InBrikPrefix, InBrikView, run(i).first, run(i).last)
end end normalizing norm_signal = sprintf('3dcalc -datum float -a %s%s''[%i..%i]'' \\\n', InBrikPrefix, InBrikView, run(i).first, run(i).last)
end norm_out_fn = sprintf('%s_norm%i', InBrikPrefix, i)
 return

Function Documentation

for = 1:1:N_runs  ) 
 

fprintf ,
'Error during rm:\n\n%s\n\n ,
 

fprintf foutid_log  ,
'%s\n ,
rm_cmmd 
 

end end end Don t forget to remove those temporary files above fprintf ,
'\nRemoving:%s\n ,
rm_cmmd 
 

fprintf ,
'Error during running 3dTcat:\n\n%s\n\n ,
 

fprintf foutid_log  ,
'%s\n ,
concat 
 

end Concatenate all runs back together fprintf ,
'\nRunning:%s\n ,
concat 
 

fprintf foutid_log  ,
'%s\n ,
norm_signal 
 

fprintf ,
'\nRunning:%s\n ,
norm_signal 
 

fprintf ,
'Error at running 3dTstat:\n\n\n%s\n ,
 

fprintf foutid_log  ,
'%s\n ,
get_mean 
 

fprintf ,
'\nRunning:%s\n ,
get_mean 
 

fprintf ,
'Error during 3dcalc:\n\n%s\n\n ,
 

fprintf foutid_log  ,
'%s\n ,
mask_signal 
 

fprintf ,
'\nRunning:%s\n ,
mask_signal 
 

fprintf ,
'Halted:Ctrl+c to exit' 
 

fprintf ,
'Error during 3dAutomask:\n\n%s\n\n ,
 

fprintf foutid_log  ,
'%s\n ,
automask 
 

fprintf ,
'\nRunning:%s\n ,
automask 
 

If no do masking if run_norm  = = 0  ) 
 

if  ) 
 

Originally dClipLevel was used to generate a cliplevel for each then a step function chops off those voxel outside of the brain But due to the concern of losing the sensitive amygdala and orbitofrontal it might be better to run which is roughly equivalent to dClipLevel but would protect amygdala and orbitofrontal cortex regions from being masked create command for executing dAutomask if run_mask.  do = = 1  ) 
 

while  ) 
 


Variable Documentation

automask = sprintf('3dAutomask -dilate %i -prefix %s %s%s', run_mask.N_dilate, automask_fn, InBrikPrefix, InBrikView)
 

Definition at line 53 of file Norm.m.

Referenced by main().

Originally dClipLevel was used to generate a cliplevel for each then a step function chops off those voxel outside of the brain But due to the concern of losing the sensitive amygdala and orbitofrontal it might be better to run which is roughly equivalent to dClipLevel but would protect amygdala and orbitofrontal cortex regions from being masked create command for executing dAutomask automask_fn = sprintf('%s_msk', InBrikPrefix)
 

Definition at line 52 of file Norm.m.

end end Concatenate the above files together concat = sprintf('3dTcat -prefix %s ', out_fn)
 

Definition at line 119 of file Norm.m.

Originally dClipLevel was used to generate a cliplevel for each then a step function chops off those voxel outside of the brain But due to the concern of losing the sensitive amygdala and orbitofrontal cortex
 

Definition at line 43 of file Norm.m.

Originally dClipLevel was used to generate a cliplevel for each then a step function chops off those voxel outside of the brain But due to the concern of losing the sensitive amygdala and orbitofrontal it might be better to run dAutomask
 

Definition at line 43 of file Norm.m.

Debug Flag DBG = 1
 

Definition at line 35 of file Norm.m.

end end err = 1
 

Definition at line 145 of file Norm.m.

store each mean dataset in a temporary file
 

Definition at line 87 of file Norm.m.

Bethesda Maryland Define the function name for easy referencing FuncName = 'Norm'
 

Definition at line 32 of file Norm.m.

function[err, out_fn]
 

Initial value:

 Norm (InBrik, N_runs, run, run_norm, run_mask, foutid_log)
%
%   [err, norm_fn] = Norm(InBrik, N_runs, run)
%
%Purpose:
%   
%   Normalize the original dataset so that the beta values in 3dDeconvolve would be automatically percent signal change.
%   
%Input Parameters:
%   
%   
%   
%Output Parameters:
%   err : 0 No Problem
%       : 1  Problems
%   
%   
%      
%Key Terms:
%   
%More Info :
%   
%   
%   
%
%     Author : Gang Chen
%     Date : Mon Oct 20 11:26:38 EDT 2003
%     SSCC/NIMH/ National Institutes of Health

Definition at line 1 of file Norm.m.

get_mean = sprintf('3dTstat -mean -prefix %s %s%s''[%i..%i]''', mean_fn, InBrikPrefix, InBrikView, run(i).first, run(i).last)
 

Definition at line 89 of file Norm.m.

mask_signal = sprintf('3dcalc -fscale -a %s%s \\\n', InBrikPrefix, InBrikView)
 

Definition at line 69 of file Norm.m.

store each mean dataset in a temporary and delete it before leaving this function mean_fn = sprintf('%s_mean%i', InBrikPrefix, i)
 

Definition at line 88 of file Norm.m.

end norm_out_fn = sprintf('%s_norm%i', InBrikPrefix, i)
 

Definition at line 108 of file Norm.m.

else norm_signal = sprintf('3dcalc -datum float -a %s%s''[%i..%i]'' \\\n', InBrikPrefix, InBrikView, run(i).first, run(i).last)
 

Definition at line 106 of file Norm.m.

If no normalization
 

Definition at line 63 of file Norm.m.

end for normalization out_fn = sprintf('%s_mask', InBrikPrefix)
 

Definition at line 82 of file Norm.m.

pause
 

Definition at line 142 of file Norm.m.

return
 

Definition at line 146 of file Norm.m.

create remove command for deleting those individual percent signal change and mean file for each run rm_cmmd = AfniPrefix (InBrik) 'rm -f '
 

Definition at line 122 of file Norm.m.

Originally dClipLevel was used to generate a cliplevel for each run
 

Definition at line 43 of file Norm.m.

 

Powered by Plone

This site conforms to the following standards: