python read()读取图片_可以python sitk.ReadImage读取列表/系列图像吗?
我不明白sitk.ReadImage是否可以读取或不读取图像列表?我没有设法找到一个示例显示如何列出图像应该输入到函数。
但是在功能文件中它说:
ReadImage(**VectorString fileNames**, itk::simple::PixelIDValueEnum outputPixelType) -> Image
ReadImage(std::string const & filename, itk::simple::PixelIDValueEnum outputPixelType) -> Image
ReadImage is a procedural interface to the ImageSeriesReader class which is convenient for most image reading tasks.
Note that when reading a series of images that have meta-data
associated with them (e.g. a DICOM series) the resulting image will
have an empty meta-data dictionary. It is possible to programmatically
add a meta-data dictionary to the compounded image by reading in one
or more images from the series using the ImageFileReader class,
analyzing the meta-dictionary associated with each of those images and
creating one that is relevant for the compounded image.所以从文件看来,这是可能的。有人可以给我一个简单的例子。
编辑:
我尝试了以下内容:
sitk.ReadImage(['volume00001.mhd','volume00002.mhd'])但是这是我得到的错误:
RuntimeErrorTraceback (most recent call last)
in ()
1 files = [f for f in os.listdir('.') if 'mhd' in f]
2 print(sorted_files[1:25])
----> 3 sitk.ReadImage(['volume00001.mhd','volume00002.mhd'])
/gpfs/bbp.cscs.ch/home/amsalem/anaconda2/lib/python2.7/site-packages/SimpleITK/SimpleITK.pyc in ReadImage(*args)
8330
8331 """
-> 8332 return _SimpleITK.ReadImage(*args)
8333 class HashImageFilter(ProcessObject):
8334 """
RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageSeriesReader.cxx:145:
sitk::ERROR: The file in the series have unsupported 3 dimensions.谢谢。
python read()读取图片_可以python sitk.ReadImage读取列表/系列图像吗?相关推荐
- python pypdf2另存为图片_用Python玩转PDF的各种骚操作
文/Python数据科学 图片来源于网络 Portable Document Format(可移植文档格式),或者PDF是一种文件格式,可以用于跨操作系统的呈现和文档交换.尽管PDF最初是由Adob ...
- python批量裁剪图片_用Python写了一个图片格式批量处理工具
来源:blog.csdn.net/kimol_justdo 前言 就在昨天,正当我在刺激战场厮杀时,"叮叮叮",微信来消息了.我心想:"这是肾马情况?" 我打开 ...
- python 还原九宫格图片_用Python做一个好玩的朋友圈九宫格抽奖
最近在朋友圈看到个好玩的抽奖九宫格: 随便点开一个: 设计思路 以朋友圈中看到的1号图做参考,我们需要准备 300*900 的白色底图,搞笑表情图,广告语,中间一个醒目的数字编号,外加下方的嘲讽&qu ...
- python显示gif图片_利用Python制作GIF图片
#Python制作GIF图片 import imageio def create_gif(image_list, gif_name, duration = 0.1): ''' :param image ...
- python 查找损坏图片_使用Python查找损坏的图像
python 查找损坏图片 赶上本系列: 第1部分:使用Python自动执行数字艺术家的重复任务 第2部分:针对数字艺术家的Python文件管理技巧 如果您正在计算机上处理图像,那么最终一定会遇到 ...
- python樱花树画法图片_用Python敲出樱花绽放 | 附代码
今年武汉大学的樱花依然开得灿烂,但受疫情影响,少了很多去赏花的朋友. (图源 武汉大学微博) 为了让大家看到樱花开放,各路高手纷纷亮出了自己的绝技.要说最秀的,当属用Python让樱花开放. 一时间, ...
- python 文本文件转图片_使用Python将文本转为图片
编程派微信号:codingpy 文 / oldj 有时候,我们需要将文本转换为图片,比如发长微博,或者不想让人轻易复制我们的文本内容等时候.目前类似的工具已经有了不少,不过我觉得用得都不是很趁手,于是 ...
- python 过滤相似图片_求教 python 网站爬虫过滤出图片 url 的问题
下面代码是在图片网站上截取的,想问下用 Python 爬虫,怎样才能过滤出 images 下面不同 size 的图片 url 呢? "images": [{ "size& ...
- mac用python爬虫下载图片_利用Python爬虫采集mac电脑皮肤|简明python教程|python入门|python教程...
https://www.xin3721.com/eschool/pythonxin3721/ blessing skin网站介绍:blessing skin网址为 https://skin.prinz ...
最新文章
- 困扰数学家50年的问题,竟被博士小姐姐用一周业余时间解决了
- 【斯坦福大学】可信任机器学习课程,附课件
- 利用颜色和形态学两种方法进行车牌区域提取的OpenCV代码
- MySQL安装失败问题
- 前端学习(3347):数组方法的运用和总结稀疏数组
- MySQL 直接存储图片并在 html 页面中展示,点击下载
- java三步 网易_Java基础:三步学会Java Socket编程·网易学院·教程
- 千年老二的 Python 值得学吗?
- www.biubiujie.com BiuBiu街-要Beautiful的女孩纸逛的街
- 5.7 Universal Transformers
- idea 如何查看jdk源码
- 还是忍不住说说特斯拉的恐怖
- openwrt路由器安装Transmission软件包与web控制台(中文界面)
- DL中常用的三种K-Lipschitz技术
- 课程设计:公交线路管理系统
- Freertos中两个delay函数
- JAVA编写 飞翔的小鸟
- Android进阶之路 - 拉伸的弹簧效果
- HDUOJ 6575 Budget
- 判断输出,输入0,1,2,3,输出aaaa,bbbbb,cccc,dddd(c语言)