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: aamod_tSNR_epi.m
    path of file: ./repos/automaticanalysis/aa_modules
    
    the code of the file until where you have to start completion: % AA module
% [aap,resp]=aamod_tSNR_EPI(aap,task,subj,sess)
% Calculate the temporal SNR of a series of images within a particular ROI
% Also plots the timecourses...
% This is more accurate (but slower!) than the SNR calculation that is done

    
function [aap,resp]=aamod_tSNR_EPI(aap,task,subj,sess)

resp='';

switch task
    case 'summary'
        sesspath=aas_getsesspath(aap,subj,sess);
        resp=sprintf('Estimate tSNR of EPI series of %s\n',sesspath);
        
    case 'report'
        
    case 'doit'
        
        EPIimg = aas_getfiles_bystream(aap,subj,sess,'epi');
        if aap.options.NIFTI4D
            EPIimg = spm_select('ExtFPList',fileparts(EPIimg),basename(EPIimg));
        end