function varargout = program(varargin)
%Spouštěcí m.file celeho vytvořeného programu včetně aplikace GUI rozhraní. V něm jsou implementovány
%volací řetězce na jednotlivé vytvořené funkce.

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @program_OpeningFcn, ...
                   'gui_OutputFcn',  @program_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before program is made visible.
function program_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to program (see VARARGIN)

% Choose default command line output for program
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes program wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = program_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global cesta
global original
global tlacitko
global tabulka_zmen
global stisknuto
tabulka_zmen=struct('original',1,'PSF',1,'SNR',1,'filtr',1,'spektrum',1,'metoda',0);
tlacitko=1;
stisknuto=0;
[FileName,PathName]=uigetfile( ...
{'*.bmp;*.jpg;*.tif;*.png;*.gif;*.mat','Data Files (*.mat,*.bmp,*.jpg,*.tif,*.png,*gif)';
'*.mat','MAT file(*.mat)'; ...   
'*.bmp',  'Bitmap (*.bmp)'; ...
   '*.jpg','JPEG (*.jpg)'; ...
   '*.tif','TIFF (*.tif)'; ...
   '*.png','PNG (*.png)'; ...
   '*.gif','GIFF (*.gif)'; ...
   '*.*',  'All Files (*.*)'}, ...
   'Vyberte obraz určený k restauraci');
if strcmp(FileName(end-3:end),'.mat');
    original=(load_variable_from_MAT(FileName)); %založeno z důvodu načítání .mat souboru, aby se omylem nepřepsaly stejnojmenné proměnné
    original=original./max(max(original));
else
cesta=[PathName FileName];
original=im2double(rgb2gray(imread(cesta)));
end
axes(handles.axes1);
imshow(original,[]);
tabulka_zmen.original=1;

% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global cestaPSF
global originalPSF
global tabulka_zmen
[FileNamePSF,PathNamePSF]=uigetfile( ...
{'*.bmp;*.jpg;*.tif;*.png;*.gif;*.mat','Data Files (*.mat,*.bmp,*.jpg,*.tif,*.png,*gif)';
'*.mat','MAT file(*.mat)'; ...   
'*.bmp',  'Bitmap (*.bmp)'; ...
   '*.jpg','JPEG (*.jpg)'; ...
   '*.tif','TIFF (*.tif)'; ...
   '*.png','PNG (*.png)'; ...
   '*.gif','GIFF (*.gif)'; ...
   '*.*',  'All Files (*.*)'}, ...
   'Vyberte zkreslující PSF');
if strcmp(FileNamePSF(end-3:end),'.mat');
    originalPSF=load_variable_from_MAT(FileNamePSF); %založeno z důvodu načítání .mat souboru, aby se omylem nepřepsaly stejnojmenné proměnné
else
cestaPSF=[PathNamePSF FileNamePSF];
originalPSF=im2double(rgb2gray(imread(cestaPSF)));
end
axes(handles.axes3);
imshow(originalPSF,[]);
tabulka_zmen.PSF=1;

% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global original
global tlacitko
tlacitko=1;
axes(handles.axes1);
imshow(original,[])

% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global original
global originalPSF
global hm1
global hodnotahm1
global hm2
global hodnotahm2
global dm1
global hodnotadm1
global dm2
global hodnotadm2
global tlacitko
global J
global tabulka_zmen
global Hinv
if isempty(original)
    disp('CHYBA: Nezadali jste vstupní obraz určený k restauraci')
    return
end
if isempty(originalPSF)
        disp('CHYBA: Nezadali jste zkreslující PSF')
    return
end

tlacitko=2;
if tabulka_zmen.original==1 | tabulka_zmen.PSF==1 | tabulka_zmen.filtr==1 | tabulka_zmen.metoda~=1
[J,Hinv] = inverzni_filtrace(original,originalPSF,hm1,hodnotahm1,hm2,hodnotahm2,dm1,hodnotadm1,dm2,hodnotadm2);
end
tabulka_zmen.original=0;
tabulka_zmen.PSF=0;
tabulka_zmen.filtr=0;
tabulka_zmen.metoda=1;
Hinv_pomoc=fftshift(Hinv);
prurezHinv=real(Hinv_pomoc(:,ceil(size(Hinv,2)/2)));
axes(handles.axes1);
imshow(J,[])
axes(handles.axes2);
plot(linspace(-max(size(prurezHinv,1))/2,max(size(prurezHinv,1))/2,size(Hinv,1)),prurezHinv)
axis([-max(size(prurezHinv,1))/2 max(size(prurezHinv,1))/2 min(prurezHinv)-abs((min(prurezHinv)/100)*10) max(prurezHinv)+(max(prurezHinv)/100)*10])

% --- Executes on button press in pushbutton4.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global original
global originalPSF
global SNR
global hm1
global hodnotahm1
global hm2
global hodnotahm2
global dm1
global hodnotadm1
global dm2
global hodnotadm2
global G
global tlacitko
global Hinv
global tabulka_zmen
tlacitko=3;
if isempty(original)
    disp('CHYBA: Nezadali jste vstupní obraz určený k restauraci')
    return
end
if isempty(originalPSF)
        disp('CHYBA: Nezadali jste zkreslující PSF')
    return
end
    if isempty(SNR)
        NSR=0;
    else
NSR=1/(SNR);
    end
    if tabulka_zmen.original==1 | tabulka_zmen.PSF==1 |  tabulka_zmen.SNR==1 | tabulka_zmen.metoda~=2 | tabulka_zmen.filtr==1
[G,Hinv]=wiener(original,originalPSF,NSR,hm1,hodnotahm1,hm2,hodnotahm2,dm1,hodnotadm1,dm2,hodnotadm2);
    end

tabulka_zmen.original=0;
tabulka_zmen.PSF=0;
tabulka_zmen.filtr=0;
tabulka_zmen.SNR=0;
tabulka_zmen.metoda=2;
Hinv_pomoc=fftshift(Hinv);
prurezHinv=real(Hinv_pomoc(:,ceil(size(Hinv,2)/2)));
axes(handles.axes1);
imshow(G,[])
axes(handles.axes2);
plot(linspace(-max(size(prurezHinv,1))/2,max(size(prurezHinv,1))/2,size(Hinv,1)),prurezHinv)
axis([-max(size(prurezHinv,1))/2 max(size(prurezHinv,1))/2 min(prurezHinv)-abs((min(prurezHinv)/100)*10) max(prurezHinv)+(max(prurezHinv)/100)*10])


function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global SNR
global tabulka_zmen
SNR=str2num(get(hObject,'String'));
tabulka_zmen.SNR=1;


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hm1
global tabulka_zmen
tabulka_zmen.filtr=1;
hm1=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hodnotahm1
global tabulka_zmen
tabulka_zmen.filtr=1;
hodnotahm1=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hm2
global tabulka_zmen
tabulka_zmen.filtr=1;
hm2=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit7_Callback(hObject, eventdata, handles)
% hObject    handle to edit7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hodnotahm2
global tabulka_zmen
tabulka_zmen.filtr=1;
hodnotahm2=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit8_Callback(hObject, eventdata, handles)
% hObject    handle to edit8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global dm1
global tabulka_zmen
tabulka_zmen.filtr=1;
dm1=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit9_Callback(hObject, eventdata, handles)
% hObject    handle to edit9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hodnotadm1
global tabulka_zmen
tabulka_zmen.filtr=1;
hodnotadm1=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit10_Callback(hObject, eventdata, handles)
% hObject    handle to edit10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global dm2
global tabulka_zmen
tabulka_zmen.filtr=1;
dm2=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit11_Callback(hObject, eventdata, handles)
% hObject    handle to edit11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global hodnotadm2
global tabulka_zmen
tabulka_zmen.filtr=1;
hodnotadm2=str2num(get(hObject,'String'));

% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global tabulka_zmen
ano_ne=get(hObject,'Value');
if ano_ne==1
set(findobj('Tag','edit2'),'Enable','on');
set(findobj('Tag','edit3'),'Enable','on');
set(findobj('Tag','edit8'),'Enable','on');
set(findobj('Tag','edit9'),'Enable','on');
else
set(findobj('Tag','edit2'),'Enable','off');
set(findobj('Tag','edit3'),'Enable','off');
set(findobj('Tag','edit8'),'Enable','off');
set(findobj('Tag','edit9'),'Enable','off');
set(findobj('Tag','edit2'),'String','');
set(findobj('Tag','edit3'),'String','');
set(findobj('Tag','edit8'),'String','');
set(findobj('Tag','edit9'),'String','');
edit2_Callback(hObject, eventdata, handles);
edit3_Callback(hObject, eventdata, handles);
edit8_Callback(hObject, eventdata, handles);
edit9_Callback(hObject, eventdata, handles);
end
tabulka_zmen.filtr=1;

% --- Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global tabulka_zmen
tabulka_zmen.filtr=1;
ano_ne=get(hObject,'Value');
if ano_ne==1
set(findobj('Tag','edit5'),'Enable','on');
set(findobj('Tag','edit7'),'Enable','on');
set(findobj('Tag','edit10'),'Enable','on');
set(findobj('Tag','edit11'),'Enable','on');
else
set(findobj('Tag','edit5'),'Enable','off');
set(findobj('Tag','edit7'),'Enable','off');
set(findobj('Tag','edit10'),'Enable','off');
set(findobj('Tag','edit11'),'Enable','off');
set(findobj('Tag','edit5'),'String','');
set(findobj('Tag','edit7'),'String','');
set(findobj('Tag','edit10'),'String','');
set(findobj('Tag','edit11'),'String','');
edit5_Callback(hObject, eventdata, handles);
edit7_Callback(hObject, eventdata, handles);
edit10_Callback(hObject, eventdata, handles);
edit11_Callback(hObject, eventdata, handles);
end

% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global tlacitko
global J
global G
global original
global zkresleny
global Lucy
if tlacitko==1
    ukladanyobraz=original;
elseif tlacitko==2
    ukladanyobraz=J;
elseif tlacitko==3
    ukladanyobraz=G;
elseif tlacitko==4
    ukladanyobraz=zkresleny;
elseif tlacitko==5
    ukladanyobraz=Lucy;
end
%invertování šedotónové stupnice
ukladanyobrazpos=zeros(size(ukladanyobraz));
ukladanyobrazneg=zeros(size(ukladanyobraz));
ukladanyobrazneg(ukladanyobraz<0)=abs(ukladanyobraz(ukladanyobraz<0));
ukladanyobrazpos(ukladanyobraz>0)=-(ukladanyobraz(ukladanyobraz>0));
ukladanyobraz=ukladanyobrazneg+ukladanyobrazpos;

figure(1)
imshow(ukladanyobraz,[])
saveas(1,'ulozeny_obraz.tiff')
close 1


% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global original
global originalPSF
global tlacitko
global tabulka_zmen
global Lucy
if isempty(original)
    disp('CHYBA: Nezadali jste vstupní obraz určený k restauraci')
    return
end
if isempty(originalPSF)
        disp('CHYBA: Nezadali jste zkreslující PSF')
    return
end
tabulka_zmen.metoda=3;
tlacitko=5;

Lucy=deconvlucy(original,originalPSF);
axes(handles.axes1);
imshow(Lucy,[])
axes(handles.axes2)
plot([0],[0])


% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handglobal zkresleny
global original
global originalPSF
global hm1
global hodnotahm1
global hm2
global hodnotahm2
global dm1
global hodnotadm1
global dm2
global hodnotadm2
global G
global tlacitko
global Hinv
global tabulka_zmen
global S_n
global S_y
global stisknuto
global prumer_sum
global prumer_obraz
if isempty(original)
    disp('CHYBA: Nezadali jste vstupní obraz určený k restauraci')
    return
end
if isempty(originalPSF)
        disp('CHYBA: Nezadali jste zkreslující PSF')
    return
end
tlacitko=3;
set(findobj('Tag','text10'),'Visible','on');
set(findobj('Tag','pushbutton13'),'Visible','on');
set(findobj('Tag','pushbutton14'),'Visible','on');
disp('čekám na volbu')
while stisknuto~=1
      pause(2)
end  
disp('volba provedena')
if tabulka_zmen.spektrum==1 
set(findobj('Tag','text11'),'Visible','on');   
pause(1)
S_n=sektorovaFFT(prumer_sum);
S_y=sektorovaFFT(prumer_obraz);
set(findobj('Tag','text11'),'Visible','off');
[G,Hinv]=wiener_v2(original,S_n,S_y,originalPSF,hm1,hodnotahm1,hm2,hodnotahm2,dm1,hodnotadm1,dm2,hodnotadm2);
elseif  tabulka_zmen.original==1 | tabulka_zmen.PSF==1 | tabulka_zmen.metoda~=4 | tabulka_zmen.filtr==1
[G,Hinv]=wiener_v2(original,S_n,S_y,originalPSF,hm1,hodnotahm1,hm2,hodnotahm2,dm1,hodnotadm1,dm2,hodnotadm2);
else
    disp('Chyba volby, neproběhl žádný výpočet')
end
tabulka_zmen.metoda=4;
tabulka_zmen.original=0;
tabulka_zmen.PSF=0;
tabulka_zmen.filtr=0;
tabulka_zmen.SNR=0;
tabulka_zmen.spektrum=0;
stisknuto=0;
Hinv_pomoc=fftshift(Hinv);
prurezHinv=real(Hinv_pomoc(:,ceil(size(Hinv,2)/2)));
axes(handles.axes1);
imshow(G,[])
axes(handles.axes2);
plot(linspace(-max(size(prurezHinv,1))/2,max(size(prurezHinv,1))/2,size(Hinv,1)),prurezHinv)
axis([-max(size(prurezHinv,1))/2 max(size(prurezHinv,1))/2 min(prurezHinv)-abs((min(prurezHinv)/100)*10) max(prurezHinv)+(max(prurezHinv)/100)*10])


% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global tabulka_zmen
global prumer_sum
global prumer_obraz
global stisknuto
[prumer_sum,prumer_obraz]=nacitani_prumernych_obrazu;
    tabulka_zmen.spektrum=1;

    set(findobj('Tag','text10'),'Visible','off');
set(findobj('Tag','pushbutton13'),'Visible','off');
set(findobj('Tag','pushbutton14'),'Visible','off');
stisknuto=1;

% --- Executes on button press in pushbutton14.
function pushbutton14_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global stisknuto
set(findobj('Tag','text10'),'Visible','off');
set(findobj('Tag','pushbutton13'),'Visible','off');
set(findobj('Tag','pushbutton14'),'Visible','off');
stisknuto=1;
