Python: lsm image to tif image© Dhana Design

Python: lsm image to tif image

import tifffile, cv2, os
List_dir = "lsm/"
out_dir = "out/"
LSM_list = [i for i in os.listdir(List_dir) if ".lsm" in i]
LSM_list[0]

for i in LSM_list:
A = tifffile.imread(List_dir + i)
#fig, ax = plt.subplots(figsize=(10, 10))
for ch_id in range(A.shape[1]):
Pic = A[:,ch_id,:,:]
tifffile.imsave(out_dir + i+str(ch_id)+".tif", Pic)
Author

Karobben

Posted on

2021-09-18

Updated on

2024-01-11

Licensed under

Comments