You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mask_automask_generate_all_Callback.m
    path of file: ./repos/PIVlab/+mask_NameSpace
    
    the code of the file until where you have to start completion: function mask_automask_generate_all_Callback (~,~,~)
handles=gui_NameSpace.gui_gethand;

    
function mask_automask_generate_all_Callback (~,~,~)
handles=gui_NameSpace.gui_gethand;
filepath=gui_NameSpace.gui_retr('filepath');
if size(filepath,1) > 1 %did the user load images?
	handles=gui_NameSpace.gui_gethand;
	if gui_NameSpace.gui_retr('video_selection_done') == 0
		num_frames_to_process=floor(size(filepath,1)/2)+1;
	else
		video_frame_selection=gui_NameSpace.gui_retr('video_frame_selection');
		num_frames_to_process=floor(numel(video_frame_selection)/2)+1;
	end