function rename_current_directory(current_pointmodels, templatename)
d=dir([current_pointmodels,'*']);
number=0;
for i=1:length(d)
    if length(d(i).name)>length(templatename)
        nstr=d(i).name(length(templatename)+2:end);
        n=str2num(nstr);
        if n>number
            number=n;
        end
    end
end
number=number+1;
backup=[templatename,'_',num2str(number)];
cd 'PointModels';
system(['rename ',templatename,' ',backup])
cd ..
mkdir(current_pointmodels);
