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_spm_admin.m
    path of file: ./repos/ExploreASL/External/SPMmodified/xASL
    
    the code of the file until where you have to start completion: function [pathOut] = xASL_spm_admin(pathIn, bPadComma1)
%xASL_spm_admin Manage SPM input path format
%
% FORMAT: xASL_spm_admin(pathIn[, bPadComma1])
%
% INPUT:
%   pathIn     - path to NifTI image, including full foldername and extension (REQUIRED)
%   bPadComma1 - boolean specifying if the ',1' is added, 
%                to assign the first image of an SPM 4D array (OPTIONAL, DEFAULT = FALSE)
%
% OUTPUT:
%   pathOut    - corrected path to NifTI image
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This SPM admin function takes a NIfTI path and does a few

    
function [pathOut] = xASL_spm_admin(pathIn, bPadComma1)
%xASL_spm_admin Manage SPM input path format
%
% FORMAT: xASL_spm_admin(pathIn[, bPadComma1])
%
% INPUT:
%   pathIn     - path to NifTI image, including full foldername and extension (REQUIRED)
%   bPadComma1 - boolean specifying if the ',1' is added, 
%                to assign the first image of an SPM 4D array (OPTIONAL, DEFAULT = FALSE)
%
% OUTPUT:
%   pathOut    - corrected path to NifTI image
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% DESCRIPTION: This SPM admin function takes a NIfTI path and does a few
% checks to make this valid to SPM. It accepts both .nii and .nii.gz.
% It runs the following steps:
%
% 1. Unzip .nii.gz
% 2. Convert char to cell
% 3. Add ',1' suffix
%
% -----------------------------------------------------------------------------------------------------------------------------------------------------
% EXAMPLE: xASL_spm_admin('/MyStudy/Subject1/T1.nii.gz');
% __________________________________
% Copyright 2015-2021 ExploreASL


    if nargin<1 || isempty(pathIn)
        error('Too few input arguments');
    elseif iscell(pathIn) && numel(pathIn)==1
        pathIn = pathIn{1};
    end