function indir_vbm_using_newsegment(indir_t1,outdir_new_segment,vbm_outfodr,Parameter)
%Parameter.AffineRegularisation='mni';  European brains (mni)
%Parameter.AffineRegularisation='eastern'; East Asian brains (eastern)
% vbm_outfodr.mw_grey
% vbm_outfodr.mw_white
% vbm_outfodr.w_grey
% vbm_outfodr.w_white
%-----------------------------------------------------------
%   Copyright(c) 2015
%	Center for Cognition and Brain Disorders, Hangzhou Normal University, Hangzhou 310015, China
%	Written by JIA Xi-Ze 161205
%	http://www.restfmri.net/
% 	Mail to Authors: jxz.rest@gmail.com, jiaxize@foxmail.com


indir_NewSegment(indir_t1,outdir_new_segment,Parameter)
indir_output_vbm_results(outdir_new_segment,vbm_outfodr);
end

function indir_output_vbm_results(outdir_new_segment,vbm_outfodr)
[vbm_prefix_str,vbm_rsult_fodrnam]= get_vbm_rsult_nam();
vbm_outfodr_fieldnames=fieldnames(vbm_outfodr);
output_fodr_amt=length(vbm_outfodr_fieldnames);

for fodr_ind=1:output_fodr_amt
    crnt_fieldname=vbm_outfodr_fieldnames{fodr_ind};
    crnt_outfodr_pth=vbm_outfodr.(crnt_fieldname);
    crnt_regexp=[vbm_prefix_str.(crnt_fieldname) '*'];
    new_name=vbm_rsult_fodrnam.(crnt_fieldname);
    filetbx_cp_batch_pipe2rslt_files(outdir_new_segment,crnt_outfodr_pth,crnt_regexp,new_name)
end

end