#!\usr\bin\python # Script to overlay bubble images (i.e. to see the fiducial volume) # Usage: python combinebubbles.py *.bmp # where is the output image # and *.bmp are images to be overlaid # Rememebr to set the import sys, os from PIL import Image import scipy.misc import numpy if __name__ == '__main__': w = 384 h = 615 images = numpy.empty((len(sys.argv)-2, w, h), numpy.uint8) i = 0 for filename in sys.argv[2:]: im = Image.open(filename) images[i] = numpy.asarray(im) i = i+1 img = numpy.empty((w,h),int) for i in range(w): for j in range(h): img[i,j] = max(images[:,i,j]) scipy.misc.imsave(sys.argv[1], img)