我想用python读取32位浮点图像文件来做一些图像分析。
我试过了
import matplotlib.pyplot as plt
im = plt.imread('path_to_file.tif')
Run Code Online (Sandbox Code Playgroud)
但是,这只会将数据读取为 8 位整数值。有没有办法为 imread() 提供正确的数据类型?
-- 好吧,它以前可以使用 16 位 TIFF 文件开箱即用,但不适用于 32 位浮点数。
Matplotlib 的颜色图不提供图像的 HiLo 颜色图,这通常在显微镜中使用。HiLo 显示从低值到高值的灰度梯度,但低端的值显示为蓝色,上端的值显示为红色。
如何获得 matplotlib 图像的颜色图?
使用python configparser包读取配置文件时,所有键名都是小写字符串.有人知道如何读取保留大写和大写单词的字符串吗?
例如:
$cat config.cfg
[DEFAULT]
Key_1 = SomeWord
KEY_2 = Another Word
$ python3
>>> from configparser import ConfigParser
>>> cf = ConfigParser()
>>> cf.read('./config.cfg')
['./config.cfg']
>>> print(cf.defaults())
OrderedDict([('key_1', 'SomeWord'), ('key_2', 'Another Word')])
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
matplotlib ×2
python ×2
python-3.x ×2
32-bit ×1
colormap ×1
configparser ×1
fiji ×1
imagej ×1
tiff ×1