function indir_WaveletALFF(indir_FunImg,outfodr_WaveletALFF,infile_Mask,Parameter)
%-----------------------------------------------------------
%   Copyright(c) 2015
%	Center for Cognition and Brain Disorders, Hangzhou Normal University, Hangzhou 310015, China
%	Written by JIA Xi-Ze 201412
%	http://www.restfmri.net/
% 	Mail to Authors: jxz.rest@gmail.com, jiaxize@foxmail.com
%   Wavelet-ALFF was added by SUN Jia-Wei   20_04_20


inpath_Misc(outfodr_WaveletALFF,'MakeCurrentDir');
SubfodrList=dir_NameList(indir_FunImg);


if ~isempty(gcp('nocreate'))% if matlabpool('size')>0  modified by SUN Jia-Wei 200539
    parfor i=1:length(SubfodrList)
        infodr_WaveletALFF([indir_FunImg filesep SubfodrList{i}],...
                     [outfodr_WaveletALFF filesep 'WaveletALFF_' SubfodrList{i} '.nii'],...
                     infile_Mask,Parameter);
    end
else
    for i=1:length(SubfodrList)
        infodr_WaveletALFF([indir_FunImg filesep SubfodrList{i}],...
                     [outfodr_WaveletALFF filesep 'WaveletALFF_' SubfodrList{i} '.nii'],...
                     infile_Mask,Parameter);
    end
end





end