【发布时间】:2020-10-18 19:35:06
【问题描述】:
我成功编译 DCMTK 并在 macOS 10.15 上的 Xcode 项目中使用。我可以读取/解压缩 JPEG 图像,但我无法读取一些 DICOM 文件。
使用DicomImage *di = new DicomImage(dfile, xfer , CIF_UsePartialAccessToPixelData, 0,1); 返回零图像。读取dataset->findAndGetUint16(DCM_Rows, rows)返回0(对于行或列),读取像素数据返回0....
用dcmdump检查文件返回正确的数据:
# Dicom-File-Format
# Dicom-Meta-Information-Header
# Used TransferSyntax: Unknown Transfer Syntax
# Dicom-Data-Set
# Used TransferSyntax: Little Endian Implicit
(0008,0008) CS [DERIVED\PRIMARY\OTHER] # 22, 3 ImageType
(0008,0014) UI [1.2.840.113701.4.1.6653] # 24, 1 InstanceCreatorUID
(0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID
(0008,0018) UI [1.2.840.113701.4.1.6653.3.264.4.9.6.0] # 38, 1 SOPInstanceUID
---
(0008,0070) LO [Toshiba] # 8, 1 Manufacturer
(0008,0080) LO [TOSHIBA Nasu Works. Bay-6653.] # 30, 1 CompanyName
(0008,1010) SH [FLEXART] # 8, 1 StationName
---
(0008,1090) LO [MRT150] # 6, 1 ManufacturerModelName
(0010,0010) PN [GGGGGG^WWWWW] # 12, 1 ComponentName
(0010,0020) LO [TMS04] # 6, 1 ComponentIDNumber
(0010,0030) DA [19000100] # 8, 1 ComponentManufacturingDate
(0010,0032) TM [000000] # 6, 1 PatientBirthTime
(0010,0040) CS [F] # 2, 1 PatientSex
(0010,1030) DS [79.000000] # 10, 1 PatientWeight
---
(0020,0052) UI [1.2.840.113701.4.1.1.1] # 22, 1 FrameOfReferenceUID
(0020,4000) LT (no value available) # 0, 0 ImageComments
(0028,0002) US 1 # 2, 1 SamplesPerPixel
(0028,0004) CS [MONOCHROME2] # 12, 1 PhotometricInterpretation
(0028,0010) US 512 # 2, 1 Rows
(0028,0011) US 512 # 2, 1 Columns
(0028,0030) DS [0.000312\0.000312] # 18, 2 PixelSpacing
(0028,0100) US 16 # 2, 1 BitsAllocated
(0028,0101) US 16 # 2, 1 BitsStored
(0028,0102) US 15 # 2, 1 HighBit
(0028,0103) US 0 # 2, 1 PixelRepresentation
(0028,0106) US 3 # 2, 1 SmallestImagePixelValue
(0028,0107) US 1030 # 2, 1 LargestImagePixelValue
(7fe0,0010) OW 8064\8064\8064\8064\8064\8064\8064\8064\8064\8064\8064\8064\8064... # 524288, 1 PixelData
我试图强制数据集使用EXS_LittleEndianExplicit 作为dataset->chooseRepresentation(EXS_LittleEndianExplicit, NULL).bad(),但它返回true(不成功)。
我不知道可能出了什么问题。所有 DCMTK 库和应用程序似乎都已正确编译,我的代码是用 Objective-C++ 编写的,因此我可以毫无问题地调用 DCMTK 函数。我希望我不需要编写自定义解析器。我尝试在 Osiri、Miele、Horos 中打开文件。所有导入和显示的图像都正确。
我真的很感激任何想法......谢谢。
【问题讨论】:
-
findAndGetUint16()的返回值是多少?您是否确保已加载数据字典?您可以(并且实际上应该)使用 dcmDataDict.isDictionaryLoaded() 进行检查。
-
或者,您可以检查 di->getStatus() 返回的内容。
-
dcmDataDict.isDictionaryLoaded() 返回“真” di->getStatus() == EIS_Normal 返回“假”
-
请原谅我的回答不完整:di->getStatus() 仅在我加载“private.dic”时返回“EIS_MissingAttribute”。加载“dicom.dic”后,一切正常。