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: ica_fuse_write_parallel_ica_comp.m
    path of file: ./repos/fit/FITv2.0e/ica_fuse/ica_fuse_parallelICA
    
    the code of the file until where you have to start completion: function outputFiles = ica_fuse_write_parallel_ica_comp(aveComp, loadingCoeff, dataInfo, mask_ind, outFile, outputDir, numSubjects)
% Write parallel ICA components based on global variable
% PARALLEL_ICA_COMPONENT_NAMING.
%
% Input:
% 1. aveComp - Parallel ICA components data. It is a cell array of length
% equal to number of modalities involved.
% 2. loadingCoeff - Loading coefficients of each modality.
% 3. dataInfo - dataInfo structure

    
function outputFiles = ica_fuse_write_parallel_ica_comp(aveComp, loadingCoeff, dataInfo, mask_ind, outFile, outputDir, numSubjects)
% Write parallel ICA components based on global variable
% PARALLEL_ICA_COMPONENT_NAMING.
%
% Input:
% 1. aveComp - Parallel ICA components data. It is a cell array of length
% equal to number of modalities involved.
% 2. loadingCoeff - Loading coefficients of each modality.
% 3. dataInfo - dataInfo structure
% 4. mask_ind - Mask indices
% 5. outFile - Output file naming
% 6. outputDir - Output directory to save the images
% 7. numSubjects - Number of subjects for each group
%
% Output:
% outputFiles - Output file names

% Load defaults
ica_fuse_defaults;

global MRI_DATA_FILTER;
global GENE_DATA_FILTER;
global EEG_DATA_FILTER;
global FLIP_SIGN_COMPONENTS;
global BEH_DATA_FILTER;

% Modalities and feature names
modalities = cellstr(str2mat(dataInfo(1).feature.modality));
featureNames = cellstr(str2mat(dataInfo(1).feature.name));


loadingCoeffV = ica_fuse_getVol(which('nsingle_subj_T1_2_2_5.nii'));

% Loop over feature names
for nF = 1:length(featureNames)
    if strcmpi(modalities{nF}, 'fmri') || strcmpi(modalities{nF}, 'smri')
        % Loop over components
        for nComp = 1:size(aveComp{nF}, 1)
            [fileIndex] = ica_fuse_returnFileIndex(nComp);
            % Current component
            currentData = aveComp{nF}(nComp, :);
            
            tmpImF = ica_fuse_parseExtn(deblank(dataInfo(1).feature(nF).files(1).name(1, :)));
            
            if ~strcmpi(tmpImF(end