【问题标题】:Reading DICOM 1.2.840.10008.1.2.4.70读取 DICOM 1.2.840.10008.1.2.4.70
【发布时间】:2012-09-21 00:30:07
【问题描述】:

我在读取 DICOM 文件时遇到问题。这是格式 1.2.840.10008.1.2.4.70(具有一阶预测的过程 14(选择值 1)。我编写自己的软件。

这是我的工作成果。

我也给你一个.dcm file

它有什么问题?只有 RadiAnt Dicom Viewer 可以正确打开它(我没有找到任何带有源代码的工作软件)。 有人有关于它的教程吗?任何工作代码?

我将不胜感激! 感谢您的帮助。


我告诉你我是怎么做的:

//I have:
numCOL= imageWidth;
numROW= imageHeight;

dwCurrentBufferLength;//-> where I in file

//and other stuff...

//First i decode first row:
//[0][0]

DecodeFirstRow(curRowBuf,dwCurrentBufferLength);

//I calculate difrences
HuffDecode ( table , &val, dwCurrentBufferLength);

//and extend
HuffExtend(extend, val);

curRowBuf[0][curComp]=extend+(1<<(Pr-Pt-1));

//[1-n][0]
//... huff stuff
curRowBuf[col][curComp]=extend+curRowBuf[col-1][curComp];

//Then i put row to the vector:
for (col = 0; col < numCol; col++) 
{       
v=RowBuf[col][0]<<point_transform_parameter;                    
m_vOutputBuf.push_back(v);
}   

//Rest of columns
//[0][m]
curRowBuf[0][curComp]=extend+prevRowBuf[0][curComp];    


predictor = left =curRowBuf[leftcol][curComp];
//[1-n][m]
curRowBuf[col][curComp]=extend+predictor;
//and also put it to vector ^^

我必须在哪里分这 1000 个??

【问题讨论】:

  • 不清楚是哪里出了问题,是你制作的dicom文件还是你写的读取它的程序?
  • 程序错误。 Dicom 文件正确

标签: dicom medical lossless


【解决方案1】:

在计算 HU 值时,您很可能没有考虑到 Rescale Intercept 标签 (0028,1052)。根据DICOM文件,截距是-1000。

要获得图像的适当 HU 值,请使用以下公式:

HU = rescale_slope * pixel_value + rescale_intercept

其中 Rescale Intercept 是从标签 (0028,1052) 获得的,Rescale Slope 从标签 (0028,1053) 获得。

【讨论】:

  • 感谢您的回答,但它必须在哪里?我今天有截止日期:(
  • 从您提供的代码中很难分辨,但需要修改的是 进入 JPEG 压缩的值。 val 数组,也许?如果您要进一步扩展您的应用程序,我强烈建议您开始改用常规 DICOM 工具包,例如 OFFIS DCMTK Toolkit
【解决方案2】:

这是我使用 gdcmviewer 看到的:

$ gdcmviewer 3DSlice1.dcm

GDCM 是开源的,你可以研究一下。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多