function showClusterMap2(dataPeak,colorMap,TF,TFsel,pass,clusters,nSignalsInCluster,selClu,clusterSignalsNorm,Lowest1StMomentSig)

dataPeak=imadjustn(dataPeak);

cmapColor=hsv(clusters);
cmapColor=[0 0 0; cmapColor];

cmapColorSel=cmapColor;

cInv=false(clusters+1,1);
cInv(selClu+1)=true;
cmapColorSel(~cInv,:)=0; %unselected clusters are in black

uint8Image = uint8(255 * mat2gray(dataPeak));
cmapGray=gray(255);

figure('visible','off');
subplot(1,2,1);
TFinitImg=montage(TF,'ThumbnailSize',[],'BorderSize',[2 2]);
imgTF=get(TFinitImg,'CData');
subplot(1,2,2)
TFselImg=montage(TFsel,'ThumbnailSize',[],'BorderSize',[2 2]);
imgTFsel=get(TFselImg,'CData');


% figure('name',['Pass ' num2str(pass)]);
% 
% ax1=subplot(2,4,1);
% montage(TF,'ThumbnailSize',[],'BorderSize',[2 2]);
% title(ax1,'Initial logical mask');
% 
% ax2=subplot(2,4,2);
% img1=montage(uint8Image,cmapGray,'ThumbnailSize',[],'BorderSize',[2 2]);
% hold(ax2,'on');
% img2=montage(colorMap,cmapColor,'ThumbnailSize',[],'BorderSize',[2 2]);
% img2.AlphaData=imgTF*0.7;
% img2.AlphaDataMapping='scaled';%   0 transparent, 1 opaque
% title(ax2,'Mean data with clusters assignment overlay (init mask)');
% 
% ax3=subplot(2,4,3);
% montage(TFsel,'ThumbnailSize',[],'BorderSize',[2 2]);
% title(ax3,'Logical mask with selected cluster');
% 
% ax4=subplot(2,4,4);
% colorMapSel=colorMap;
% colorMapSel(colorMap~=selClu)=0;
% img1=montage(uint8Image,cmapGray,'ThumbnailSize',[],'BorderSize',[2 2]);
% hold(ax4,'on');
% img2=montage(colorMapSel,cmapColorSel,'ThumbnailSize',[],'BorderSize',[2 2]);
% img2.AlphaData=imgTFsel*0.7;
% img2.AlphaDataMapping='scaled';%   0 transparent, 1 opaque
% title(ax4,'Mean data with selected cluster overlay (sel. cluster mask)');
% 
% ax5=subplot(2,4,[5 6]);
% hold(ax5,'on');
% Leg=cell(clusters,1);
% for i=1:clusters
%     plot(ax5,clusterSignalsNorm(i,:),'Color',cmapColor(i+1,:));
%     Leg{i,1}=['Cluster ' num2str(i)];
% end
% title(ax5,'Clusters mean signals /normalized/');
% legend(ax5,Leg);
% 
% ax6=subplot(2,4,[7 8]);
% plot(ax6,Lowest1StMomentSig,'Color',cmapColor(selClu+1,:));
% title(ax6,'Resulting mean cluster signal');
% linkaxes([ax1 ax2 ax3 ax4],'xy');

figure('name',['Pass ' num2str(pass)]);

ax1=subplot(2,4,1);
montage(TF,'ThumbnailSize',[],'BorderSize',[2 2]);
%title(ax1,'Initial logical mask');

ax2=subplot(2,4,2);
img1=montage(uint8Image,cmapGray,'ThumbnailSize',[],'BorderSize',[2 2]);
hold(ax2,'on');
img2=montage(colorMap,cmapColor,'ThumbnailSize',[],'BorderSize',[2 2]);
img2.AlphaData=imgTF*0.7;
img2.AlphaDataMapping='scaled';%   0 transparent, 1 opaque
%title(ax2,'Mean data with clusters assignment overlay (init mask)');

ax3=subplot(2,4,3);
montage(TFsel,'ThumbnailSize',[],'BorderSize',[2 2]);
%title(ax3,'Logical mask with selected cluster');

ax4=subplot(2,4,4);
colorMapSel=colorMap;
colorMapSel(colorMap~=selClu)=0;
img1=montage(uint8Image,cmapGray,'ThumbnailSize',[],'BorderSize',[2 2]);
hold(ax4,'on');
img2=montage(colorMapSel,cmapColorSel,'ThumbnailSize',[],'BorderSize',[2 2]);
img2.AlphaData=imgTFsel*0.7;
img2.AlphaDataMapping='scaled';%   0 transparent, 1 opaque
%title(ax4,'Mean data with selected cluster overlay (sel. cluster mask)');

ax5=subplot(2,4,[5 6]);
hold(ax5,'on');
Leg=cell(clusters,1);
for i=1:clusters
    plot(ax5,clusterSignalsNorm(i,:),'Color',cmapColor(i+1,:));
    Leg{i,1}=['Shluk ' num2str(i) ' (' num2str(nSignalsInCluster(i)) ' voxelů)'];
end
% title(ax5,'Clusters mean signals /normalized/');
%title(ax5,'Průměrné signály shluků /normalizované/');
legend(ax5,Leg);

ax6=subplot(2,4,[7 8]);
plot(ax6,Lowest1StMomentSig,'Color',cmapColor(selClu+1,:));
% title(ax6,'Resulting mean cluster signal');
%title(ax6,'Výsledný průměrný signál shluku');
linkaxes([ax1 ax2 ax3 ax4],'xy');
end