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: xASL_module_Population.m
    path of file: ./repos/ExploreASL/Modules
    
    the code of the file until where you have to start completion: function [result, x] = xASL_module_Population(x)
%xASL_module_Population ExploreASL module for population-based/group-based processing
%
% FORMAT: [result, x] = xASL_module_Population(x)
%
% INPUT:
%   x       - x structure containing all input parameters (REQUIRED)
%
% OUTPUT:
%   result  - true for successful run of this module, false for insuccessful run
%   x       - x structure containing all output parameters
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This ExploreASL module processes all available images on the
% group level. It assumes that all images were adequately processed in the
% previous modules. It will perform the following group-wise processing and
% checks:
%
% - `010_CreatePopulationTemplates` - Create population average images, to compare scanners, cohorts etc without physiological variance
% - `020_CreateAnalysisMask`        - Generate a group-level mask by combining individuals masks, for ROI-based analysis & VBA

    
function [result, x] = xASL_module_Population(x)
%xASL_module_Population ExploreASL module for population-based/group-based processing
%
% FORMAT: [result, x] = xASL_module_Population(x)
%
% INPUT:
%   x       - x structure containing all input parameters (REQUIRED)
%
% OUTPUT:
%   result  - true for successful run of this module, false for insuccessful run
%   x       - x structure containing all output parameters
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This ExploreASL module processes all available images on the
% group level. It assumes that all images were adequately processed in the
% previous modules. It will perform the following group-wise processing and
% checks:
%
% - `010_CreatePopulationTemplates` - Create population average images, to compare scanners, cohorts etc without physiological variance
% - `020_CreateAnalysisMask`        - Generate a group-level mask by combining individuals masks, for ROI-based analysis & VBA
% - `030_CreateBiasfield`           - When there are multiple scanners, create scanner-specific biasfields (uses Site.mat for this)
% - `040_GetDICOMStatistics`        - Create TSV file with overview of DICOM parameters
% - `050_GetVolumeStatistics`       - Create TSV file with overview of volumetric parameters
% - `060_GetMotionStatistics`       - Create TSV file with overview of motion parameters
% - `065_GetRegistrationStatistics` - Create TSV file with overview of the registration statistics
% - `070_GetROIstatistics`          - Create TSV file with overview of regional values (e.g. qCBF, mean control, pGM etc)
% - `080_SortBySpatialCoV`          - Sort ASL_Check QC images by their spatial CoV in quality bins
% - `090_DeleteTempFiles`           - Delete temporary files
% - `100_GZipAllFiles`              - Zip files to reduce disc space usage of temporary and non-temporay NIfTI files
%
% EXAMPLE: [~, x] = xASL_module_Population(x);
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% Copyright 2015-2023 ExploreASL



%% ------------------------------------------------------------------------------------------------------------
%% Admin
[x] = xASL_init_SubStructs(x);

% Input check
if x.opts.nWorkers>1 % don't run population module when ExploreASL is parallelized
    warning('Population module should not run in parallel, skipping...');
    result = true;
    return;
end