1515 % License: Open Source under GPLv3
1616 % Contact: sandra.vanaert@uantwerpen.be
1717 % --------------------------------------------------------------------------
18- global thr d_min sigma xy hpf gr_cm cdat_0
18+ global thr d_min sigma xy hpf gr_cm cdat_0 ver
19+ % Determine Matlab version for compatibility
20+ ver = version(' -release' );
21+ ver = str2double(ver(1 : 4 ));
22+
1923 obs = obj .obs ;
2024 [ny ,nx ] = size(obs );
2125
5357 cdat = cdat_0 ;
5458 cdat(1 : 32 ) = sin(linspace(0 ,pi ,32 ));
5559 imagesc(hpf .par .wb ,cdat ); axis off ; colormap(gr_cm ); caxis([0 1 ]);
56- hpf.par.wb.Toolbar = [];
60+ if ver >= 2019
61+ hpf.par.wb.Toolbar = [];
62+ end
5763
5864 % Info panel
5965 hpf.help.pan = uipanel(' Parent' ,hpf .par .pan ,' units' ,' normalized' ,' Position' ,[0.62 0.3 0.38 - br 0.6 ],' ShadowColor' ,[0 0 0 ],' ForegroundColor' ,[0 0 0 ],' HighlightColor' ,[0.95 0.95 0.95 ],' BackgroundColor' ,[0.8 0.8 0.8 ]);
7177 est_lim_s = mean(nx ,ny )*0.1 ;
7278 SliderSi = uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' slider' ,' units' ,' normalized' ,' Position' ,[br 0.38 0.2 0.15 ],' Min' ,3 ,' Max' ,est_lim_s );
7379 uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' text' ,' String' ,' Estimated Radius (px):' ,' units' ,' normalized' ,' Position' ,[br 0.8 0.2 0.15 ],' FontSize' ,10 ,' HorizontalAlignment' ,' left' ,' BackgroundColor' ,[0.8 0.8 0.8 ]);
74- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[br 0.27 0.01 0.1],'String',num2str(3,0),'BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','right');
75- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[0.2 0.27 0.01 0.1],'String',num2str(est_lim_s,1),'BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','left');
7680
7781 % Threshold
7882 SliderTh = uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' slider' ,' units' ,' normalized' ,' Position' ,[br + 0.2 0.38 0.2 0.15 ],' Min' ,0 ,' Max' ,1 );
7983 uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' text' ,' String' ,' Threshold value:' ,' units' ,' normalized' ,' Position' ,[br + 0.2 0.8 0.2 0.15 ],' FontSize' ,10 ,' HorizontalAlignment' ,' left' ,' BackgroundColor' ,[0.8 0.8 0.8 ]);
80- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[br+0.2 0.27 0.01 0.1],'String','0','BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','right');
81- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[0.4 0.27 0.01 0.1],'String','1','BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','left');
8284
8385 % Peak Distance
84- est_lim_d = mean(nx ,ny )*0.1 ;
86+ est_lim_d = mean(nx ,ny )*0.2 ;
8587 SliderDm = uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' slider' ,' units' ,' normalized' ,' Position' ,[br + 0.4 0.38 0.2 0.15 ],' Min' ,0 ,' Max' ,est_lim_d );
8688 uicontrol(' Parent' ,hpf .par .pan ,' Style' ,' text' ,' String' ,' Minimum Distance (px):' ,' units' ,' normalized' ,' Position' ,[br + 0.4 0.8 0.2 0.15 ],' FontSize' ,10 ,' HorizontalAlignment' ,' left' ,' BackgroundColor' ,[0.8 0.8 0.8 ]);
87- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[br+0.4 0.27 0.01 0.1],'String','0','BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','right');
88- % uicontrol('Parent',hpf.par.pan,'Style','text','units','normalized','Position',[0.6 0.27 0.01 0.1],'String','1','BackgroundColor',[0.8 0.8 0.8],'HorizontalAlignment','left');
8989
9090 % Textboxes %
9191 % %%%%%%%%%%%%%%%%%
@@ -236,7 +236,9 @@ function deleteFigure(hObject,~)
236236 function waitbar_out()
237237 hpf.par.wb.Children.CData = cdat_0 ;
238238 set(hpf .par .wb ,' visible' ,' off' )
239- hpf.par.wb.Colormap = gr_cm ;
239+ if ver >= 2019
240+ hpf.par.wb.Colormap = gr_cm ;
241+ end
240242 drawnow ;
241243 end
242244
@@ -247,17 +249,18 @@ function waitbar_out()
247249 timerDat.n_tick = 1 ;
248250 timerObject = timer(' TimerFcn' ,@tick ,...
249251 ' ExecutionMode' ,' fixedRate' ,...
250- ' Period' ,0.01 ,...
252+ ' Period' ,0.05 ,...
251253 ' UserData' , timerDat );
252254 start(timerObject );
253255
254256 function tick(timerObj ,event )
255-
256257 timerData = get(timerObj , ' UserData' );
257258 im = timerData .im_dat ;
258- im = circshift(im ,timerData .n_tick ,2 );
259+ im = circshift(im ,timerData .n_tick * 5 ,2 );
259260 timerData.axes.Children.CData = im ;
260- timerData.axes.Colormap = gr_cm ;
261+ if ver >= 2019
262+ timerData.axes.Colormap = gr_cm ;
263+ end
261264 timerData.n_tick = timerData .n_tick + 1 ;
262265 set(timerObj , ' UserData' , timerData );
263266 drawnow
0 commit comments