IMPORTANT: StitchWell is no longer maintained and will not receive any future updates. Please use DeepTile instead.
A pure Python implementation for bulk stitching ND2 files.
ND2 files acquired from Nikon Elements has metadata including the following properties: scan coordinates (x,y), channels (c), stack (z), and time (t). Extracting this information requires the open source package nd2reader
to run.
Install StitchWell from PyPI.
pip install stitchwell
Stitch ND2 into a NumPy array.
from stitchwell import StitchWell
# path: path to a ND2 file or a folder containing ND2 files
# file_index: index of file in a folder to stitch
# overlap = overlap percentage used for stitching
stitched = StitchWell(path).stitch(file_index, overlap)
Stitch ND2 and save as TIFF.
from stitchwell import StitchWell
# path: path to a ND2 file or a folder containing ND2 files
# out_dir: path to output directory for saving stitched TIFF files
# overlap = overlap percentage used for stitching
StitchWell(path).save_tiff(out_dir, overlap)