#
# numproc should be set to the number of cores you have
# fname is the name of the file which holds the name of the volumes
# e.g.:
# image1.img
# imagenpto.img
# image-kw.txt
#

numproc = 8
fname = "imglist.txt"
line = [i.strip() for i in open(fname).readlines()]
lin = list()
for i in range(len(line)):
        lin.append("recon-all -i %s -s case%d -all"%(line[i],i))
for i in range(1,numproc+1):
        print "(",
        for cmd in lin[(i-1)*len(lin)/numproc:i*len(lin)/numproc]:
                print "%s ;"%cmd,
        print ")&"

UserContributions/Scripts/Three (last edited 2008-12-30 13:09:23 by PedroOliveira)