@@ -266,18 +266,13 @@ function load_traj_buttom_Callback(hObject, eventdata, handles)
266266 else
267267 % Ask if the user wish to create animal groups
268268 choice = questdlg(' Would you like to assign animals to groups?' , ...
269- ' Assign Animals to Groups' ,' Yes' ,' No' ,' No' );
269+ ' Assign Animals to Groups' ,' Yes' ,' No' ,' No' );
270+ % set current GUI visibility to off
271+ temp = findall(gcf );
272+ set(temp ,' Visible' ,' off' );
270273 switch choice
271- case ' Yes'
272- % set current GUI visibility to off
273- temp = findall(gcf );
274- set(temp ,' Visible' ,' off' );
275- [groups_path ] = animal_groups(paths , get(handles .field_id ,' String' ), str2num(get(handles .text_sessions ,' String' )));
276- % resume main GUI visibility
277- set(temp ,' Visible' ,' on' );
278- if isempty(groups_path )
279- return ;
280- end
274+ case ' Yes'
275+ [groups_path ] = animal_groups(paths , get(handles .field_id ,' String' ), str2num(get(handles .text_sessions ,' String' )));
281276 case ' No'
282277 groups_path = {};
283278 disp(' No animal groups specified. All animals will belong to group 1' );
@@ -318,8 +313,18 @@ function load_traj_buttom_Callback(hObject, eventdata, handles)
318313 % compute segments and features
319314 segmentation_configs = config_segments(user_input );
320315 if isempty(segmentation_configs .TRAJECTORIES )
316+ % resume main GUI visibility
317+ set(temp ,' Visible' ,' on' );
318+ if isempty(groups_path )
319+ return ;
320+ end
321321 return ;
322322 end
323+ % resume main GUI visibility
324+ set(temp ,' Visible' ,' on' );
325+ if isempty(groups_path )
326+ return ;
327+ end
323328 % check if object is already cached and if not save it
324329 rpath = check_cached_objects(segmentation_configs ,1 );
325330 set(handles .seg_path ,' String' ,rpath );
0 commit comments