Skip to content

AFNI/NIfTI Server

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

Doxygen Source Code Documentation


WriteBrikHEAD.m File Reference

Go to the source code of this file.


Functions

cleanup fields generated by
BrikInfo that are irrelevant
to AFNI 
if (isfield(Info, 'RootName'))
end if (isfield(Info, 'TypeName'))
end if (isfield(Info, 'TypeBytes'))
end if (isfield(Info, 'ByteOrder'))
end if (isfield(Info, 'Orientation'))
end if (isfield(Info, ''))
end reset the you ll create
one here 
if (isfield(Info, 'IDCODE_STRING'))
 if (fidout< 0)
 errordlg (ErrMessage)
 for (i=1:1:Fld_num)
 switch (RulesType)
ischar(Fld_Val Fld_isstrn ()
 elseif (isstruct(Fld_Val))
 elseif (isint(Fld_Val))
end write them out fprintf (fidout,'\ntype=%s\n', Fld_Type)
 fprintf (fidout,'name=%s\n', Fld_Name)
 fprintf (fidout,'count=%g\n', Fld_Count)
 if (Fld_isstrn)
 fprintf (fidout,'%s\n', stmp)
print out values per line fprintf (fidout, '\t%g\t%g\t%g\t%g\t%g\n', Fld_Val)
 if (rem(npts, 5))
 fprintf (fidout,'\n')
end end end fclose (fidout)

Variables

 function [err, ErrMessage]
a structure detailed in function
BrikInfo Output 
Parameters
a structure detailed in function
BrikInfo Output or 
warning
a structure detailed in function
BrikInfo Output or but be
neat it won t hurt The fields
generated by BrikInfo are
removed here see the files 
BrikInfo
a structure detailed in function
BrikInfo Output or but be
neat it won t hurt The fields
generated by BrikInfo are
removed here see the files 
CheckBrikHEAD
a structure detailed in function
BrikInfo Output or but be
neat it won t hurt The fields
generated by BrikInfo are
removed here see the files
WriteBrik 
NOTE
a structure detailed in function
BrikInfo Output or but be
neat it won t hurt The fields
generated by BrikInfo are
removed here see the files
WriteBrik there is no option
to replace a certain field
The entire HEAD is rewritten
each time version 
Author
a structure detailed in function
BrikInfo Output or but be
neat it won t hurt The fields
generated by BrikInfo are
removed here see the files
WriteBrik there is no option
to replace a certain field
The entire HEAD is rewritten
each time version Bethesda
Maryland 
FUNCTION_VERSION = 'V2.0'
Define the function name for
easy referencing 
FuncName = 'WriteBrikHEAD'
Debug Flag DBG = 1
 Csep = filesep
initailize return variables err = 1
 ErrMessage = ''
cleanup fields generated by
BrikInfo that are irrelevant
to AFNI 
Info = rmfield(Info,'RootName')
end reset the IDcode
end reset the eventually
end setup a new date Info IDCODE_DATE = datestr(now,0)
add the generating code version
Info 
GEN_SOURCE = sprintf('WriteBrik matlab library functions %s (please report bugs to ziad@nih.gov)', FUNCTION_VERSION)
 fidout = fopen(FileName, 'w')
 return
end Fld_Allnames = fieldnames(Info)
 Fld_num = size(Fld_Allnames,1)
 Fld_Name = char(Fld_Allnames(i))
 Fld_Val = getfield(Info, Fld_Name)
 Fld_isstrn = 0
 RulesType = HEAD_Rules(Fld_Name) Rules.isNum
 Fld_Type = 'string-attribute'
 Fld_Count = length(Fld_Val)+1
end case
 otherwise
string to write out
string to write do what Bob
seems to do 
stmp = sprintf('''%s~',Fld_Val)
else write out five values per line
else write out five values
per if field is
matrix
else write out five values
per if field is a reshape
it to a Nx1 vector 
nsz = size(Fld_Val)
 npts = nsz(1).*nsz(2)

Function Documentation

elseif isint(Fld_Val  ) 
 

elseif isstruct(Fld_Val  ) 
 

errordlg ErrMessage   ) 
 

end end end fclose fidout   ) 
 

ischar(Fld_Val Fld_isstrn  )  [virtual]
 

for = 1:1:Fld_num  ) 
 

fprintf fidout  ,
'\n
 

print out values per line fprintf fidout  ,
'\t%g\t%g\t%g\t%g\t%g\n ,
Fld_Val 
 

fprintf fidout  ,
'%s\n ,
stmp 
 

fprintf fidout  ,
count = %g\n',
Fld_Count 
 

fprintf fidout  ,
name = %s\n',
Fld_Name 
 

end write them out fprintf fidout  ,
'\  ntype = %s\n',
Fld_Type 
 

if rem(npts, 5)   ) 
 

if Fld_isstrn   ) 
 

if  ) 
 

end reset the you ll create one here if isfield(Info, 'IDCODE_STRING')   ) 
 

end if isfield(Info, '')   ) 
 

end if isfield(Info, 'Orientation')   ) 
 

end if isfield(Info, 'ByteOrder')   ) 
 

end if isfield(Info, 'TypeBytes')   ) 
 

end if isfield(Info, 'TypeName')   ) 
 

cleanup fields generated by BrikInfo that are irrelevant to AFNI if isfield(Info, 'RootName')   ) 
 

switch RulesType   ) 
 


Variable Documentation

a structure detailed in function BrikInfo Output or but be neat it won t hurt The fields generated by BrikInfo are removed here see the files WriteBrik there is no option to replace a certain field The entire HEAD is rewritten each time version Author
 

Definition at line 1 of file WriteBrikHEAD.m.

a structure detailed in function BrikInfo Output or but be neat it won t hurt The fields generated by BrikInfo are removed here see the files BrikInfo
 

Definition at line 1 of file WriteBrikHEAD.m.

case
 

Definition at line 133 of file WriteBrikHEAD.m.

a structure detailed in function BrikInfo Output or but be neat it won t hurt The fields generated by BrikInfo are removed here see the files CheckBrikHEAD
 

Definition at line 1 of file WriteBrikHEAD.m.

Csep = filesep
 

Definition at line 60 of file WriteBrikHEAD.m.

Debug Flag DBG = 1
 

Definition at line 59 of file WriteBrikHEAD.m.

err = 1
 

Definition at line 161 of file WriteBrikHEAD.m.

ErrMessage = ''
 

Definition at line 138 of file WriteBrikHEAD.m.

end reset the eventually
 

Definition at line 75 of file WriteBrikHEAD.m.

fidout = fopen(FileName, 'w')
 

Definition at line 87 of file WriteBrikHEAD.m.

end Fld_Allnames = fieldnames(Info)
 

Definition at line 92 of file WriteBrikHEAD.m.

Fld_Count = length(Fld_Val)+1
 

Definition at line 136 of file WriteBrikHEAD.m.

end char tis a string Fld_isstrn = 0
 

Definition at line 125 of file WriteBrikHEAD.m.

Fld_Name = char(Fld_Allnames(i))
 

Definition at line 96 of file WriteBrikHEAD.m.

Fld_num = size(Fld_Allnames,1)
 

Definition at line 93 of file WriteBrikHEAD.m.

float tis a float Fld_Type = 'string-attribute'
 

Definition at line 135 of file WriteBrikHEAD.m.

Fld_Val = getfield(Info, Fld_Name)
 

Definition at line 152 of file WriteBrikHEAD.m.

Define the function name for easy referencing FuncName = 'WriteBrikHEAD'
 

Definition at line 56 of file WriteBrikHEAD.m.

function[err, ErrMessage]
 

Initial value:

 WriteBrikHEAD (FileName, Info)
%
%   [err, ErrMessage] = WriteBrikHEAD (FnameHEAD, Info)
%
%Purpose:
%   Create the header file for an AFNI Brik
%   
%   
%Input Parameters:
%   FnameHEAD the name of the header file
%   Info

Definition at line 1 of file WriteBrikHEAD.m.

a structure detailed in function BrikInfo Output or but be neat it won t hurt The fields generated by BrikInfo are removed here see the files WriteBrik there is no option to replace a certain field The entire HEAD is rewritten each time version Bethesda Maryland FUNCTION_VERSION = 'V2.0'
 

Definition at line 53 of file WriteBrikHEAD.m.

add the generating code version Info GEN_SOURCE = sprintf('WriteBrik matlab library functions %s (please report bugs to ziad@nih.gov)', FUNCTION_VERSION)
 

Definition at line 84 of file WriteBrikHEAD.m.

end reset the IDcode
 

Definition at line 75 of file WriteBrikHEAD.m.

end setup a new date Info IDCODE_DATE = datestr(now,0)
 

Definition at line 81 of file WriteBrikHEAD.m.

end reset the you ll create one here Info = rmfield(Info,'RootName')
 

Definition at line 77 of file WriteBrikHEAD.m.

else write out five values per line
 

Definition at line 149 of file WriteBrikHEAD.m.

else write out five values per if field is a matrix
 

Definition at line 149 of file WriteBrikHEAD.m.

a structure detailed in function BrikInfo Output or but be neat it won t hurt The fields generated by BrikInfo are removed here see the files WriteBrik NOTE
 

Definition at line 1 of file WriteBrikHEAD.m.

npts = nsz(1).*nsz(2)
 

Definition at line 151 of file WriteBrikHEAD.m.

Referenced by AFNI_process_drawing(), AFNI_seq_send_CB(), autocorr(), ComputeJ(), ComputeWtfactors(), Daubechies_forward_FWT_1d(), Daubechies_forward_FWT_2d(), Daubechies_forward_pass_1d(), Daubechies_forward_pass_2d(), Daubechies_inverse_FWT_1d(), Daubechies_inverse_FWT_2d(), Daubechies_inverse_pass_1d(), Daubechies_inverse_pass_2d(), DELAY_tsfuncV2(), DTtoDWI_tsfunc(), DWI_AFNI_update_graph(), DWI_NIML_create_newgraph(), DWItoDT_tsfunc(), EDIT_filter_volume(), EIG_tsfunc(), EXTRACT_tsfunc(), Haar_forward_FWT_1d(), Haar_forward_FWT_2d(), Haar_forward_pass_1d(), Haar_forward_pass_2d(), Haar_inverse_FWT_1d(), Haar_inverse_FWT_2d(), Haar_inverse_pass_1d(), Haar_inverse_pass_2d(), InitGlobals(), InitWtfactors(), is_vect_null(), main(), Max_func(), PDF_float_range(), PDF_float_to_pdf(), PDF_short_range(), PDF_short_to_pdf(), Restore_Computations(), STATS_tsfunc(), Store_Computations(), ts_fprint(), and ts_print().

else write out five values per if field is a reshape it to a Nx1 vector nsz = size(Fld_Val)
 

Definition at line 151 of file WriteBrikHEAD.m.

Referenced by THD_mask_fillin_once().

otherwise
 

Definition at line 137 of file WriteBrikHEAD.m.

string to write out
 

Definition at line 145 of file WriteBrikHEAD.m.

Referenced by alloc_link_liteClue_context(), alloc_liteClue_context(), B2SL_NAME(), convert1(), dir_expansion_form(), DLSQ_affine(), DLSQ_rot_trans(), DLSQ_rotscl(), DMAT_pow(), DMAT_svd(), DMAT_svdrot_old(), DMAT_symeig(), init_error_limit(), main(), Make_RGB_lookup(), merge_and_write_frames(), mp_quant_block(), mp_quant_zig_block(), mp_rle_huff_block(), mp_rle_huff_pblock(), Mpost_QuantZigBlock(), Mpost_RLEHuffIBlock(), Mpost_RLEHuffPBlock(), Mpost_UnQuantZigBlock(), Mpost_UnQuantZigBlockLaplace(), NC_var_shape(), quotize_float_vector(), quotize_int_vector(), quotize_string(), quotize_string_vector(), SUMA_ReportDrawnROIDatumLength(), SUMA_Show_CommonFields(), SUMA_Show_NI_str_ar(), SUMA_Show_OpenDX_Struct(), SUMA_Show_SO_map(), SUMA_ShowBrushStroke(), SUMA_ShowDrawnROI(), SUMA_ShowDrawnROIDatum(), SUMA_ShowDset(), THD_rotcom_to_matvec(), and UnQuantZig().

a structure detailed in function BrikInfo Output Parameters
 

Definition at line 1 of file WriteBrikHEAD.m.

return
 

Definition at line 163 of file WriteBrikHEAD.m.

RulesType = HEAD_Rules(Fld_Name) Rules.isNum
 

Definition at line 100 of file WriteBrikHEAD.m.

string to write do what Bob seems to do stmp = sprintf('''%s~',Fld_Val)
 

Definition at line 146 of file WriteBrikHEAD.m.

a structure detailed in function BrikInfo Output or warning
 

Definition at line 1 of file WriteBrikHEAD.m.

Referenced by colormap_diversity(), colormap_median_cut(), find_background(), input_stream(), merge_colormap_if_possible(), new_viewer(), parse_geometry(), pipe_color_transformer(), print_useless_options(), read_colormap_file(), and redundant_option_warning().

 

Powered by Plone

This site conforms to the following standards: