def main(InputFile, ContrastName, Interleave, TR, Regressor, RunMC=""):
    print "RunFillPipelineOnFile_SC.py"

    print "RunMC:\t{}".format(RunMC)
    print 'RunMC=="first":\t{}'.format(RunMC == "first")
    print 'RunMC=="last":\t{}'.format(RunMC == "last")
    print 'RunMC=="none":\t{}'.format(RunMC == "none")

    if RunMC == "first":
        print "Running MC first"
        InputFile = RMC.main(InputFile)

    print InputFile

    STCFiles, Methods = STC.main(InputFile, TR, Interleave)

    for stcfile, meth in zip(STCFiles, Methods):

        if RunMC == "last":
            MCstcfile = RMC.main(stcfile)
        else:
            MCstcfile = stcfile

        print MCstcfile
        GLM.main(MCstcfile, meth, Regressor, ContrastName, TR, Interleave)
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)
                 
                 print 'Method:\t{MC}\n{ln}'.format(MC=MC,ln=ln)
                 
 
                 
                 Files,MethOrder=STC.main(target)
                 print 'STC Files:\n{}'.format(Files)
 
                 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)
                     
                     MCInputNii=RMC.main(InputNii)
                     
                     GLM.main(MCInputNii,meth,Regressor,con)         
                     print 'Reg:\t{Regressor}\nFile:\t{InputNii}\nMeth:\t{meth}'.format(Regressor=Regressor,InputNii=MCInputNii,meth=meth)
           
           
           
             elif MC=='MCST':
                 
                 print 'Method:\t{MC}\n{ln}'.format(MC=MC,ln=ln)
 
                 
                 MCinputNii=RMC.main(target)
                 
                 Files,MethOrder=STC.main(MCinputNii)
                 print 'STC Files:\n{}'.format(Files)