Multi-stage time lapse acquisition. How to stitch the images?

Hi, I acquired a time-lapse with a confocal microscope with 5 different positions of the microscope stage. I would like to stitch these images (for each time instant) to reconstruct the entire area investigated to obtain a time-lapse of the overall region. I generally use the plug-in “stitching–>grid/collection stitching” but it would mean to use it more than a thousand times (48 h of video = 1500 frames).

Is it possible to write a script to automatize this process?

Thanks!