function ShowBasis(X,boundaries_kk,boundaries2_pca,boundaries_kk_pca,Apca);

% Function for showing the results of the basis segmentation algorithms 

[m,n] = size(X);

% Original data
figure, subplot(4,1,1);
imagesc(X); colormap(ones(size(gray))-gray);
hold on; title('Original data ');
set(gca,'XTickLabel','');

% Segmentation in algorithm SEG-PCA
subplot(4,1,2),imagesc(X); colormap(ones(size(gray))-gray);
hold on; title('Algorithm SEG-PCA');
[foo, amount] = size(boundaries_kk); [m,n] = size(X);
hold on;
for i = 1 : amount-1
  plot([boundaries_kk(i)-0.5,boundaries_kk(i)-0.5],[0,m+0.5],'r-');
end;
set(gca,'XTickLabel','');

% Segmentation in algorithm SEG-PCA-DP
subplot(4,1,3),imagesc(X); colormap(ones(size(gray))-gray);
hold on; title('Algorithm SEG-PCA-DP');
[foo, amount] = size(boundaries2_pca); [m,n] = size(X);
hold on;
for i = 1 : amount-1
  plot([boundaries2_pca(i)-0.5,boundaries2_pca(i)-0.5],[0,m+0.5], 'r-');
end;
set(gca,'XTickLabel','');

% Segmentation in algorithm PCA-SEG
subplot(4,1,4);
imagesc(Apca); colormap(ones(size(gray))-gray);
hold on; title('Algorithm PCA-SEG');
[foo, amount] = size(boundaries_kk_pca); [m,n] = size(Apca);
hold on;
for i = 1 : amount-1
  plot([boundaries_kk_pca(i)-0.5,boundaries_kk_pca(i)-0.5],[0,m+0.5], 'r-');
end;






