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_qc_CollectParameters.m
    path of file: ./repos/ExploreASL/Functions/QualityControl
    
    the code of the file until where you have to start completion: function x = xASL_qc_CollectParameters(x, iSubject, ScanType)
%xASL_qc_CollectParameters Collect all parameters from structural & ASL, spread over the derivative folders
%
% FORMAT: x = xASL_qc_CollectParameters(x, iSubject, ScanType, CollectQCFunction)
%
% INPUT:
%   x                   - structure containing fields with all information required to run this submodule (REQUIRED)
%   iSubject            - index of current subject (REQUIRED)
%   ScanType            - string for ScanType, options = 'Structural' 'ASL' 'func' 'dwi' (REQUIRED)
%
% OUTPUT:
%   x                   - same as input
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This function collects QC parameters for a module.
% 

    
function x = xASL_qc_CollectParameters(x, iSubject, ScanType)
%xASL_qc_CollectParameters Collect all parameters from structural & ASL, spread over the derivative folders
%
% FORMAT: x = xASL_qc_CollectParameters(x, iSubject, ScanType, CollectQCFunction)
%
% INPUT:
%   x                   - structure containing fields with all information required to run this submodule (REQUIRED)
%   iSubject            - index of current subject (REQUIRED)
%   ScanType            - string for ScanType, options = 'Structural' 'ASL' 'func' 'dwi' (REQUIRED)
%
% OUTPUT:
%   x                   - same as input
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This function collects QC parameters for a module.
% 
% EXAMPLE: x = xASL_qc_CollectParameters_Structural(x, 10, 'ASL');
% __________________________________
% Copyright (C) 2015-2019 ExploreASL


%% -----------------------------------------------------------------------------------------------
%% Admin
fclose all;

fprintf('Collecting QC parameters...\n');

if nargin<3 || isempty(ScanType)
    % Run collecting and saving for all
    error('Missing ScanType...');
end