Skip to content

Instantly share code, notes, and snippets.

@jonesa3
jonesa3 / combine_labels.py
Created February 7, 2023 20:02
Combine 8-bit label field tifs into single 16-bit label field tif with unique IDs
import tifffile
import numpy as np
for i in range(1,x):
# load image as 16 bit (so that when we add to it, it can go past 255)
# input file name expects end number
# adjust range for number of input files
current_image = tifffile.imread(f"input_file_name_x.tif").astype(np.uint16)
if i==1: