ITK 的 DICOM 图像太暗
我正在尝试使用 ITK 读取图像并使用 VTK 显示。
但有一个问题困扰了我很长一段时间。
我使用类 itkGDCMImageIO 和 itkImageSeriesReader 读取图像。
读完后,我可以做两件事:
1. 我可以使用 itkImageToVTKImageFilter 将 ITK 图像转换为 vtkImageData,并使用 vtkImageReslicer 获取所有三个轴。然后,我使用类 vtkImageMapper、vtkActor2D、vtkRenderer 和 QVTKWidget 来显示图像。
在这种情况下,当我显示图像时,颜色存在一些问题。其中一些非常明亮,另一些则非常暗,您几乎看不到它们。
2. 第二种场景是注册管道。在这里,我像以前一样读取图像,然后使用 ITK 软件指南有关注册的章节中显示的类。然后我重新采样图像并使用 itkImageSeriesWriter。
这就是问题出现的时候。将图像写入文件后,我将这个新图像与我在 XMedcon 软件中用作输入的图像进行比较。如果我写的图像在我的软件中显示得太亮,那么当我在 XMedcon 中比较它们时,没有任何变化。否则,如果我的软件中的图像太暗,XMedcon 中的图像就会显得一团糟。
我注意到,在比较两张图像(原始图像和新图像)时,两种情况下的模态、像素尺寸和 glmax 都发生了变化。
我认为问题出在 glmax 上,因为主要变化发生在较暗的图像上。
我真的不知道该怎么办。这与颜色级别/窗口有关吗?最奇怪的是,所有图像都非常相似,具有相同的标签,只有其中一些在显示/写入时显示错误。
i am trying to read an image with ITK and display with VTK.
But there is a problem that has been haunting me for quite some time.
I read the images using the classes itkGDCMImageIO and itkImageSeriesReader.
After reading, i can do two different things:
1.
I can convert the ITK image to vtkImageData using itkImageToVTKImageFilter and the use vtkImageReslicer to get all three axes. Then, i use the classes vtkImageMapper, vtkActor2D, vtkRenderer and QVTKWidget to display the image.
In this case, when i display the images, there are several problems with colors. Some of them are shown very bright, others are so dark you can barely see them.
2.
The second scenario is the registration pipeline. Here, i read the image as before, then use the classes shown in the ITK Software Guide chapter about registration. Then i resample the image and use the itkImageSeriesWriter.
And that's when the problem appears. After writing the image to a file, i compare this new image with the image i used as input in the XMedcon software. If the image i wrote ahs been shown too bright in my software, there no changes when i compare both of them in XMedcon. Otherwise, if the image was too dark in my software, it appears all messed up in XMedcon.
I noticed, when comparing both images (the original and the new one) that, in both cases, there are changes in modality, pixel dimensions and glmax.
I suppose the problem is with the glmax, as the major changes occur with the darker images.
I really don't know what to do. Does this have something to do with color level/window? The most strange thing is that all the images are very similar, with identical tags and only some of them display errors when shown/written.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不太熟悉 VTK/ITK 的具体细节,但在我看来,这个问题比这更普遍。医学图像具有高动态范围,如果窗口未设置到某个适当的范围,图像通常会显得非常暗或非常亮。 DICOM 标签窗口中心 (0028, 1050) 和窗口宽度 (0028, 1051) 将包括由模态选择的一些默认窗口设置。通常这些值是合理的,但并非总是如此。请参阅DICOM 标准第 3 部分(11_03pu.pdf 是文件名)C 部分。 11.2.1.2 有关如何缩放原始图像像素以进行显示的详细信息。一般的想法是,您需要对图像应用线性缩放以获得适合显示的像素值。
I'm not familiar with the particulars of VTK/ITK specifically, but it sounds to me like the problem is more general than that. Medical images have a high dynamic range and often the images will appear very dark or very bright if the window isn't set to some appropriate range. The DICOM tags Window Center (0028, 1050) and Window Width (0028, 1051) will include some default window settings that were selected by the modality. Usually these values are reasonable, but not always. See part 3 of the DICOM standard (11_03pu.pdf is the filename) section C.11.2.1.2 for details on how raw image pixels are scaled for display. The general idea is that you'll need to apply a linear scaling to the images to get appropriate pixel values for display.
您使用什么像素类型?在大多数情况下,在使用 ITK 时使用浮点类型会更简单,但原始医学图像通常很短,因此这可能是您的问题。
您还应该在每个步骤之后将图像写入磁盘(例如,以 MHD 格式),并使用已知正常工作的查看器检查它,例如 vv (http://www.creatis.insa-lyon.fr /里约/vv)。您也可以将它们以及您的代码发布在此处以供进一步审查。
祝你好运!
What pixel types do you use? In most cases, it's simpler to use a floating point type while using ITK, but raw medical images are often in short, so that could be your problem.
You should also write the image to the disk after each step (in MHD format, for example), and inspect it with a viewer that's known to work properly, such as vv (http://www.creatis.insa-lyon.fr/rio/vv). You could also post them here as well as your code for further review.
Good luck!
对于您所描述的第一个问题:
我建议如下:检查 VTK 中的窗口/级别,它们可能不足以满足您的图像。如果它们是腹部断层扫描窗口 = 350,则 50 应该是一个不错的颜色级别。
For what you describe as your first issue:
I suggest the following: Check your window/level in VTK, they probably aren't adequate to your images. If they are abdominal tomographies window = 350 level 50 should be a nice color level.