function [] = Segmentation(folder, l, c)

    t=dir([folder '/*.mat']);
    fichier=[folder '/' t.name];
    d=load(fichier);
    data=d.data_g;
    names=fieldnames(data);
    ln=numel(names);
    for k=1:ln
        nom=names{k};
        allseq=fieldnames(data.(nom));
        lsq=numel(allseq);
        for m=1:lsq
            V=[];
            seq=allseq{m};
            disp(seq);
            lg=numel(fieldnames(data.(nom).(seq).CP));
            disp([nom '->' seq]);
            for i=1:lg
                disp(['Traitement image: ' num2str(i)]);
                CP=data.(nom).(seq).CP.(['CP' num2str(i)]);
                MF=data.(nom).(seq).MF.(['MF' num2str(i)]);

                RG=Cutter(CP, l, c);
                data.(nom).(seq).RG.(['RG' num2str(i)])=RG;

                val=Valeurs( CP, MF, RG );
                data.(nom).(seq).Vals.(['Val' num2str(i)])=val;

                V=[V reshape(val, [max(max(RG))*7 1])];
            end
            data.(nom).(seq).V=V;
        end
    end
    data_g=data;
    save(fichier, 'data_g');
end