Skip to content

AFNI/NIfTI Server

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

Doxygen Source Code Documentation


PreProc.m File Reference

Go to the source code of this file.


Functions

 if (size(gj, 1)==1)
end if (size(gj, 1)~=n) error('Factor%d must have%d elements.'
end if (ischar(gj))
 if (unbalanced.yes==0)
Create index vector from a
grouping so that 
gnj (gij) reproduces gj nlevels
levels for this factor dfvar (j)
D F for this factor balanced if (cov.do &j==cov.marker) gdum
 array (1Xnlevels) of one ones
end end if(unbalanced.yes==0)
Number of 
rows (1st dimension) in termlist[sterms
length of each term (number of columns)%randomterm
variable name tm (varnum)=0
combine G into term dummy
vars Construct the term name
and constraints matrix 
if (ismember(varnum, NF)&cov.do)
combine G into term dummy
vars Construct the term name
and constraints matrix for
the which is the last factor 
if (ismember(varnum, cov.marker)&cov.do)
end if (isempty(tn)) tn
 kron (eye(length(vconstr)), tconstr)]
and no others if (length(oldtm) > 0) k
 kron (eye(size(tconstr, 2)), oconstr)]
 termlength (sindex(j), 1)
 dfterm0 (sj)
 dmat (:, clist)
 cmat (cbase+1:cbase+nC, clist)
 termname (clist)
get model without this term dfw (1:nterms)
sum of all the elements along
nd 
dimension (row)[stermsize
 sindices (:)]
end which is voxel independent s (length(sindices)).Qdt
end if dfboth (k0)~
 dfw (k)
 dfwo (k)
 dfboth (nterms+k)=0
residual degrees of freedom if (Contr.do==1)
residual degrees of freedom
In design matrix the first
column is all one for the
total mean Then there are
totally 
FL (1).N_level+FL(2).N_level+FL(3).N_level+FL(4).N_level columns for the main effects.%Next 2nd order interactions
the st column is for grand mean (0 order) num_col(1)=0
 for (i=1:1:NF)
 num_col (1)
 if (NF > 1)
 num_col (2)=0 = num_col(2) + FL(i).N_level*FL(j).N_level
 for (j=(i+1):1:NF)
Columns for nd order interactions
end end end 
if (NF > 2)
Columns for nd order interactions
end end end 
num_col (3)=0 = num_col(3) + FL(i).N_level*FL(j).N_level*FL(k).N_level
 for (k=(j+1):1:NF)
Columns for rd order interactions
end end end end 
if (NF==4)
Columns for rd order interactions
end end end end 
num_col (4) = num_col(4)*FL(i).N_level
Columns for th order interactions
end end for every design 
if (Contr.ord1.tot > 0)
end if (Contr1.tot > 0) if(NF > 1 &Contr.ord2.tot > 0)
end if (Contr2.tot > 0) if(NF > 2 &Contr.ord3.tot > 0)
end if (Contr3.tot > 0) if(NF > 3 &Contr.ord4.tot > 0)

Variables

 function [err, Qd, s, termname, nterms, sindices, dfbothSS, modw, modwo, tnames, dfterm, dfe, Contr]
Bethesda MD Define the function
name for easy referencing 
FuncName = 'PreProc.m'
Debug Flag DBG = 1
initailize return variables err = 1
Don t worry about NaN s at
this point 
group = group(:)
what s it for ng = length(group)
number of factors termlist = makemodel(ng, ng)
Generate terms for all main
effects plus various interactions
for 
j
 gj = gj(:)
end n
end gdum = cell(ng,1)
 dfvar = zeros(ng,1)
Balanced designs vconstr = cell(ng,1)
 vmean = cell(ng,1)
Create index vector from a
grouping 
variable = grp2idx(gj)
D F
end end if(unbalanced.yes==0)
Number of 
sindex = sortrows(termlist)
Sort terms in ascending order ncols = 1
 nconstr = 0
 termdum = cell(nterms, 1)
cell array of dummy variables
which are design matrix cols 
termconstr = cell(nterms,1)
constraints to make each term
well defined 
levelcodes = cell(nterms, 1)
codes for levels of each M row tnames = cell(nterms, 1)
name for entire term = QRDecom(X, C)
name for entire e g A *B dfterm0 = zeros(nterms, 1)
nominal d f for each term termvars = cell(nterms, 1)
list of vars in each term termlength = zeros(size(sindex))
 tm = sterms(j,:)
 tdum = []
empty term so far tconstr = 1
empty constraints so far tn = ''
blank name so far vars = find(tm)
Find indices of nonzero elements
for 
varidx
term without this variable df0 = df0 * dfvar(varnum)
d f so far Combine its dummy
variable with the part computed
so far 
G = gdum{varnum}
dummy vars for this grouping
var 
nlevterm = size(tdum,2)
levels for term so far nlevgrp = size(G,2)
combine G into term dummy
vars Construct the term name
and constraints matrix for
the 
covariate
Kronecker end If the rest
of this term is 
computed
Kronecker end If the rest
of this term is take advantage
of that 
prevterms = sterms(1:j-1,:)
 oldtm = find((prevterms * tm') == sum(tm))
 oconstr = termconstr{k}
 break
end end Store this term s
dummy variables and name 
k = size(tdum, 2)
 sj = sindex(j)
Create the full design matrix dmat = ones(n, ncols)
to hold design matrix of nXncols cmat = zeros(nconstr,ncols)
to hold constraints matrix cbase = 0
base from which to fill in
cmat 
termname = zeros(ncols,1)
 termstart = cumsum([2; termlength(1:end-1)])
 termend = termstart + termlength - 1
 C = termconstr{j}
 nC = size(C,1)
 end [err, Qd, dfx, dmat2] = QRDecom(dmat, cmat)
 dfe = n - dfx
Determine which models to
compare for testing each term 
ssw = -ones(nterms, 1)
sum of squares with this term sswo = ssw
sum of squares without this
term 
dfw = ssw
residual d f with this term dfwo = ssw
locations of model with all
terms else Only apply type
III for sums of squares 
modw = ones(nterms)
 TnotC = termsnotcontained(termlist)
get model with this term modwo = logical(modw - eye(nterms))
Fit each model separately dfboth = [dfw
 dfbothSS = dfboth
For usage in ss m Consider
interactions before their
components for type 
ss
else termsize = sum(termlist,2)'
sum of all the elements along
nd 
sindices = sort(termsize)
sort in ascending order
sort in ascending output is
stored in 
stermsize
Look in unsorted arrays to
see if we have already fit
this model if j nterms 
k0 = k+nterms
else thismod = modw(k, :)
end Get the design matrix
for this model 
keepterms = find(thismod)
 clist = ismember(termname, [0 keepterms])
 X = dmat2(:,clist)
Use these results for each
term that requires them 
mod0 = repmat(thismod, nterms, 1)
end clear mod0 dfterm = dfw - dfwo
residual degrees of freedom
In design matrix the first
column is all one 
s
residual degrees of freedom
In design matrix the first
column is all one for the
total mean Then there are
totally rd order 
interaction
residual degrees of freedom
In design matrix the first
column is all one for the
total mean Then there are
totally rd order and th order
interactions Store only those
mean columns in design matrix 
num_col0 = 1
end Ignore st col since it
is total mean 
dmat_mean = dmat(:, (num_col0 + 1):(num_col0 + num_col(1)))
Get the number in the sum
for each 
mean
Get the number in the sum
for each which happens to
be in the diagonal of X X
This can also be otained through
the user input 
variables
Get the number in the sum
for each which happens to
be in the diagonal of X X
This can also be otained through
the user input but it is generic
with the matrix 
operation
Get the number in the sum
for each which happens to
be in the diagonal of X X
This can also be otained through
the user input but it is generic
with the matrix especially
for unbalanced design 
sum_num = diag(dmat_mean' * dmat_mean)
Columns for th order interactions
end end for every design st
order 
contrasts [err, Contr] = ContrVec(1, n, NF, group, dmat, Contr, FL, num_col)
 return

Function Documentation

array 1Xnlevels   ) 
 

Referenced by ComputeOctreeMask(), parray(), print_array(), sprint_array(), SUMA_writeColorFile(), vpOctreeMask(), write_one_ts(), and write_results().

cmat cbase+1:cbase nC,
clist 
 

dfboth nterms k  )  [pure virtual]
 

end if dfboth k0   ) 
 

dfterm0 sj   ) 
 

levels for this factor dfvar j   ) 
 

dfw  ) 
 

get model without this term dfw 1:nterms   ) 
 

dfwo  ) 
 

sum of all the elements along nd dimension row   ) 
 

Referenced by allocate_arrays(), analyze_results(), calc_centroid(), calc_good_fit(), calc_partial_derivatives(), calc_reflection(), deallocate_arrays(), eval_vertices(), initialize_full_model(), initialize_program(), initialize_simplex(), output_parameters(), output_results(), qh_copypoints(), qh_detjoggle(), qh_distround(), qh_maxmin(), qh_readpoints(), replace(), restart(), simplex_optimization(), and write_bucket_data().

dmat ,
clist 
 

residual degrees of freedom In design matrix the first column is all one for the total mean Then there are totally FL  ) 
 

for = (j+1):1:NF  ) 
 

for j  = (i+1):1:NF  ) 
 

for = 1:1:NF  ) 
 

Create index vector from a grouping so that gnj gij   ) 
 

end if Contr3.  tot,
 

Initial value:

= 1)

err = 0

end if Contr2.  tot,
 

end if Contr1.  tot,
 

Columns for th order interactions end end for every design if Contr.ord1.  tot,
 

Columns for rd order interactions end end end end if NF  = = 4  ) 
 

Columns for nd order interactions end end end if NF  ,
 

if NF  ,
 

residual degrees of freedom if Contr.  do = = 1  ) 
 

and no others if length(oldtm ,
 

if isempty(tn  ) 
 

combine G into term dummy vars Construct the term name and constraints matrix for the which is the last factor if ismember(varnum, cov.marker)&cov.  do  ) 
 

combine G into term dummy vars Construct the term name and constraints matrix if ismember(varnum, NF)&cov.  do  ) 
 

but vmean is never used in the code end else Unbalanced designs if cov.do j = =cov.marker  ) 
 

Definition at line 73 of file PreProc.m.

References j.

00074                   {j} = gj;

if unbalanced.  yes = = 0  ) 
 

end if ischar(gj  ) 
 

end if size(gj, 1)~  = n  ) 
 

if size(gj, 1)  = = 1  ) 
 

kron eye(size(tconstr, 2))  ,
oconstr 
 

kron eye(length(vconstr))  ,
tconstr 
 

the st column is for grand mean order  )  [pure virtual]
 

num_col  )  = num_col(4)*FL(i).N_level
 

num_col  )  = num_col(3) + FL(i).N_level*FL(j).N_level*FL(k).N_level [pure virtual]
 

num_col  )  = num_col(2) + FL(i).N_level*FL(j).N_level [pure virtual]
 

num_col  ) 
 

end end if (unbalanced.yes == 0) Number of rows 1st  dimension  ) 
 

Referenced by allocate2D(), array_to_matrix(), do_barray_io(), do_sarray_io(), free2D(), get_inputs(), identify_repeats(), matrix_add(), matrix_check_columns(), matrix_copy(), matrix_create(), matrix_enter(), matrix_equate(), matrix_extract(), matrix_extract_rows(), matrix_file_read(), matrix_file_write(), matrix_multiply(), matrix_norm(), matrix_print(), matrix_scale(), matrix_subtract(), matrix_transpose(), pbm_writepbminit(), pgm_writepgminit(), pm_allocarray(), pnm_backgroundxel(), pnm_promoteformat(), pnm_writepnm(), pnm_writepnminit(), ppm_computecolorhash(), ppm_computecolorhist(), ppm_writeppminit(), ppmd_filledrectangle(), ppmd_line(), ppmd_polyspline(), ppmd_spline3(), ppmd_text(), qh_backnormal(), qh_determinant(), qh_detsimplex(), qh_facetarea_simplex(), qh_gausselim(), qh_printmatrix(), qh_randommatrix(), qh_rotateinput(), qh_sethyperplane_det(), qh_sethyperplane_gauss(), SUMA_allocate2D(), SUMA_free2D(), vector_multiply(), and vector_multiply_subtract().

end which is voxel independent s length(sindices)   ) 
 

sindices  ) 
 

length of each term number of  columns  ) 
 

termlength sindex(j ,
 

termname clist   ) 
 

variable name tm varnum   )  [pure virtual]
 


Variable Documentation

break
 

Definition at line 161 of file PreProc.m.

Referenced by add_TRUST_host(), addto_args(), addto_Htable(), adwarp_follower_dataset(), adwarp_refashion_dataset(), AFNI_3d_linefill(), AFNI_backward_warp_vector(), AFNI_brick_to_mri(), AFNI_choose_dataset_CB(), AFNI_clone_controller_CB(), AFNI_concatenate_warp(), AFNI_crosshair_EV(), AFNI_crosshair_visible_CB(), AFNI_dataset_slice(), AFNI_drive_open_plugin(), AFNI_drive_pbar_rotate(), AFNI_drive_purge_memory(), AFNI_drive_set_pbar_all(), AFNI_drive_set_pbar_sign(), AFNI_drive_switch_anatomy(), AFNI_drive_switch_function(), AFNI_drive_switch_session(), AFNI_driver(), AFNI_fimmer_compute(), AFNI_finalize_dataset_CB(), AFNI_finalize_read_1D_CB(), AFNI_finalize_read_palette_CB(), AFNI_finalize_read_sess_CB(), AFNI_finalize_write_palette_CB(), AFNI_find_jpegs(), AFNI_find_poem_files(), AFNI_find_todays_face(), AFNI_first_tog(), AFNI_follower_dataset(), AFNI_force_adoption(), AFNI_forward_warp_vector(), AFNI_func_overlay(), AFNI_get_xhair_node(), AFNI_gra_send_CB(), AFNI_hidden_EV(), AFNI_init_warp(), AFNI_initialize_controller(), AFNI_load_defaults(), AFNI_make_voxwarp(), AFNI_make_warp(), AFNI_marks_quality_check(), AFNI_marktog_CB(), AFNI_misc_CB(), AFNI_newfunc_overlay(), AFNI_parse_args(), AFNI_pbar_EV(), AFNI_plugout_workproc(), AFNI_process_environ(), AFNI_process_interrupts(), AFNI_process_plugout(), AFNI_process_setup(), AFNI_purge_dsets(), AFNI_read_inputs(), AFNI_receive_control(), AFNI_receive_init(), AFNI_refashion_dataset(), AFNI_register_nD_func_init(), AFNI_register_nD_function(), AFNI_rescan_session_NEW(), AFNI_rescan_session_OLD(), AFNI_rescan_timeseries_CB(), AFNI_seq_send_CB(), AFNI_set_cursor(), AFNI_set_func_autorange(), AFNI_set_func_visible(), AFNI_set_valabel(), AFNI_setup_viewing(), AFNI_sigfunc(), AFNI_slice_flip(), AFNI_splashdown(), AFNI_splashup(), AFNI_start_io(), AFNI_startup_layout_CB(), AFNI_ttatlas_overlay(), AFNI_underlay_CB(), AFNI_version_check(), AFNI_view_setter(), AFNI_vnlist_func_overlay(), AIVVV_imseq_send_CB(), AP_press_CB(), apply_3shear(), apply_xshear(), apply_yshear(), apply_zshear(), approximate_number_string(), AV_fval_to_char(), AV_press_CB(), B2SL_NAME(), B64_to_binary(), basis_parser(), BFIT_compute(), BFIT_prepare_dataset(), blanktrim(), brainnormalize_coord(), breakup_string(), BUCK_read_opts(), CALC_read_opts(), calculate_results(), cfft(), clip_memplot(), clustedit3D(), collapse_illegals(), collapse_xy(), conv_model(), copy_memplot(), CORREL_main(), CREN_dset_axes(), CREN_render(), DBLE_mat_to_dicomm(), DC_add_overlay_color(), decode_dimen_string(), decode_linebuf(), decode_type_field(), delete_memplot(), DLSQ_rotscl(), do_xrestore_stuff(), DRAW_collapsar(), DRAW_fillin_CB(), DRAW_finalize_dset_CB(), DRAW_into_dataset(), DRAW_label_EV(), DRAW_receiver(), DRAW_ttatlas_CB(), draw_xseg(), drive_MCW_grapher(), drive_MCW_imseq(), dset_to_mri(), EDIT_blur_volume_3d(), EDIT_coerce_scale_type(), EDIT_coerce_type(), EDIT_dset_items(), EDIT_filter_volume(), EDIT_main(), EDIT_one_dataset(), EDIT_opts(), EDIT_volpad(), EDIT_zscore_vol(), EDT_calcmask(), ENV_init(), ENV_main(), extract_byte_fs(), extract_byte_ts(), extract_byte_tsx(), F1D_chainfunc(), F1D_main(), F2D_chainfunc(), F2D_main(), FD_brick_to_mri(), FD_brick_to_series(), fft_3dec(), fft_4dec(), fft_5dec(), FFT_selection(), fim3d_fimmer_compute(), FIM_selection(), find_base_value(), find_empty_slot(), find_unusual_correlations(), flip(), flip90(), flip_memplot(), get_header_attribute(), get_siemens_extra_info(), get_X11_colordef(), GRA_color_CB(), GRA_drawing_EV(), GRA_fim_CB(), GRA_handle_keypress(), GRA_overlay_circle(), GRA_saver_CB(), GRA_setshift_action_CB(), GRA_small_circle(), GRA_thick_CB(), GRA_timer_CB(), GRAF_changed(), GRAF_drawing_EV(), GRAF_pasdrawing_EV(), GRAPH_find_components(), HandleEvent(), hasher(), HISTO_main(), IMREG_main(), input_CB(), INTERP_setup_linear(), iochan_ctl(), iochan_fork_relay(), iochan_goodcheck(), iochan_init(), iochan_recvloop(), ISQ_arrowpad_CB(), ISQ_butsave_EV(), ISQ_button2_EV(), ISQ_disp_act_CB(), ISQ_disp_options(), ISQ_draw_winfo(), ISQ_drawing_EV(), ISQ_flipxy(), ISQ_handle_keypress(), ISQ_montage_action_CB(), ISQ_overlay(), ISQ_perpoints(), ISQ_plot_label(), ISQ_process_mri(), ISQ_record_send_CB(), ISQ_redisplay(), ISQ_remove_widget(), ISQ_saver_CB(), ISQ_set_cursor_state(), ISQ_snapfile(), ISQ_statistics_WP(), ISQ_surfgraph_arrowpad_CB(), ISQ_timer_CB(), ISQ_unflipxy(), kill_graph_xy(), L1F_main(), LMAP_XNAME(), LMAP_YNAME(), LMAP_ZNAME(), Load_Any_RGB(), Load_Next_RGB(), LSQ_main(), main(), main_FD_EPI(), MAIN_workprocess(), Make_RGB_lookup(), make_shear_matrix(), MAKER_4D_to_typed_fbuc(), MAKER_4D_to_typed_fim(), MAKER_4D_to_typed_fith(), mangle_angle(), MASKAVE_main(), Max_func(), MCW_check_iconsize(), MCW_choose_string(), MCW_fc7(), MCW_find_clusters(), MCW_get_intlist(), mcw_malloc_dump(), MCW_new_DC(), MCW_popup_message(), MCW_popup_meter(), MCW_scale_to_max(), MCW_stradd_CB(), MCW_vol_amax(), memplot_to_postscript(), memplot_to_RGB_sef(), memplot_to_X11_sef(), merge_cohar(), mri_3to_rgb(), mri_brainormalize(), mri_cat2D(), mri_data_pointer(), mri_dup2D(), mri_dup2D_mode(), mri_fix_data_pointer(), mri_flippo(), mri_histogram(), mri_imcount(), mri_imcount_analyze75(), mri_imcount_dicom(), mri_imcount_siemens(), mri_invert_inplace(), mri_medianfilter(), mri_min(), mri_mult_to_float(), mri_multiply_complex(), mri_new_7D_generic(), mri_nsize(), mri_percents(), mri_quantile(), mri_read(), mri_read3D_analyze75(), mri_read_3A(), mri_read_3D(), mri_read_3D_delay(), mri_read_analyze75(), mri_read_ascii(), mri_read_ascii_ragged(), mri_read_dicom(), mri_read_mpeg(), mri_read_siemens(), mri_rgb_transform_nD(), mri_rgba_composite_array(), mri_rgba_composite_VA(), mri_scale_inplace(), mri_scale_to_float(), mri_shift_1D(), mri_to_byte(), mri_to_byte_scl(), mri_to_complex(), mri_to_complex_ext(), mri_to_float(), mri_to_mri(), mri_to_mri_scl(), mri_to_rgb(), mri_to_rgba(), mri_to_short(), mri_to_short_sclip(), mri_to_XImage(), mri_try_7D(), mri_warp3d_align_one(), mri_warp3D_cubic(), mri_warp3D_get_delta(), mri_warp3D_linear(), mri_warp3D_NN(), mri_warp3D_quintic(), mri_warp_bicubic(), mri_write(), mri_write_7D(), mri_write_ascii(), mri_write_pnm(), mri_zeropad_2D(), multivector_read(), multivector_write(), MV_fval_to_char(), my_fgets(), new_MCW_arrowval(), new_MCW_bbox(), new_MCW_grapher(), new_PLUGOUT_spec(), new_RT_input(), NI_base64_to_val(), NI_binary_to_val(), NI_convert_elm_to_obj(), NI_copy_struct(), NI_decode_one_double(), NI_decode_string_list(), NI_free_struct(), NI_fval_to_char(), NI_get_attribute(), NI_malloc_dump(), NI_read_columns(), NI_read_element(), NI_register_doer(), NI_register_objconverters(), NI_remove_from_group(), NI_rowtype_find_name(), NI_set_attribute(), NI_set_vector_range(), NI_stat_decode(), NI_stat_encode(), NI_stream_close_keep(), NI_stream_fillbuf(), NI_stream_goodcheck(), NI_stream_open(), NI_stream_readbuf(), NI_text_to_val(), NI_val_to_text(), NI_write_columns(), NI_write_element(), NIH_find_clusters(), NL_main(), NLFIT_get_many_MODELs(), NOTES_delete_CB(), NOTES_restore_CB(), outer9_box_func(), parse_header_stuff(), PARSER_1deval(), parset_affine(), PBAR_add_bigmap(), PBAR_button_EV(), PBAR_click_CB(), PBAR_define_bigmap(), PBAR_make_bigmap(), PBAR_set_bigmap(), PBAR_set_CB(), PCOR_get_mcor(), PCOR_UPDATE(), PH_fakeim(), pixar_to_XImage(), plot_graphs(), plot_line(), PLOT_scatterellipse(), plot_ts_init(), plot_ts_mem(), PLUG_choose_dataset_CB(), PLUG_fillin_values(), PLUG_get_many_plugins(), PLUG_nonblank_len(), PLUG_read_plugin(), PLUG_setup_widgets(), PLUGIN_init(), PLUGIN_seq_send_CB(), PLUTO_4D_to_nothing(), PLUTO_commandstring(), PLUTO_imseq_send_CB(), PLUTO_scatterplot(), populate_nifti_image(), POWER_main(), PR_one_slice(), probe_track(), proc_sigfunc(), process_NIML_Node_ROI(), process_NIML_SUMA_ijk(), process_NIML_SUMA_ixyz(), process_NIML_SUMA_node_normals(), process_sample(), putin_fop_table(), qmed_float(), 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_fimfunc(), quotize_string(), r_mri_read_dicom(), random_search(), RCREND_accum_lab_EV(), RCREND_autocompute_CB(), RCREND_choose_CB(), RCREND_clusters_av_CB(), RCREND_cutout_blobs(), RCREND_cutout_set_CB(), RCREND_cutout_state_changed(), RCREND_cutout_type_CB(), RCREND_kill_clusters_CB(), RCREND_open_imseq(), RCREND_overlay_ttatlas(), RCREND_pbarmenu_EV(), RCREND_read_exec_CB(), RCREND_reload_dataset(), RCREND_reload_func_dset(), RCREND_seq_send_CB(), RCREND_state_to_widgets(), RCREND_update_imseq(), RCREND_xhair_EV(), read_ascii_floats(), read_glt_matrix(), read_input_data(), read_URL_http(), redraw_graph(), redraw_MCW_pasgraf(), REG_command_line(), reload_DC_colordef(), remove_open_stream(), REND_autocompute_CB(), REND_choose_CB(), REND_clusters_av_CB(), REND_cutout_blobs(), REND_cutout_set_CB(), REND_cutout_state_changed(), REND_cutout_type_CB(), REND_kill_clusters_CB(), REND_open_imseq(), REND_overlay_ttatlas(), REND_pbarmenu_EV(), REND_read_exec_CB(), REND_reload_dataset(), REND_reload_func_dset(), REND_reload_renderer(), REND_seq_send_CB(), REND_state_to_widgets(), REND_update_imseq(), REND_xhair_EV(), resize_XImage(), rot_to_shear(), rot_to_shear_matvec(), rotate_stdin_points(), RT_fim_recurse(), RT_finish_dataset(), RT_number_array(), RT_process_image(), RT_process_info(), RT_registration_2D_onevol(), RT_registration_3D_onevol(), RT_registration_3D_setup(), RT_sigfunc(), RT_start_dataset(), RT_tell_afni_one(), RT_worker(), RWC_drag_circle(), RWC_drag_rectangle(), RWC_read_time_series(), RWC_setup_fims(), RWC_xineramize(), SCAT_main(), SER_addto_vector_textmode(), SER_new_vector(), SFIM_load_intervals(), SHIFT_set_method(), shiftdeltas(), shiftvec(), SHM_goodcheck(), SHM_init(), SHM_readcheck(), SHM_recv(), SHM_send(), SHM_writecheck(), SNAP_imseq_send_CB(), SNGL_mat_to_dicomm(), spearman_fimfunc(), SPLASH_decodexx(), STATS_tsfunc(), STAVG_main(), STD_colors(), SUMA_AFNI_forward_warp_xyz(), SUMA_FindNgrAttributeElement(), SUMA_flip_orient(), SUMA_FormAfnidset(), SUMA_ixyzsort_surface(), SUMA_NI_decode_string_list(), SUMA_NI_get_ith_string(), SUMA_nimlSO2SO(), SUMA_orcode_to_orstring(), SUMA_sigfunc(), SUMA_THD_3dmm_to_dicomm(), SUMA_THD_dicomm_to_3dmm(), SUMA_THD_handedness(), SUMA_VolDims(), SYM_expand_ranges(), T3D_check_data(), T3D_data_to_widgets(), T3D_imseq_CB(), T3D_initialize_user_data(), T3D_read_images(), T3D_save_file_CB(), T3D_swap_CB(), T3D_voxshape_CB(), T3D_widgets_to_data(), TAG_read_CB(), TCAT_read_opts(), text_graphs(), TFIM_getopts(), THD_3dim_from_block(), THD_3dmm_to_dicomm(), THD_add_bricks(), THD_cliplevel(), THD_copy_file(), THD_datablock_apply_atr(), THD_datablock_from_atr(), THD_dataset_info(), THD_dataset_rowfillin(), THD_dataset_tshift(), THD_dataset_zfillin(), THD_dblkatr_from_niml(), THD_delete_datablock(), THD_dicomm_to_3dmm(), THD_dset_in_session(), THD_erase_all_atr(), THD_erase_one_atr(), THD_extract_array(), THD_extract_float_brick(), THD_extract_many_series(), THD_fetch_dataset(), THD_fetch_many_datasets(), THD_find_atr(), THD_generic_detrend(), THD_get_brick_stats(), THD_get_dset_row(), THD_get_many_timeseries(), THD_get_voxel(), THD_getpathprogs(), THD_handedness(), THD_init_prefix_datablocks(), THD_init_session(), THD_insert_series(), THD_load_3D(), THD_load_analyze(), THD_load_ctfmri(), THD_load_datablock(), THD_load_minc(), THD_load_nifti(), THD_makemask(), THD_mask_clust(), THD_mask_fillin_once(), THD_matrix_to_orientation(), THD_nimlize_dsetatr(), THD_open_3D(), THD_open_3dcalc(), THD_open_analyze(), THD_open_ctfmri(), THD_open_ctfsam(), THD_open_minc(), THD_open_mpeg(), THD_open_nifti(), THD_open_one_dataset(), THD_open_tcat(), THD_order_session(), THD_orient_guess(), THD_oriented_brick(), THD_peel_mask(), THD_put_dset_row(), THD_pval_to_stat(), THD_read_all_atr(), THD_read_dvecmat(), THD_read_niml_atr(), THD_rota_method(), THD_rotcom_to_matvec(), THD_set_atr(), THD_set_dataset_attributes(), THD_setup_bricks(), THD_stat_to_pval(), THD_stat_to_zscore(), THD_trailname(), THD_write_1D(), THD_write_atr(), THD_write_datablock(), THD_write_minc(), THD_zeropad(), trailname(), tross_breakup_string(), tross_Encode_String(), tross_multi_Append_History(), TSGEN_main(), TT_load_atlas(), TT_read_opts(), TT_whereami(), TTget_recv(), TTget_URL(), TTRR_load_file(), unusuality(), update_voxel_corr(), upsample_1(), upsample_7(), VOLREG_main(), window_plane(), WINsorize(), XImage_to_mri(), XSAVE_input(), and zedit_mask().

C = termconstr{j}
 

Definition at line 270 of file PreProc.m.

cbase = 0
 

Definition at line 195 of file PreProc.m.

Referenced by NI_rowtype_define().

clist = ismember(termname, [0 keepterms])
 

Definition at line 268 of file PreProc.m.

Referenced by dtree_insert(), SUMA_AssembleAllROIList(), SUMA_AssembleColorPlaneList(), SUMA_AssembleGroupList(), and SUMA_CreateScrolledList().

to hold design matrix of nXncols cmat = zeros(nconstr,ncols)
 

Definition at line 183 of file PreProc.m.

Referenced by compute_choleski(), GRAPH_find_components(), main(), read_glt_matrix(), and robust_covar().

Kronecker end If the rest of this term is computed
 

Definition at line 149 of file PreProc.m.

end th order contrasts = ContrVec(1, n, NF, group, dmat, Contr, FL, num_col)
 

Definition at line 356 of file PreProc.m.

combine G into term dummy vars Construct the term name and constraints matrix for the which is the last factor for the covariate
 

Definition at line 135 of file PreProc.m.

Debug Flag DBG = 1
 

Definition at line 36 of file PreProc.m.

df0 = df0 * dfvar(varnum)
 

Definition at line 160 of file PreProc.m.

Referenced by warp3D_sharm3_grad().

dfboth = [dfw
 

dfbothSS = dfboth
 

Definition at line 226 of file PreProc.m.

denominator dfe = n - dfx
 

Definition at line 302 of file SumsOfSquares.m.

denominator dfterm = dfw - dfwo
 

name for entire e g A* B dfterm0 = zeros(nterms, 1)
 

Definition at line 106 of file PreProc.m.

dfvar = zeros(ng,1)
 

sum of squares without this term dfw = ssw
 

Definition at line 204 of file PreProc.m.

dfwo = ssw
 

Definition at line 225 of file PreProc.m.

end end end dmat = ones(n, ncols)
 

end Ignore st col since it is total mean dmat_mean = dmat(:, (num_col0 + 1):(num_col0 + num_col(1)))
 

Definition at line 307 of file PreProc.m.

end[err, Qd, dfx, dmat2] = QRDecom(dmat, cmat)
 

Definition at line 198 of file PreProc.m.

initailize return variables err = 1
 

Definition at line 39 of file PreProc.m.

D F
 

Initial value:

 1
         vconstr{j} = zeros(0,1)

Definition at line 86 of file PreProc.m.

Bethesda MD Define the function name for easy referencing FuncName = 'PreProc.m'
 

Definition at line 33 of file PreProc.m.

function[err, Qd, s, termname, nterms, sindices, dfbothSS, modw, modwo, tnames, dfterm, dfe, Contr]
 

Initial value:

 PreProc(n, NF, group, varnames, FL, Contr, cov, unbalanced)
%
%   [err, Qd, Rd, sindices, dfboth, modw, modwo, dfx] = PreProc(n,group,varnames)
%
%Purpose:
%   
%  Returns QR decomposition results for the design matrix projected to null space 
%   
%Input Parameters:
%   n: number of datasets = total # of combinations including repeats
%   group: cell array of factor levels
%   varnames: 
%   
%Output Parameters:
%   err : 0 No Problem
%       : 1  Problems
%   
%   
%      
%Key Terms:
%   
%More Info :
%   
%   
%   
%
%     Author : Gang Chen
%     Date : Tue Mar 23 13:57:52 EST 2004
%     SSCC/NIMH/ NIH

Definition at line 1 of file PreProc.m.

d f so far Combine its dummy variable with the part computed so far G = gdum{varnum}
 

Definition at line 128 of file PreProc.m.

end gdum = cell(ng,1)
 

Definition at line 56 of file PreProc.m.

end gj = gj(:)
 

Definition at line 52 of file PreProc.m.

Don t worry about NaN s at this point group = group(:)
 

Definition at line 42 of file PreProc.m.

Referenced by bandv_(), checkAttributeOrder(), DCM_CloseObject(), DCM_ElementDictionary(), DCM_GetElementSize(), DCM_GroupDictionary(), DCM_GroupPresent(), DCM_RemoveElement(), DCM_RemoveGroup(), exportFixedFields(), findCreateGroup(), handleGroupItem(), readFile(), readGroupElement(), SUMA_AdoptGroup(), SUMA_SwitchGroups(), SUMA_writeSpecFile(), tinvit_(), and tsturm_().

residual degrees of freedom In design matrix the first column is all one for the total mean Then there are totally rd order interaction
 

Definition at line 295 of file PreProc.m.

Referenced by check_for_valid_inputs().

for j
 

Initial value:

1:ng
   gj = group{j}

Definition at line 245 of file PreProc.m.

k = size(tdum, 2)
 

Definition at line 282 of file PreProc.m.

else k0 = k+nterms
 

Definition at line 73 of file SumsOfSquares.m.

Referenced by ExtractClassifiedVolume(), and Resample().

end Get the design matrix for this model keepterms = find(thismod)
 

Definition at line 267 of file PreProc.m.

constraints to make each term well defined levelcodes = cell(nterms, 1)
 

Definition at line 104 of file PreProc.m.

Get the number in the sum for each mean
 

Definition at line 309 of file PreProc.m.

Use these results for each term that requires them mod0 = repmat(thismod, nterms, 1)
 

Definition at line 277 of file PreProc.m.

locations of model with all terms else Only apply type III for sums of squares modw = ones(nterms)
 

Definition at line 213 of file PreProc.m.

get model with this term modwo = logical(modw - eye(nterms))
 

Definition at line 220 of file PreProc.m.

end n
 

Definition at line 50 of file PreProc.m.

nC = size(C,1)
 

Definition at line 192 of file PreProc.m.

ncols = 1
 

Definition at line 168 of file PreProc.m.

nconstr = 0
 

Definition at line 177 of file PreProc.m.

what s it for ng = length(group)
 

Definition at line 43 of file PreProc.m.

Referenced by main().

levels for term so far nlevgrp = size(G,2)
 

Definition at line 130 of file PreProc.m.

dummy vars for this grouping var nlevterm = size(tdum,2)
 

Definition at line 129 of file PreProc.m.

residual degrees of freedom In design matrix the first column is all one for the total mean Then there are totally rd order and th order interactions Store only those mean columns in design matrix num_col0 = 1
 

Definition at line 299 of file PreProc.m.

oconstr = termconstr{k}
 

Definition at line 156 of file PreProc.m.

same vars in old term oldtm = find((prevterms * tm') == sum(tm))
 

Definition at line 152 of file PreProc.m.

Get the number in the sum for each which happens to be in the diagonal of X X This can also be otained through the user input but it is generic with the matrix operation
 

Definition at line 309 of file PreProc.m.

sort in ascending order
 

Definition at line 236 of file PreProc.m.

Referenced by bandv_(), check_im_byte_order(), convert_internal(), convert_rgb(), NI_read_element(), tinvit_(), and yuv2rgb_c_init().

Kronecker end If the rest of this term is take advantage of that prevterms = sterms(1:j-1,:)
 

Definition at line 150 of file PreProc.m.

return
 

Definition at line 362 of file PreProc.m.

residual degrees of freedom In design matrix the first column is all one s
 

Definition at line 293 of file PreProc.m.

end end if (unbalanced.yes == 0) Number of sindex = sortrows(termlist)
 

Definition at line 98 of file PreProc.m.

Referenced by compute_node_areas(), copy_surfaces(), float_list_slow_sort(), suma2afni_surf(), and surf_to_node_list().

sindices is the index for the new array sindices = sort(termsize)
 

Definition at line 237 of file PreProc.m.

sj = sindex(j)
 

Definition at line 169 of file PreProc.m.

Referenced by main().

For usage in ss m Consider interactions before their components for type ss
 

Definition at line 228 of file PreProc.m.

Referenced by AFNI_andersonville(), AFNI_finalize_read_Web_CB(), AFNI_force_adoption(), AFNI_make_descendants_old(), AFNI_mark_for_death(), AFNI_marks_transform_CB(), AFNI_plugin_button(), AFNI_process_plugout(), AFNI_rescan_timeseries_CB(), AFNI_serverlog(), AFNI_vnlist_func_overlay(), AFNI_vol2surf_func_overlay(), AFNI_write_many_dataset_CB(), binomial_t2p(), binomial_t2z(), calculate_ss(), check_string(), corr_floatbit(), count_bitvector(), DRAW_choose_CB(), DRAW_undo_sizecheck(), dumpSS(), expand_rle(), fft_5dec(), init_AREN_colortable(), init_MREN_colortable(), ISQ_plot_label(), ISQ_show_image(), main(), mcw_malloc_dump(), MCW_sort_cluster(), mri_short_order(), NI_byteorder(), NI_decode_string_list(), NI_malloc_dump(), NI_rowtype_vsize(), NOTES_choose_CB(), NUD_choose_CB(), parse_header_stuff(), parset_affine(), PLUG_choose_dataset_CB(), PLUG_setup_widgets(), PLUTO_popup_dset_chooser(), pr_att_vals(), PR_one_slice(), process_NIML_AFNI_dataset(), PV2S_check_surfaces(), PV2S_disp_afni_surfaces(), PV2S_process_args(), quadrant_corr(), quadrant_manycorr(), RCREND_axis_rotmatrix(), RCREND_load_dsl(), read_glt_matrix(), read_input_data(), RENAME_main(), REND_load_dsl(), RWC_set_endianosity(), RWC_xineramize(), SER_addto_vector_textmode(), slist_surfs_for_ldp(), sortIt(), spearman_rank_corr(), spearman_rank_manycorr(), sphere_voronoi_vectors(), SPLASH_imseq_getim(), SUMA_NI_decode_string_list(), SUMA_NI_get_ith_string(), surf_ave_radius(), SYM_expand_ranges(), tztrim(), unusuality(), and UTL_ConvertTimetoFloat().

Determine which models to compare for testing each term ssw = -ones(nterms, 1)
 

Definition at line 202 of file PreProc.m.

sum of squares with this term sswo = ssw
 

Definition at line 203 of file PreProc.m.

sort in ascending output is stored in stermsize
 

Definition at line 236 of file PreProc.m.

Get the number in the sum for each which happens to be in the diagonal of X X This can also be otained through the user input but it is generic with the matrix especially for unbalanced design sum_num = diag(dmat_mean' * dmat_mean)
 

Definition at line 312 of file PreProc.m.

tconstr = 1
 

Definition at line 157 of file PreProc.m.

levels for this grouping var tdum = []
 

Definition at line 131 of file PreProc.m.

Fit this term = QRDecom(X, C)
 

Definition at line 273 of file PreProc.m.

Referenced by betadf(), cumchn(), devlpl(), dt1(), incbeta(), SUMA_GetNextCommand(), SUMA_RegisterCommand(), and tnonc_s2p().

cell array of dummy variables which are design matrix cols termconstr = cell(nterms,1)
 

Definition at line 103 of file PreProc.m.

termdum = cell(nterms, 1)
 

Definition at line 102 of file PreProc.m.

termend = termstart + termlength - 1
 

Definition at line 187 of file PreProc.m.

list of vars in each term termlength = zeros(size(sindex))
 

Definition at line 108 of file PreProc.m.

number of factors termlist = makemodel(ng, ng)
 

Definition at line 44 of file PreProc.m.

base from which to fill in cmat termname = zeros(ncols,1)
 

Definition at line 185 of file PreProc.m.

else termsize = sum(termlist,2)'
 

Definition at line 235 of file PreProc.m.

termstart = cumsum([2; termlength(1:end-1)])
 

Definition at line 186 of file PreProc.m.

nominal d f for each term termvars = cell(nterms, 1)
 

Definition at line 107 of file PreProc.m.

else thismod = modw(k, :)
 

Definition at line 263 of file PreProc.m.

tm = sterms(j,:)
 

Definition at line 116 of file PreProc.m.

else tn = ''
 

Definition at line 144 of file PreProc.m.

Referenced by SUMA_etime().

tnames = cell(nterms, 1)
 

TnotC = termsnotcontained(termlist)
 

Definition at line 215 of file PreProc.m.

Create index vector from a grouping variable = grp2idx(gj)
 

Definition at line 66 of file PreProc.m.

Get the number in the sum for each which happens to be in the diagonal of X X This can also be otained through the user input variables
 

Definition at line 309 of file PreProc.m.

Find indices of nonzero elements for varidx
 

Initial value:

 1:length(vars)
      % Process each variable participating in this term
      varnum = vars(varidx)

Definition at line 121 of file PreProc.m.

blank name so far vars = find(tm)
 

Definition at line 120 of file PreProc.m.

Referenced by wr_abbrevs().

else vconstr = cell(ng,1)
 

Definition at line 138 of file PreProc.m.

vmean = cell(ng,1)
 

Definition at line 61 of file PreProc.m.

X = dmat2(:,clist)
 

Definition at line 269 of file PreProc.m.

 

Powered by Plone

This site conforms to the following standards: