I have three images:
FigA.png
FigB.png
FigC.png
What I want to do is to stack them and make final montage that looks like this:
How can I do it programmatically with Python?
I’m stuck with the following code
## /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx mycode.py
from ij import IJ
def stack_images(infilelist):
"""
Description of stack_image
"""
infile_A = infilelist[0]
infile_B = infilelist[1]
infile_C = infilelist[2]
imp = IJ.openImage(infile_A)
imp.show()
imp = IJ.openImage(infile_B)
imp.show()
imp = IJ.openImage(infile_C)
imp.show()
IJ.run(imp, "Images to Stack", "name=Stack title=[] use")
IJ.run(imp, "Make Montage...", "columns=3 rows=1 scale=0.25 label")
IJ.run(imp, "Save", "save=/Users/pdubois/Desktop/Montage_X.tif")
def main():
"""
Description of main
"""
filelist = [ "/Users/pdubois/Desktop/FigA.png",
"/Users/pdubois/Desktop/FigB.png",
"/Users/pdubois/Desktop/FigC.png"]
stack_images(filelist)
if __name__ == '__main__':
main()
Which produce no final Montage image.
What’s the right way to do it?
I have hundreds of image in set of 3 (A, B, C) which I need to process
programatically.