function nic_rsdd_displayComponent(appConfig,parameters)
        
        DETRENDNUMBER=3;
    
        compno=parameters.compNumbers;
        outDir=appConfig.outDir;
        outPrefix=appConfig.outPrefix;
        compNum=appConfig.compNum;
        runTimes=appConfig.runTimes;
        subjectNum=length(appConfig.AppSubjectLabels);

        
        % read the files and timecourses
        imageValues = parameters.returnValue; % image values
        
        parameters.imagevalues=imageValues;
        slicePlane = parameters.anatomicalplane; % slice plane
        sliceRange = parameters.slicerange; % slice range in mm
        numComp = parameters.numComp; % Number of components
        threshValue = parameters.thresholdvalue; % threshold value
%         compFiles = parameters.compFiles; % component files
        compNumbers = parameters.compNumbers; % component numbers
        convertToZ = parameters.convertToZ; % convert to z scores
        structuralFile = parameters.structFile; % structural file
        icaTimecourse=[];
        icasig=[];
        counter=0;
        numComp=subjectNum+3;
        for subji=1:numComp
            files_in_zip={};
            counter=counter+1;
             if(subji<4)
                zipFilePath=outDir;
                if(subji==1)
                    zipFileName=[outPrefix,'_mean_all_component_ica_'];            
                elseif(subji==2)
                    zipFileName=[outPrefix,'_tmap__component_ica_'];     
                elseif(subji==3)
                    zipFileName=[outPrefix,'_std__component_ica_'];   
                end
             else
                 subjectn=subji-3;
                labels=appConfig.AppSubjectLabels;
                ulabel=unique(labels);
                if(length(ulabel)>1)
                   ind=find(ulabel==labels(subjectn)); % fix a bug of naming error! Zhang Han 2012/5/23
                   zipFileName=sprintf([outPrefix,'_sub%03d_component_ica_s1_'],subjectn);
                   zipFilePath=fullfile(outDir,'output',sprintf('group%d',ind));
                else
                   zipFileName=sprintf([outPrefix,'_sub%03d_component_ica_s1_'],subjectn);
                   zipFilePath=fullfile(outDir,'output');
                end   
             end
             if(isunix)
                 zipFileName1=fullfile(zipFilePath,[zipFileName '.zip']);
                 zipfile=sprintf([zipFileName,'%03d.*'],compno);
                 system(['unzip -jqu ',zipFileName1,' ',zipfile,' -d ',zipFilePath]);
                 zipfile=sprintf([zipFileName,'.*'],compno);
                 zipfile=strrep(zipfile,'_component_ica_','_timecourses_ica_');
                 system(['unzip -jqu ',zipFileName1,' ',zipfile,' -d ',zipFilePath]);
             else
                  zipFileName1=fullfile(zipFilePath,[zipFileName '.zip']);
                 zipfile=sprintf([zipFileName,'%03d.*'],compno);
%                  system(['unzip -jqu ',zipFileName1,' ',zipfile,' -d ',zipFilePath]);
%                  nic_unzipFile(zipFileName1,zipfile,zipFilePath);
                 zipfile1=sprintf([zipFileName,'.*'],compno);
                 zipfile1=strrep(zipfile1,'_component_ica_','_timecourses_ica_');
%                  system(['unzip -jqu ',zipFileName1,' ',zipfile,' -d ',zipFilePath]);
                  nic_unzipFile(zipFileName1,zipfile,zipFilePath,zipfile1);
                 
             end
            
    %             icatb_unzip([zipFileName,'.zip'], zipFilePath);

    %         theFilenames = dir([zipFileName,'%.img']);
            zipFileName1=fullfile(zipFilePath,zipFileName);
            compFiles1=dir([zipFileName1,'*.img']);
            files_in_zip1=dir([zipFileName1,'*.hdr']);
            if(length(compFiles1)<1)
                compFiles1=dir([zipFileName1,'*.nii']);
            end
            volumnCount=length(compFiles1);
            compFiles=[];
            files_in_zip={};
            for ii=1:volumnCount
                  compFiles=[compFiles;fullfile(zipFilePath,compFiles1(ii).name)];
                  files_in_zip=[files_in_zip;fullfile(zipFilePath,compFiles1(ii).name)];
            end
            volumnCount=length(files_in_zip1);
             for ii=1:volumnCount
                 files_in_zip=[files_in_zip;fullfile(zipFilePath,files_in_zip1(ii).name)];
             end
              nic_waitbar(subji/numComp,sprintf('Loading the component\nplease wait...'), 'Component viewer','Child');
             compNumbers=[compno];
            [tempicasig, W, structuralImage, coords, HInfo, parameters.text_left_right] = nic_icatb_loadICAData('structFile', ...
                structuralFile, 'compFiles', compFiles, 'slicePlane', slicePlane, 'sliceRange', sliceRange, 'comp_numbers', ...
                compNumbers, 'convertToZ', convertToZ, 'returnValue', imageValues, 'threshValue', ...
                threshValue, 'dataType', 'real', 'complexInfo', [],'imreshape', 'no', 'open_dialog', 'no');
%              tempicasig=reshape(tempicasig,1,prod(size(tempicasig)));
            if(subji==1)
                icaTimecourse = zeros(size(W, 1), numComp);
                icasig = zeros(numComp, size(tempicasig, 2));
            end
             icasig(counter, :) = tempicasig;
             clear tempicasig;

             icaTimecourse(:, counter) = W;
              clear tempA;
             if ~isempty(files_in_zip)
                for ii = 1:length(files_in_zip)
                    str=files_in_zip{ii};
                    if(exist(str,'file'))
                        delete(str);% delete the files
                    end
                    [str1 str2 str3]=fileparts(str);
                    str2=strrep(str2,'_component_ica_','_timecourses_ica_');
                    if(~isempty(strmatch(str2(end-2:end),sprintf('%03d',compno))))
                        str2=str2(1:end-3);
                    end
                    
%                     str2=str2(1:ind+length('_timecourses_ica_')-1);
                    str=fullfile(str1,[str2,str3]);
%                     [str1 str2 str3]=strrep(str,sprintf('_component_ica_%03d',compno),'_timecourses_ica_');
%                     
                    if(exist(str,'file'))
                        delete(str);
                    end
                end
            end
             compLabels(subji).string = zipFileName;
        end
      
        nic_waitbar;
%         icatb_unzip([zipFileName,'.zip'], zipFilePath);
        
%         parameters.compFiles=compFiles;
        parameters.outputDir=zipFilePath;
        parameters.filesOutputDir=zipFilePath;    
%         parameters.files_in_zip=files_in_zip;

    structHInfo = HInfo;
    parameters.structHInfo = HInfo;
    structDIM = HInfo.DIM;
    parameters.structuralImage = structuralImage;
    
    
%     [pp, viewingSetName, extn] = fileparts(deblank(compFiles(1, :)));
    parameters.figLabel = sprintf('Component %d',compno);
   
    
    parameters.compLabels = compLabels;
    clear prefix;

    clear P;
    tdim = size(icaTimecourse, 1);
    % number of components
    numOfComp = counter;
    DIM = [HInfo.DIM, tdim];
    % handle structure data type
    icasig  = reshape(icasig, [counter, DIM(1:end-1)]);
    % parameters data structure
    parameters.numComp = numOfComp;
    parameters.icasig = icasig;
    clear icasig;
    parameters.icaTimecourse = icatb_detrend(icaTimecourse, 1, size(icaTimecourse, 1), DETRENDNUMBER);
    parameters.undetrendICA = icaTimecourse;
    clear icaTimecourse;
    parameters.numSubjects = 1;
    parameters.numSessions = 1;
    
    parameters.htmlFile = 'icatb_subject_explorer.htm';


    icatb_componentExplore(parameters);
    
    
%     system(['unzip -jqu ',zipFileName1,' ',zipfile,' -d ',zipFilePath]);
function  nic_unzipFile(zipFileName,zipfile,zipFilePath,zipfile1)
    fileNames=unzip(zipFileName,zipFilePath);
    ln=dir(fullfile(zipFilePath,zipfile));
    if(exist('zipfile1','var'))
        ln1=dir(fullfile(zipFilePath,zipfile1));
        ln=[ln;ln1];
    end
    for i=1:length(fileNames)
        k=0;
        for j=1:length(ln)
            k=k+1;
           [fp,fn,fext]=fileparts(fileNames{i});
           fn=[fn,fext];
           if(strmatch(fn,ln(j).name)) 
             k=k-1;
              break;  
           end
        end
        if(k==length(ln))
            delete(fileNames{i});
        end
    end

return;
    