Skip to content

AFNI/NIfTI Server

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

Doxygen Source Code Documentation


wryte3.m File Reference

Go to the source code of this file.


Functions

n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to the function will try
to use matlab s save function
which is but writes the results
in IEEE format like e5 Not
pleasing to the eye Default
is n Note that there is no
need to use the fast option
with 
vectors (Nx1)
n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to the function will try
to use matlab s save function
which is but writes the results
in IEEE format like e5 Not
pleasing to the eye Default
is n Note that there is no
need to use the fast option
with They are written very
efficiently 
verbose (0/1)
Set the defaults if (nargin< 3)
end if (~isfield(Opt,'Space')|isempty(Opt.Space))
end if (~isfield(Opt,'OverWrite')|isempty(Opt.OverWrite))
end if (~isfield(Opt,'Fast')|isempty(Opt.Fast))
end if (~isfield(Opt,'verbose')|isempty(Opt.verbose))
end Check for bad input if (isempty(M))
end if (eq_str(Opt.Fast,'y')&eq_str(Opt.Space,','))
end ErrEval (FuncName,'Wrn_Can not run in fast mode with comma separators, will use slow mow.')
 if (filexist(Fname))
return case all cool proceed
case 
while (filexist(Fname)==1)
 ErrEval (FuncName, serr)
 if (fid==-1)
return end Write the data
switch Opt case fast mode 
if (eq_str(op,'a'))
end if (Opt.verbose)
end fprintf (1,'%s verbose:Writing%s in Fast Mode...', FuncName, Fname)
end if (eq_str(Opt.Space,'t'))
end eval (['save 'Fname 'M-ascii-tabs-append'])
 elseif (eq_str(Opt.Space,'s'))
 if (jj==1)
I can go fast on this one fprintf (1,'%s verbose:Writing%s in Efficient Mode...', FuncName, Fname)
end if (eq_str(Opt.Space,'s'))
end fprintf (fid,'%g\n', M(1:ii-1))
end fprintf (fid,'%g\t\n', M(1:ii-1))
end if (eq_str(Opt.Space,','))
end fprintf (fid,'%g,\n', M(1:ii-1))
end Now put the last value in fprintf (fid,'%g\n', M(ii))
end if (jj > 1)
end fprintf (1,'%s verbose:Writing%s in Slow Mode...', FuncName, Fname)
 for (i=1:1:ii)
 if (i==ii)
end for (j=1:1:jjtemp)
end fprintf (fid,'%g ', M(i, j))
end fprintf (fid,'%g\t', M(i, j))
end fprintf (fid,'%g,', M(i, j))
end end if (i~=ii)
end end fprintf (fid,'\n')
end end Now put the last number
in 
fprintf (fid,'%g\n', M(ii, jj))
return end fclose (fid)
 fprintf (1,'Done.\n')

Variables

 function [err, Fname]
n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to 
y
n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to the function will try
to use matlab s save function
which is 
fast
n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to the function will try
to use matlab s save function
which is but writes the results
in IEEE format like e5 Not
pleasing to the eye Default
is n Note that there is no
need to use the fast option
with They are written very
efficiently default is Output 
Parameters
n for no and p for prompting
the user for a new name You
can also use a for append
Default is n Fast If it is
set to the function will try
to use matlab s save function
which is but writes the results
in IEEE format like e5 Not
pleasing to the eye Default
is n Note that there is no
need to use the fast option
with They are written very
efficiently default is Output
unless you re prompted to
change it More 
Info
initailize return variables err = 1
 UsedName = ''
Set the defaults Opt = []
end Opt Space = 's'
end Opt OverWrite = 'n'
end Opt Fast = 'n'
end Opt verbose = 0
 return
end Do the deed Check for
filename existence 
op = 'w'
switch Opt case n
return case all cool proceed
case 
p
return case all cool proceed
case 
serr = sprintf ('Wrn_File %s exists, enter new filename:',Fname)
 Fname = input ('','s')
 end
case a
 otherwise
return end end Open file for
write operation 
fid = fopen(Fname,op)
return end Write the data
switch Opt case fast mode 
apnd = '-append'
end case slow mode [ii, jj] = size(M)
end jjtemp = jj

Function Documentation

elseif ['save ' Fname ' M -ascii -tabs -append'] eq_str(Opt.Space,'s')   ) 
 

ErrEval FuncName  ,
serr 
 

end ErrEval FuncName  ,
'Wrn_Can not run in fast mode with comma  separators,
will use slow mow.' 
 

eval  ) 
 

Referenced by ENV_init(), and main().

return end fclose fid   ) 
 

end for j  = 1:1:jjtemp  ) 
 

for = 1:1:ii  ) 
 

fprintf ,
'Done.\n
 

end end Now put the last number in fprintf fid  ,
'%g\n ,
M(ii, jj
 

end end fprintf fid  ,
'\n
 

end fprintf fid  ,
'%  g,
,
M(i, j
 

end fprintf fid  ,
'%g\t'  ,
M(i, j
 

end fprintf fid  ,
'%g ,
M(i, j
 

end fprintf ,
'%s verbose:Writing%s in Slow Mode...'  ,
FuncName  ,
Fname 
 

end Now put the last value in fprintf fid  ,
'%g\n ,
M(ii) 
 

end fprintf fid  ,
'%  g,
\n ,
M(1:ii-1) 
 

end fprintf fid  ,
'%g\t\n ,
M(1:ii-1) 
 

end fprintf fid  ,
'%g\n ,
M(1:ii-1) 
 

I can go fast on this one fprintf ,
'%s verbose:Writing%s in Efficient Mode...'  ,
FuncName  ,
Fname 
 

end fprintf ,
'%s verbose:Writing%s in Fast Mode...'  ,
FuncName  ,
Fname 
 

end end if i~  = ii  ) 
 

if = = ii  ) 
 

end if jj  ,
 

end if eq_str(Opt.Space,',')   ) 
 

end if eq_str(Opt.Space,'s')   ) 
 

if ['save ' Fname ' M -ascii -append'] jj  = =1  ) 
 

end if eq_str(Opt.Space,'t')   ) 
 

end if Opt.  verbose  ) 
 

return end Write the data switch Opt case fast mode if eq_str(op,'a')   ) 
 

if fid  = = -1  ) 
 

if filexist(Fname  ) 
 

end if eq_str(Opt.Fast,'y')&eq_str(Opt.Space,',')   ) 
 

end Check for bad input if isempty(M)   ) 
 

end if isfield(Opt,'verbose')|isempty(Opt.verbose)  ) 
 

end if isfield(Opt,'Fast')|isempty(Opt.Fast)  ) 
 

end if isfield(Opt,'OverWrite')|isempty(Opt.OverWrite)  ) 
 

end if isfield(Opt,'Space')|isempty(Opt.Space)  ) 
 

Set the defaults if  ) 
 

n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with vectors Nx1   ) 
 

n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently verbose 0/  1  ) 
 

return case all cool proceed case while filexist(Fname = = 1  ) 
 


Variable Documentation

a
 

Referenced by afi2o(), afo2i(), algdiv(), alnrel(), apply_3shear(), apply_xshear(), apply_yshear(), apply_zshear(), apser(), atype_squawk(), axis_to_quat(), B64_to_base64(), B64_to_binary(), b_char(), balanc_(), bandr_(), bandv_(), bang(), basym(), bcorr(), beta_p2t(), beta_t2p(), betaln(), bfrac(), bgrat(), bi7func(), blue_sort_compare(), bpser(), bqr_(), bratio(), brcmp1(), brcomp(), bup(), c_dfe(), c_div(), c_due(), c_le(), c_lir(), c_liw(), c_sfe(), c_si(), c_sue(), calc_glt_matrix(), calc_rcoef(), calculate_acontrasts(), calculate_adifferences(), calculate_ameans(), calculate_bcontrasts(), calculate_bdifferences(), calculate_bmeans(), calculate_ccontrasts(), calculate_cdifferences(), calculate_cmeans(), calculate_fa(), calculate_fab(), calculate_fabc(), calculate_fac(), calculate_fb(), calculate_fbc(), calculate_fc(), calculate_ss0(), calculate_ssi(), calculate_ssij(), calculate_ssijk(), calculate_ssijkm(), calculate_ssik(), calculate_ssj(), calculate_ssjk(), calculate_ssk(), calculate_sstr(), calculate_sum(), calculate_xdifferences(), calculate_xmeans(), calculate_ysum(), cdfbet(), check_for_valid_inputs(), check_temporary_files(), cmpstr(), commonprotos(), compare(), compare_SUMA_QSORTROW_FLOAT(), compare_SUMA_QSORTROW_INT(), compare_SUMA_Z_QSORT_DOUBLE(), compare_SUMA_Z_QSORT_FLOAT(), compare_SUMA_Z_QSORT_INT(), consbinop(), cpn(), Cpointer(), Cpointer_PIXWIN(), CREN_render(), cubic_spline(), cumbet(), cumchi(), cumgam(), cumnor(), cumt(), d_dim(), d_sign(), Daubechies_forward_pass_1d(), Daubechies_inverse_pass_1d(), dbc(), dbetrm(), DC_init_im_gry(), detrend(), devlpl(), dln1px(), dlnbet(), dlngam(), DMAT_svd(), DMAT_symeig(), E0001(), ef1asc_(), ef1cmc_(), EIG_func(), EIG_tsfunc(), elmbak_(), elmhes_(), eltran_(), epslon_(), eqn(), erf1(), erfc1(), EvalSpline(), f_back(), f_clos(), f_end(), f_inqu(), f_open(), f_rew(), fifdint(), fifdmax1(), fifdmin1(), fifidint(), fifmod(), find_base_value(), fix_entry_returns(), fk_open(), fpser(), free2D(), ft_xshear(), ft_yshear(), g_char(), gam1(), gaminv(), gamln(), gamln1(), get_argtypes(), get_options(), get_random_value(), getcd(), GRA_overlay_circle(), GRA_small_circle(), grat1(), gratio(), green_sort_compare(), grey_init(), gsumln(), h_dim(), h_indx(), h_mod(), h_sign(), Haar_forward_pass_1d(), Haar_ip_FFWT_1d(), hilbertdelay_V2(), hl_ge(), hl_gt(), hl_le(), hl_lt(), htrib3_(), htrid3_(), huber_aa(), I_args(), i_dim(), i_indx(), i_mod(), i_sign(), ibeta(), incbeta_inverse(), ind_printf(), initialize(), intersection_map(), InvertSym3(), invit_(), isort_double(), isort_doubleint(), isort_float(), isort_floatfloat(), isort_floatint(), isort_floatstuff(), isort_int(), isort_intint(), ISORT_NAME(), isort_pair(), isort_sh(), isort_short(), jdiv_round_up(), jround_up(), l_ge(), l_gt(), l_le(), l_lt(), lbit_bits(), lbit_cshift(), length_comp(), linear_filter_trend(), linear_reg(), lmax(), lmin(), lwrt_A(), lwrt_C(), main(), make_plot(), matrix_add(), matrix_check_columns(), matrix_copy(), matrix_equate(), matrix_extract(), matrix_extract_rows(), matrix_inverse(), matrix_inverse_dsc(), matrix_multiply(), matrix_norm(), matrix_scale(), matrix_singvals(), matrix_sqrt(), matrix_subtract(), matrix_to_niml(), matrix_transpose(), MatrixMult(), MD5Transform(), med3(), median_float4(), minfit_(), mri_rota_shear(), NI_stream_readbuf64(), NI_val_to_text(), NI_write_columns(), niml_to_matrix(), NUD_3string(), NUD_threestring(), op_gen(), ortbak_(), orthes_(), ortran_(), pentagon(), pixel_sort_compare(), PLOT_matrix_gray(), plot_ts_xypush(), PLUTO_scatterplot(), popularity_sort_compare(), pow_ci(), pow_zi(), pow_zz(), prcona(), print_ne(), probeDevices(), project_byte_mip(), putentries(), putsteq(), pythag_(), qbit_bits(), qbit_cshift(), qh_compare_facetarea(), qh_compare_facetmerge(), qh_compare_facetvisit(), qh_compare_vertexpoint(), qh_compareangle(), qh_comparemerge(), qh_comparevisit(), qmed_float(), qsort_double(), qsort_doubleint(), qsort_float(), qsort_floatfloat(), qsort_floatint(), qsort_floatstuff(), qsort_int(), qsort_intint(), QSORT_NAME(), qsort_pair(), qsort_partial_sh(), qsort_sh(), qsort_short(), qsrec_double(), qsrec_doubleint(), qsrec_float(), qsrec_floatfloat(), qsrec_floatint(), qsrec_floatstuff(), qsrec_int(), qsrec_intint(), QSREC_NAME(), qsrec_pair(), qsrec_sh(), qsrec_short(), quadrant_corr_prepare(), qzhes_(), qzit_(), qzval_(), qzvec_(), r_dim(), r_sign(), RAN_compare_vect(), rand_uniform(), rank_order_float(), rcomp(), RCREND_axis_rotmatrix(), RCREND_inc_angles(), RCREND_rotmatrix_to_angles(), Read_part_file_delay(), ReadParamFile(), readref(), red_sort_compare(), reduc2_(), reduc_(), REND_inc_angles(), REND_rotmatrix_to_angles(), Resample(), rg_(), rgg_(), RIC_CalcCoeffAB(), RIC_CorrectDataset(), rlog(), rlog1(), rs_(), rsb_(), rsg_(), rsgab_(), rsgba_(), rsm_(), rsp_(), rt_(), s_cmp(), s_copy(), s_rdfe(), s_rdue(), s_rsfe(), s_rsfi(), s_rsle(), s_rsli(), s_rsne(), s_rsni(), s_rsue(), s_wdfe(), s_wdue(), s_wsfe(), s_wsfi(), s_wsle(), s_wsli(), s_wsne(), s_wsni(), s_wsue(), SCAT_main(), shuffle(), sin_func(), sin_grad(), spearman_rank_prepare(), subskept(), subtract(), SUMA_Add_Color(), SUMA_BinaryZeroSearch(), SUMA_CalcNeighbDist(), SUMA_ColorVec_Info(), SUMA_compare_int(), SUMA_CreateIcosahedron(), SUMA_EquateSurfaceAreas(), SUMA_EquateSurfaceSize(), SUMA_EquateSurfaceVolumes(), SUMA_free2D(), SUMA_GetAreaDiffRange(), SUMA_getoffsets2(), SUMA_getoffsets_ll(), SUMA_GetVolDiffRange(), SUMA_input(), SUMA_iRGB_to_OverlayPointer(), SUMA_Mesh_Area(), SUMA_ProjectSurfaceToSphere(), SUMA_Reposition_Touchup(), SUMA_StretchToFitLeCerveau(), SUMA_Subdivide_Mesh(), SUMA_Suggest_Touchup(), SUMA_Suggest_Touchup_Grad(), SUMA_TriSurf3v(), svd_(), svd_double(), symeig_double(), symeigval_double(), t_runc(), terminate(), THD_insert_series(), tnonc_s2p(), trackball(), trackball_Phi(), trbak1_(), trbak3_(), tred1_(), tred2(), tred2_(), tred3_(), type_fixup(), vector_add(), vector_dot(), vector_dotself(), vector_equate(), vector_multiply(), vector_multiply_subtract(), vector_subtract(), Vpointer(), vpShadeTable(), vpSolveSystem4(), w3dMRI_affine(), w3dMRI_scaler(), warp3D_sharm2(), warp3D_sharm3(), wrt_H(), x_rsne(), x_wsne(), Xgamm(), z_div(), and zdiv().

else apnd = '-append'
 

Definition at line 110 of file wryte3.m.

end
 

Definition at line 91 of file wryte3.m.

end err = 1
 

Definition at line 163 of file wryte3.m.

return end Write the data switch Opt Fast = 'n'
 

Definition at line 106 of file wryte3.m.

n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is fast
 

Definition at line 1 of file wryte3.m.

return end end Open file for write operation fid = fopen(Fname,op)
 

Definition at line 100 of file wryte3.m.

Fname = input ('','s')
 

Definition at line 90 of file wryte3.m.

function[err, Fname]
 

Initial value:

 wryte3 (M,Fname,Opt)
%
%   [err,UsedName] = wryte3 (M,Fname,[Opt])
%
%Purpose:
%   Write matrix M to a text file 
%   
%   
%Input Parameters:
%   M : NxK matrix
%   Fname : string containing the file name to write the matrix to
%   Opt is an optional structure with the following fields
%     .Space string specifying whether to use a space character 's' or 
%             a tab 't' or a comma ',' between numbers on the same line.
%             The default is 's'. There won't be a comma after the last number.
%     .OverWrite specifies whether you want to allow for overwrite
%          Options are 'y' for yes

Definition at line 1 of file wryte3.m.

n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently default is Output unless you re prompted to change it More Info
 

Definition at line 33 of file wryte3.m.

jjtemp = jj
 

Definition at line 141 of file wryte3.m.

end case slow mode[ii, jj] = size(M)
 

Definition at line 122 of file wryte3.m.

Referenced by __glutGetVisualInfo(), AddBMotionBlock(), AFNI_process_drawing(), AFNI_process_setup(), ART_open_afni_link(), cfft(), cfft2d(), checkOverlayAcceptability(), COMPRESS_has_suffix(), ComputeBDiffDCTs(), ComputeBMotionBlock(), ComputeBMotionLumBlock(), csfft(), csfft_cox(), csfft_many(), dlopen(), DoBIntraCode(), DRAW_receiver(), drive_MCW_imseq(), EDT_calcmask(), fft128(), fft16(), fft256(), fft32(), fft512(), fft64(), fft8(), FFT_1dcx(), fft_3dec(), fft_4dec(), fft_5dec(), float_list_comp_mode(), GenBFrame(), get_dfile_params(), getOverlayVisualInfo(), getOverlayVisualInfoCI(), getVisualInfoCI(), getVisualInfoRGB(), iochan_init(), main(), MCW_choose_multi_editable_strlist(), MCW_choose_multi_strlist(), MotionSufficient(), MREN_set_precalculation(), mri_fft2D(), mri_fft_complex(), mri_multiply_complex(), mri_rota_variable(), mri_warp3D_method(), ncopen(), NI_stream_open(), NIH_find_clusters(), NUD_rotate(), open_file(), opf(), PLUTO_dset_redisplay_mode(), resam_str2mode(), RT_fim_recurse(), RT_tell_afni(), RT_tell_afni_one(), SHIFT_set_method(), SHM_init(), SUMA_ColMixModeString(), and THD_rota_method().

end case n
 

Definition at line 120 of file wryte3.m.

case op = 'w'
 

Definition at line 93 of file wryte3.m.

Referenced by cktype(), do_fio(), exar2(), intrcall(), krput(), NC_var_shape(), out_call(), putmnmx(), SUMA_AddDO(), SUMA_AdvancePastNumbers(), SUMA_OpenDx_Object_Attr(), SUMA_OpenDx_Object_Components(), SUMA_OpenDx_Object_Data(), SUMA_OpenDx_Object_Header_Field(), SUMA_OpenDX_Read(), and SUMA_RemoveDO().

Set the defaults Opt = []
 

Definition at line 50 of file wryte3.m.

end otherwise
 

Definition at line 155 of file wryte3.m.

switch Opt OverWrite = 'n'
 

Definition at line 80 of file wryte3.m.

return case all cool proceed case p
 

Definition at line 84 of file wryte3.m.

n for no and p for prompting the user for a new name You can also use a for append Default is n Fast If it is set to the function will try to use matlab s save function which is but writes the results in IEEE format like e5 Not pleasing to the eye Default is n Note that there is no need to use the fast option with They are written very efficiently default is Output Parameters
 

Definition at line 33 of file wryte3.m.

return
 

Definition at line 164 of file wryte3.m.

return case all cool proceed case serr = sprintf ('Wrn_File %s exists, enter new filename:',Fname)
 

Definition at line 88 of file wryte3.m.

end Opt Space = 's'
 

Definition at line 53 of file wryte3.m.

UsedName = ''
 

Definition at line 47 of file wryte3.m.

Referenced by SUMA_Addto_ROIplane_List().

end Opt verbose = 0
 

Definition at line 65 of file wryte3.m.

return end Write the data switch Opt case y
 

Definition at line 106 of file wryte3.m.

 

Powered by Plone

This site conforms to the following standards: