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: demo_1p_low_RAM.m
    path of file: ./repos/NoRMCorre
    
    the code of the file until where you have to start completion: % demo file for applying the NoRMCorre motion correction algorithm on 
% 1-photon widefield imaging data using low memory (good for long datasets)
% Example file i
    
function does not load the whole file in memory. Instead it loads 
% chunks of the file and then saves the high pass filtered version in a 
% h5 file.

gSig = 7; 
gSiz = 3*gSig; 
psf = fspecial('gaussian', round(2*gSiz), gSig);
ind_nonzero = (psf(:)>=max(psf(:,1)));
psf = psf-mean(psf(ind_nonzero));
psf(~ind_nonzero) = 0;   % only use pixels within the center disk

[filepath,file_name,ext] = fileparts(name);
h5_name = fullfile(filepath,[file_name,'_filtered_data.h5']);
chunksize = 750;    % read 500 frames at a time
cnt = 1;
while (1)  % read filter and save file in chunks
    Yf = single(read_file(name,cnt,chunksize));
    if isempty(Yf)
        break
    else
        Y = imfilter(Yf,psf,'symmetric');
        saveash5(Y,h5_name);
        cnt = cnt + size(Y,ndims(Y));
    end