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: extract_indiv_peak_data.m
    path of file: ./repos/CanlabCore/CanlabCore/Data_extraction
    
    the code of the file until where you have to start completion: function cl = extract_indiv_peak_data(cl,imgs)
% Purpose: to find individually significant regions within each subject
% and save average timecourses for each individual ROI for each subject
%
% :Usage:
% ::
%
%    cl = extract_indiv_peak_data(cl,imgs)
%

    
function cl = extract_indiv_peak_data(cl,imgs)
% Purpose: to find individually significant regions within each subject
% and save average timecourses for each individual ROI for each subject
%
% :Usage:
% ::
%
%    cl = extract_indiv_peak_data(cl,imgs)
%
% :Inputs:
%
%   **cl:**
%        is a clusters structure with one element per region.  Each element
%        (cluster) is a structure containing coordinates and data.
%
%   **imgs:**
%        is a string matrix with one row per subject, with names of images
%        used to define thresholds.  These may be contrast or t-images from
%        individual subjects
% 
% The method of extraction is defined in cluster_tmask, which is currently
% to use 50% of voxels with the highest values in imgs(subject) for each
% subject, or 100% if 50% returns less than 5 voxels.  
% It's easy in cluster_tmask to use absolute t-thresholds instead.
%
% :Required fields of cl:
%
%   **XYZmm:**
%        3 x k list of k coordinates in mm space
%
%   **raw_data:**
%        time x voxels x subjects matrix of data for this region
%
% Outputs append