gpt4 book ai didi

c++ - 当我使用 dcmtk 时,为什么要从 2^15 中减去 dicom 图像的像素值?

转载 作者:太空狗 更新时间:2023-10-29 23:52:14 24 4
gpt4 key购买 nike

我正在使用 dcmtk 读取 dicom 图像,新样本具有以下属性:

(0028,0004) Photometric Interpretation: MONOCHROME2
(0028,0010) Rows: 512
(0028,0011) Columns: 512
(0028,0030) Pixel Spacing: 0.4688\0.4688
(0028,0100) Bits Allocated: 16
(0028,0101) Bits Stored: 16
(0028,0102) High Bit: 15
(0028,0103) Pixel Representation: 1
(0028,0106) Smallest Image Pixel Value: 0
(0028,0107) Largest Image Pixel Value: 2732
(0028,1050) Window Center: 1366
(0028,1051) Window Width: 2732

我使用 getOutputData(16) 读取 int16_t 数据。这让我感到惊讶,因为这些值在 -1*(2^16) 附近是负的,当我将这些值减去 2^15 时,一切似乎都正常,我可以看到图像! :-(

现在我有两个问题:

  1. 为什么我应该减去 2^15 的值,然后就可以了?没有 padding value可用图片!
  2. getOutputData 的文档中,这是关于渲染的像素数据总是无符号的。。当我的图像数据因为 (0028,0103) 属性告诉我它而被签名时,这意味着什么?如果这个方法不对,我可以通过dcmtk获取真实数据吗?

最佳答案

关键是像素表示 (0028,0106) 数据元素。

PixelRepresentation = 0 -> unsigned
PixelRepresentation = 1 -> signed

在您的情况下,您的值为“1”,因此您必须读取这些值并将其解释为带符号的整数。

您可以找到更多信息 here .

关于c++ - 当我使用 dcmtk 时,为什么要从 2^15 中减去 dicom 图像的像素值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16803314/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com