data_reg = load('/home/karela/data/StrokeRatBrain/batches/20200610_101545_AMCAO_AC05_1_1_20200610_101545_AMCAO_AC05_1_1_01/experiment1/reg/data.mat');
load('/nfs/bubla/data/dce-mri/upt/StrokeRatBrain/ResliceTOFonCS/20200610_101545_AMCAO_AC05_1_1/TOF_resliced/TOF_resliced.mat');

data_reg = data_reg.data2;
nSlices=size(data_reg,1);
nSamples=size(data_reg,2);
[nRows,nCols]=size(data_reg{1,1});
data4D_reg=zeros(nRows,nCols,nSlices,nSamples);
for sl=1:nSlices
    for t=1:nSamples
        data4D_reg(:,:,sl,t)=imrotate(data_reg{sl,t},90);
    end
end

data_reg = data4D_reg;

I1 = data_reg(:,:,6,61);
I1 = mat2gray(I1);
I1 = I1.*255;
I1 = uint8(I1);

a = TFsel(:,:,6);
a = uint8(~a);

I1 = I1.*a;
I3 = I1;
I3(a==0)=255;
I1(:,:,2) = I1;
I1(:,:,3) = I3;

figure;
subplot 121
imshow(I1);
subplot 122
TOF_resliced = imrotate(TOF_resliced,180);
TOF_resliced = fliplr(TOF_resliced);
imshow(TOF_resliced(:,:,6),[])

