简体   繁体   English

从python中的dicom文件获取z-buffer(depth)信息

[英]Obtaining z-buffer(depth) informaiton from dicom file in python

I have a set of dicom images(contains 160 .dcm files). 我有一组dicom图像(包含160个.dcm文件)。 I can visualize a single file by the following python code: 我可以通过以下python代码可视化单个文件:

import pydicom as dicom
import os
import numpy
import matplotlib.pyplot as plt

filename = "./myfiles/MR000130.dcm";

dataset = dicom.dcmread(filename)

plt.imshow(dataset.pixel_array, cmap=plt.cm.bone)
plt.show()

My question is: 我的问题是:

  1. How do I visualize these whole bunch of volumetric data as a single picture? 如何将这些全部体积数据可视化为一张图片?
  2. Is there any way to obtain the z-buffer information? 有什么方法可以获取z缓冲区信息?

It's in the file. 在文件中。 There is stuff in the DICOM apart from pixel data. 除了像素数据外,DICOM中还有很多东西。 See it with print(dataset._pretty_str) . 通过print(dataset._pretty_str)看到它。

It might be dataset.SliceLocation . 它可能是dataset.SliceLocation

We can't tell you how to change 3D to 2D. 我们无法告诉您如何将3D更改为2D。 You could read all the slices, and then reslice in other planes. 您可以读取所有切片,然后在其他平面上切片。 You could do some fancy segmentation and render surfaces in 3D. 您可以进行一些奇特的分割,并以3D渲染曲面。 You need to decide what is most appropriate for your case. 您需要确定最适合您的情况的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM