function visualiseBatchResults(batchresults)
cd (fileparts(which(mfilename('full'))));
fig=figure(10);clf;
set(fig,'Name','McTools: Dune Erosion Result Visualisor','NumberTitle','Off','Units','normalized','position',[0    0.5000    0.5000    0.4388]);
set(fig,'menubar','none');
set(fig,'toolbar','figure');
set(fig,'units','pixels');

%%
% box_x=20;
% box_y=20;
% box_w=990;
% box_h=160;
% 
% hp = uipanel('Title','UCIT','Units','pixels','Position',[box_x box_y box_w box_h],'Tag','UIControl');
position = [-3 33 875 550];%% set transects popups
box_x=position(3)-30-21-30;box_y=position(4)-195;box_w=210;box_h=135;
hp = uipanel('Title','Transects','Units','pixels','Position',[box_x box_y box_w box_h],'Tag','UIControl');
box_w=100;box_h=15;
handles.Transects1text= uicontrol(gcf,'UserData','UIControl','Style','text',     'String','Datatype:'                  ,   'Position',[box_x+05 box_y+100 box_w box_h],'HorizontalAlignment','left');
handles.Transects1    = uicontrol(gcf,'UserData','UIControl','Style','popupmenu','String','Jarkus Data'                ,   'Position',[box_x+85 box_y+100 box_w box_h],'HorizontalAlignment','right','BackgroundColor',[1 1 1],'Tag','TransectsDatatype',     'callback','UCIT_DC_loadRelevantInfo2Popup(1,2);');
handles.Transects2text= uicontrol(gcf,'UserData','UIControl','Style','text',     'String','Area:'                      ,   'Position',[box_x+05 box_y+80  box_w box_h],'HorizontalAlignment','left');
handles.Transects2    = uicontrol(gcf,'UserData','UIControl','Style','popupmenu','String','Noord-Holland'              ,   'Position',[box_x+85 box_y+80  box_w box_h],'HorizontalAlignment','right','BackgroundColor',[1 1 1],'Tag','TransectsArea',         'callback','UCIT_DC_loadRelevantInfo2Popup(1,3);');
handles.Transects3text= uicontrol(gcf,'UserData','UIControl','Style','text',     'String','Transect ID:'               ,   'Position',[box_x+05 box_y+60  box_w box_h],'HorizontalAlignment','left');
handles.Transects3    = uicontrol(gcf,'UserData','UIControl','Style','popupmenu','String','04000'                      ,   'Position',[box_x+85 box_y+60  box_w box_h],'HorizontalAlignment','right','BackgroundColor',[1 1 1],'Tag','TransectsTransectID',   'callback','UCIT_DC_loadRelevantInfo2Popup(1,4);');
handles.Transects4text= uicontrol(gcf,'UserData','UIControl','Style','text',     'String','Sounding ID:'               ,   'Position',[box_x+05 box_y+40  box_w box_h],'HorizontalAlignment','left');
handles.Transects4    = uicontrol(gcf,'UserData','UIControl','Style','popupmenu','String','2006'                       ,   'Position',[box_x+85 box_y+40  box_w box_h],'HorizontalAlignment','right','BackgroundColor',[1 1 1],'Tag','TransectsSoundingID');
handles.Transects5text= uicontrol(gcf,'UserData','UIControl','Style','text',     'String','Actions:'                   ,   'Position',[box_x+05 box_y+20  box_w box_h],'HorizontalAlignment','left');
handles.Transects5    = uicontrol(gcf,'UserData','UIControl','Style','popupmenu','String','displayTransectsOnOverview' ,   'Position',[box_x+85 box_y+20  box_w box_h],'HorizontalAlignment','right','BackgroundColor',[1 1 1],'Tag','TrActions',            'callback','UCIT_DC_takeAction(1);');

%%

xh=axis
set(gca,'units','pixels')
set(gca,'position',[50 50 725 675])
box on


tbh = findall(fig,'Type','uitoolbar');

% Zoom buttons

t=(findall(tbh,'TooltipString','Zoom In'));
str='h=findall(gcf,''Tag'',''UIToggleToolEditFigure'');set(h,''State'',''off'');putdowntext(''zoomin'',gcbo)';
set(t,'ClickedCallback',str);set(t,'cdata',makeIcon(['icons\zoom-in-32x322.bmp'],20));

t=(findall(tbh,'TooltipString','Zoom Out'));
str='h=findall(gcf,''Tag'',''UIToggleToolEditFigure'');set(h,''State'',''off'');putdowntext(''zoomout'',gcbo)';
set(t,'ClickedCallback',str);set(t,'cdata',makeIcon(['icons\zoom-out-32x322.bmp'],20));

% Delete non-used buttons

delete(findall(tbh,'TooltipString','New Figure'));
delete(findall(tbh,'TooltipString','Open File'));
delete(findall(tbh,'TooltipString','Save Figure'));
delete(findall(tbh,'TooltipString','Print Figure'));
delete(findall(tbh,'TooltipString','Data Cursor'));
delete(findall(tbh,'TooltipString','Insert Colorbar'));
delete(findall(tbh,'TooltipString','Insert Legend'));
delete(findall(tbh,'TooltipString','Hide Plot Tools'));
delete(findall(tbh,'TooltipString','Show Plot Tools'));
delete(findall(tbh,'TooltipString','Rotate 3D'));
delete(findall(tbh,'TooltipString','Pan'));

% Add buttons

adj = uipushtool(tbh,'Separator','on','HandleVisibility','on','ToolTipString','UpperBoundary');
set(adj,'ClickedCallback','redrawVolume(1)');
set(adj,'Tag','UpperBoundary');
set(adj,'cdata',makeIcon(['icons\up-32x322.bmp'],20));

adj = uipushtool(tbh,'Separator','on','HandleVisibility','on','ToolTipString','LowerBoundary');
set(adj,'ClickedCallback','redrawVolume(2)');
set(adj,'Tag','LowerBoundary');
set(adj,'cdata',makeIcon(['icons\up-32x322.bmp'],20));

adj = uipushtool(tbh,'Separator','on','HandleVisibility','on','ToolTipString','SeawardBoundary');
set(adj,'ClickedCallback','redrawVolume(4)');
set(adj,'Tag','SeawardBoundary');
set(adj,'cdata',makeIcon(['icons\up-32x322.bmp'],20));

adj = uipushtool(tbh,'Separator','on','HandleVisibility','on','ToolTipString','LandwardBoundary');
set(adj,'ClickedCallback','redrawVolume(3)');
set(adj,'Tag','LandwardBoundary');
set(adj,'cdata',makeIcon(['icons\up-32x322.bmp'],20));


if nargin==0
    d = readTransectData('Jarkus Data','Delfland','11109','2006');
    x=d.xe(~isnan(d.ze));
    z=d.ze(~isnan(d.ze));
end

x=squeeze(x);
z=squeeze(z);

plot(x,z);

[Volume, CoastlinePosition, result] = getTransectVolume(x,z);

plotTransectVolume(result,fig)
set(gca,'xdir','reverse')
set(gcf,'userdata',result)

