Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert .tiff image stack to unit8 format

import cv2 
import numpy as np
import os
import imageio

#Import data
ret, img_stack = cv2.imreadmulti(file_import,[],cv2.IMREAD_GRAYSCALE) 
#Convert to real binary
img_stack_u8 = []
for i in range(0,len(img_stack)):
    img_u8 = img_stack[i].astype(np.uint8)
    img_stack_u8.append(img_u8)
#Export data
imageio.mimwrite(file_export,img_stack_u8, format = 'tif')
Comment

PREVIOUS NEXT
Code Example
Python :: python3 subprocess getoutput 
Python :: implementing a bubble sort in python 
Python :: compare if 2 numbers are relatively equal 
Python :: how to apply 1nf dataframe in python 
Python :: histogram plot seaborn 
Python :: python .exe long start 
Python :: Source code for making Telegram robot with Python 
Python :: Python Print Variable Using the + operator to join variables 
Python :: python pycharm 
Python :: pil 
Python :: multi hot encode pandas column 
Python :: pandas drop unnamed columns grebber 
Python :: pandas select only earliest event for duplicates 
Python :: threshhold crossing on list python 
Python :: jsonpickle exclude py/object 
Python :: how to take multiple integer input in python 
Python :: python list safely pop 
Python :: how to search on wikipedia with python and speak the result 
Python :: korozif 
Python :: scrapy capture: Error downloading 
Python :: write a python program which accepts the user 
Python :: Streaming upload requests python 
Python :: python default summary statistics for all columns 
Python :: how do i select a range of columns by index 
Python :: range coding 
Python :: python text to speech arabic 
Python :: how to make a chrome extension in python 
Python :: how to get user input in python 
Python :: import turtle in python 
Python :: python interpreter 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =