CT调整窗宽窗位

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Arctic_Beacon/article/details/89452697

常见人体组织的CT值(HU)

     组织      CT值       组织    CT值

  • 骨组织      >400               肝脏      50~70
  • 钙值       80~300              脾脏      35~60
  • 血块       64~84                胰腺      30~55
  • 脑白质     25~34              肾脏      25~50
  • 脑灰质     28~44              肌肉      40~55
  • 脑脊液      3~8                 胆囊      10~30
  • 血液       13~32               甲状腺      50~90
  • 血浆       3~14                 脂肪     -20~-100
  • 渗出液      >15                水           0

Dicom文件

Hu = pixel * slope + intercept


import os
import pydicom

dcm = pydicom.read_file(path)

img = dcm.pixel_array * dcm.RescaleSlope + dcm.RescaleIntercept

tag = dcm.InstanceNumber
center = list(dcm.WindowCenter)
width = list(dcm.WindowWidth)

a = (2*center - width)/2 +0.5
b = (2*center + width)/2 +0.5

dfactor = 255.0/(b-a)

h,w = np.shape(img)

for i in range(h):
    for j in range(w):
        img2[i, j] = int((img2[i, j]-a)*dfactor)

min_index = img < 0
img[min_index] = 0
max_index = img > 255
img[max_index] = 255

调窗前和调窗后

猜你喜欢

转载自blog.csdn.net/Arctic_Beacon/article/details/89452697
今日推荐