git clone https://github.com/duopeng/image_merge-z-stack_and_stitch
- Install ImageJ (tested with v1.53f51) or Fiji.
Copy the two macro filesfocusstack.ijmandstitch.ijmto themacrofolder in your ImageJ/Fiji installation folder - pandas (tested with v1.3.3) and openpyxl
see metadata.xlsx for an example
The following picture shows an example that has two mosquito midguts (entities), and each gut has two microscope views (regions),and each region has 2 z-stacks.

The existing folder example_images contains the images for the example metadata
python merge-z-stack_and_stitch.py --dir [path to image folder] --excelfile [path to excel file] --IJpath [path to ImageJ excutable]
To run the example:
python merge-z-stack_and_stitch.py --dir example_images --excelfile metadata.xlsx --IJpath [path to ImageJ excutable]
Result files will be named : [Entity prefix]_FocusStitch.jpg
