def main(InputFile,ContrastName,Interleave,TR,Regressor):
    print 'RunFillPipelineOnFile_SC.py'

    STCFiles,Methods=STC.main(InputFile,TR,Interleave)
    RMC.main(InputFile)
    for stcfile,meth in zip(STCFiles,Methods):

        GLM.main(stcfile,meth,Regressor,ContrastName)
        for MC in MCs:
            
                
            moveFile=MoveBase.format(sub=subID)
            toFile='/share/studies/David_FS/Real/MotionCorrection/{}/{}/{}/HRF.nii'.format(motion,subID,MC)
            target='/share/studies/David_FS/Real/MotionCorrection/{}/{}/{}/HRF.nii.gz'.format(motion,subID,MC)
            if not os.path.exists(target):

                cmd='cp {} {};gzip {}'.format(moveFile,toFile,toFile)
                pr=sp.Popen(cmd,shell=True)
                pr.wait()
                
                if MC=='ST':
    
                    
                    Files,MethOrder=STC.main(target)
                    print 'STC Files:\n{}'.format(Files)
                    
                    
                    print 'Method:\t{MC}\n{ln}'.format(MC=MC,ln=ln)
    
                    for InputNii,meth in zip(Files,MethOrder):
                        
                        if meth=='Filt':
                            Regressor='/share/studies/David_FS/Real/MotionCorrection/{}/{}/{}/20_Visual.txt'.format(motion,subID,MC)
                        else:
                            Regressor='/share/studies/David_FS/Real/MotionCorrection/{}/{}/{}/Visual.txt'.format(motion,subID,MC)
                        
                        GLM.main(InputNii,meth,Regressor,con)
                        print 'Reg:\t{Regressor}\nFile:\t{InputNii}\nMeth:\t{meth}'.format(Regressor=Regressor,InputNii=InputNii,meth=meth)