
SplitLabel = 'STRAIGHT_WALK';

%%%%%%%%%%%%%%%%%%%
desc = {'HVHA','NVHA','LVHA','HVLA','NVLA','LVLA','HVNA','LVNA','NVNA'};

load ../Data/AV_8Walk_Sean_Unseg_RC.mat


files = dir('../Data/AVSegments/8Walk/*sean*.txt');
c =1;
for file=files'
AV8WalkSegments{c} = ReadSegments(['../Data/AVSegments/8Walk/',file.name],1,30);
c = c+1;
end

skelo = skel;
removePosCh;


SegmentIndices = zeros(length(AV8WalkSegments),2);

for jj = 1:size(SegmentIndices,1)
    
    s=-1;
    e=-1;
    
    cc = 1;
    for i=1:size(AV8WalkSegments{jj},1)
        if strcmp(AV8WalkSegments{jj}{i,3},SplitLabel)==1
            s=AV8WalkSegments{jj}{i,1};
            e=AV8WalkSegments{jj}{i,2};
            
            expmap2bvh2(skel,M{jj}(floor(s/4):floor(e/4),:),['Input/AV_8Walk_Sean_',desc{jj},'_Rep',int2str(cc),'.bvh'],1/30);
            cc = cc+1;
        end
    end
    SegmentIndices(jj,:) = [s,e];
    
   
end

clear files AV8WalkSegments c jj i e s;

    