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

mf *_* mf 2 c++ imaging dicom

我正在使用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
Run Code Online (Sandbox Code Playgroud)

我使用getOutputData(16)来读取int16_t数据.令我感到惊讶的是,因为接近-1*(2 ^ 16)的值是负值,当我将值减去2 ^ 15时,一切似乎都可以,我可以看到图像!:-(

现在我有两个问题:

  1. 为什么我要减去2 ^ 15的值,它会好吗?图像上没有可用的填充值!
  2. getOutputData的文档中,它讲的是渲染的像素数据总是无符号的..当我的图像数据被签名时,这意味着什么,因为(0028,0103)属性对我说了什么?如果这种方法不正确,那么我可以通过dcmtk获得真实数据吗?

jap*_*968 5

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

PixelRepresentation = 0 -> unsigned
PixelRepresentation = 1 -> signed
Run Code Online (Sandbox Code Playgroud)

在您的情况下,您的值为'1',因此您必须将值读取并解释为有符号整数.

您可以在此处找到更多信息.