R中的oro.dicom readDICOMFile出错
我正在尝试读取从超声波设备导出的dicom文件:R中的oro.dicom readDICOMFile出错,r,image,dicom,R,Image,Dicom,我正在尝试读取从超声波设备导出的dicom文件: library(oro.dicom) readDICOMFile('testdcm.dcm') 我发现以下错误: parsePixelData(fraw[(bstart+dcm$data.seek):fsize],hdr,endian,: 未指定PixelData中的字节数;猜测=1 readDICOMFile('testdcm.dcm',debug=TRUE)的完整输出如下: First 128 bytes of DICOM header =
library(oro.dicom)
readDICOMFile('testdcm.dcm')
我发现以下错误:
parsePixelData(fraw[(bstart+dcm$data.seek):fsize],hdr,endian,:未指定PixelData中的字节数;猜测=1
readDICOMFile('testdcm.dcm',debug=TRUE)
的完整输出如下:
First 128 bytes of DICOM header =
[1] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[30] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[59] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[88] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[117] 00 00 00 00 00 00 00 00 00 00 00 00
# DICM = TRUE
# 0002 0000 GroupLength UL UL 4 218
# 0002 0001 FileMetaInformationVersion OB OB 2
# 0002 0002 MediaStorageSOPClassUID UI UI 28 1.2.840.10008.5.1.4.1.1.6.1
# 0002 0003 MediaStorageSOPInstanceUID UI UI 48 1.2.250.1.204.5.8373721313.2016112214594330207.0
# 0002 0010 TransferSyntaxUID UI UI 22 1.2.840.10008.1.2.4.70
# 0002 0012 ImplementationClassUID UI UI 34 1.2.250.1.204.0.1.20120820.0.3.6.1
# 0002 0013 ImplementationVersionName SH SH 14 SSI_DCMTK_361
# 0002 0016 SourceApplicationEntityTitle AE AE 10 XXXXXX
# 0008 0005 SpecificCharacterSet CS CS 10 ISO_IR 100
# 0008 0008 ImageType CS CS 16 ORIGINAL PRIMARY
# 0008 0012 InstanceCreationDate DA DA 8 20161122
# 0008 0013 InstanceCreationTime TM TM 6 155942
# 0008 0014 InstanceCreatorUID UI UI 30 1.2.250.1.204.5.8373721313.13
# 0008 0016 SOPClassUID UI UI 28 1.2.840.10008.5.1.4.1.1.6.1
# 0008 0018 SOPInstanceUID UI UI 48 1.2.250.1.204.5.8373721313.2016112214594330207.0
# 0008 0020 StudyDate DA DA 8 20161122
# 0008 0021 SeriesDate DA DA 8 20161122
# 0008 0022 AcquisitionDate DA DA 8 20161122
# 0008 0023 ContentDate DA DA 8 20161122
# 0008 002A AcquisitionDatetime DT DT 14 20161122155943
# 0008 0030 StudyTime TM TM 6 155942
# 0008 0031 SeriesTime TM TM 6 155943
# 0008 0032 AcquisitionTime TM TM 6 155943
# 0008 0033 ContentTime TM TM 6 155942
# 0008 0050 AccessionNumber SH SH 0
# 0008 0060 Modality CS CS 2 US
# 0008 0070 Manufacturer LO LO 22 XXXXX
# 0008 0080 InstitutionName LO LO 20 XXXXX
# 0008 0081 InstitutionAddress ST ST 0
# 0008 0090 ReferringPhysiciansName PN PN 0
# 0008 1010 StationName SH SH 10 aixplorer
# 0008 1030 StudyDescription LO LO 0
# 0008 103E SeriesDescription LO LO 6 Muscle
# 0008 1040 InstitutionalDepartmentName LO LO 58 XXXXX
# 0008 1048 PhysiciansOfRecord PN PN 0
# 0008 1050 PerformingPhysiciansName PN PN 0
# 0008 1070 OperatorsName PN PN 0
# 0008 1090 ManufacturersModelName LO LO 10 Aixplorer
# 0008 1111 ReferencedPerformedProcedureStepSequence SQ SQ 94 Sequence
# FFFE E000 Item UN UN 0 (0008,1111)
# 0008 1150 ReferencedSOPClassUID UI UI 24 1.2.840.10008.3.1.2.3.3 (0008,1111)
# 0008 1155 ReferencedSOPInstanceUID UI UI 46 1.2.250.1.204.5.8373721313.2016112214594323292 (0008,1111)
# 0008 2111 DerivationDescription ST ST 90 Lossless JPEG compression, selection value 1, point transform 0, compression ratio 4.13087
# 0008 2112 SourceImageSequence SQ SQ 176 Sequence
# FFFE E000 Item UN UN 0 (0008,2112)
# 0008 1150 ReferencedSOPClassUID UI UI 28 1.2.840.10008.5.1.4.1.1.6.1 (0008,2112)
# 0008 1155 ReferencedSOPInstanceUID UI UI 46 1.2.250.1.204.5.8373721313.2016112214594330207 (0008,2112)
# 0040 A170 PurposeOfReferenceCodeSequence SQ SQ 66 Sequence (0008,2112)
# FFFE E000 Item UN UN 0 (0008,2112) (0040,A170)
# 0008 0100 CodeValue SH SH 6 121320 (0008,2112) (0040,A170)
# 0008 0102 CodingSchemeDesignator SH SH 4 DCM (0008,2112) (0040,A170)
# 0008 0104 CodeMeaning LO LO 24 Uncompressed predecessor (0008,2112) (0040,A170)
# 0010 0010 PatientsName PN PN 6 20WFV8
# 0010 0020 PatientID LO LO 20 Aixplorer_217522782
# 0010 0021 IssuerOfPatientID LO LO 0
# 0010 0030 PatientsBirthDate DA DA 0
# 0010 0032 PatientsBirthTime TM TM 0
# 0010 0040 PatientsSex CS CS 0
# 0010 1010 PatientsAge AS AS 0
# 0010 1020 PatientsSize DS DS 0
# 0010 1030 PatientsWeight DS DS 0
# 0010 2160 EthnicGroup SH SH 0
# 0010 21B0 AdditionalPatientHistory LT LT 0
# 0010 4000 PatientComments LT LT 0
# 0012 0062 PatientIdentityRemoved CS CS 2 NO
# 0018 1000 DeviceSerialNumber LO LO 8 SIH1313
# 0018 1020 SoftwareVersions LO LO 12 11.1.1.1404
# 0018 1030 ProtocolName LO LO 10 Free Form
# 0018 5010 TransducerData LO LO 18 SL15-4 MSK Muscle
# 0018 5100 PatientPosition CS CS 0
# 0018 6011 SequenceOfUltrasoundRegions SQ SQ 140 Sequence
# FFFE E000 Item UN UN 0 (0018,6011)
# 0018 6012 RegionSpatialFormat US US 2 1 (0018,6011)
# 0018 6014 RegionDataType US US 2 1 (0018,6011)
# 0018 6016 RegionFlags UL UL 4 2 (0018,6011)
# 0018 6018 RegionLocationMInX0 UL UL 4 336 (0018,6011)
# 0018 601A RegionLocationMInY0 UL UL 4 151 (0018,6011)
# 0018 601C RegionLocationMaxX1 UL UL 4 1064 (0018,6011)
# 0018 601E RegionLocationMaxY1 UL UL 4 959 (0018,6011)
# 0018 6024 PhysicalUnitsXDirection US US 2 3 (0018,6011)
# 0018 6026 PhysicalUnitsYDirection US US 2 3 (0018,6011)
# 0018 602C PhysicalDeltaX FD FD 8 0.00703188 (0018,6011)
# 0018 602E PhysicalDeltaY FD FD 8 0.00703188 (0018,6011)
# 0020 000D StudyInstanceUID UI UI 46 1.2.250.1.204.5.8373721313.2016112214594315435
# 0020 000E SeriesInstanceUID UI UI 48 1.2.250.1.204.5.8373721313.2016112214594331065.1
# 0020 0010 StudyID SH SH 14 20161122155942
# 0020 0011 SeriesNumber IS IS 2 1
# 0020 0012 AcquisitionNumber IS IS 2 1
# 0020 0013 InstanceNumber IS IS 2 1
# 0020 0020 PatientOrientation CS CS 0
# 0020 0060 Laterality CS CS 0
# 0028 0002 SamplesperPixel US US 2 3
# 0028 0004 PhotometricInterpretation CS CS 4 RGB
# 0028 0006 PlanarConfiguration US US 2 0
# 0028 0010 Rows US US 2 1080
# 0028 0011 Columns US US 2 1440
# 0028 0014 UltrasoundColorDataPresent US US 2 1
# 0028 0100 BitsAllocated US US 2 8
# 0028 0101 BitsStored US US 2 8
# 0028 0102 HighBit US US 2 7
# 0028 0103 PixelRepresentation US US 2 0
# 0028 0301 BurnedInAnnotation CS CS 4 YES
# 0028 2110 LossyImageCompression CS CS 2 00
# 0038 0010 AdmissionID LO LO 0
# 0040 0243 PerformedLocation SH SH 6 echo1
# 0040 0244 PerformedProcedureStepStartDate DA DA 8 20161122
# 0040 0245 PerformedProcedureStepStartTime TM TM 6 155942
# 0040 0253 PerformedProcedureStepID SH SH 14 20161122145943
# 0040 0254 PerformedProcedureStepDescription LO LO 0
# 0040 0275 RequestAttributesSequence SQ SQ 86 Sequence
# FFFE E000 Item UN UN 0 (0040,0275)
# 0008 0050 AccessionNumber SH SH 0 (0040,0275)
# 0020 000D StudyInstanceUID UI UI 46 1.2.250.1.204.5.8373721313.2016112214594315435 (0040,0275)
# 0032 1060 RequestedProcedureDescription LO LO 0 (0040,0275)
# 0040 0007 ScheduledProcedureStepDescription LO LO 0 (0040,0275)
# 7FE0 0010 PixelData OB OB -1 PixelData
##### Reading PixelData (7FE0,0010) #####
在此之前也曾报告过类似问题,但未提供经验证的答案
.dcm文件可在此处下载:
有什么想法吗?许多JPEG类型的图像没有DICOM元素中指示的像素长度。相反,它们是用序列分隔符排序的。这对于超声JPEG封装的图像数据集尤其如此 我相信您的库可能没有编码来处理这种情况 我个人建议尝试其他库,它们都可以在“工业实力”中使用,如PACS、VNA、查看工作站等
- Java(也适用于Scala):dcm4che
- C/C++:dcmtk
- C#:fo dicom
- JavaScript:基石
我已经使用了所有这些库,并且像素格式得到了很好的支持。你应该能够通过谷歌搜索上面的内容,并能够找到相应的主页。可能的副本可以在R中使用这些库吗?从未使用过R,因此我无法具体评论。虽然这不是最佳的,但始终非常可靠的是只调用dcmtk作为R或其他命令行,然后通过管道将输出返回到您的进程中。有一些工具可以将DICOM数据转换为DICOM JSON格式,因此一旦采用这种格式,您就可以轻松地用familar JSON处理它们。@dambach,我还没有测试您特别需要的解决方案,但下面的R包是其中一个li的包装器braries(dcmtk),至少可以为您指明正确的方向:。若要安装此特定软件包,您需要使用以下软件包devtools:devtools::install_github(“muschellij2/dcmtk”)。