使用 DCMTK 读取 DICOM 文件的内容序列标签时出现问题

问题描述

使用 DCMTK,我试图获取 .dcm SR 文件内容序列的整个节点,以提取与产科扫描相关的测量值。我使用 C-Find 查询。我可以使用 Toshiba 超声波机器获得整个内容序列,但其他品牌无法获得。我不认为这是品牌问题,而是我设置 C-Find 流程的方式。我对此很陌生,正在努力解决这个问题。我在下面包含了 2 个日志文件一个用于成功获取 Content Sequence 标记的整个节点的工作案例,另一个用于停止进程并显示错误“DimsE Status: 0xc000: Error: Failed -”的非工作案例日志无法处理错误”。感谢您提供任何帮助或富有洞察力的建议。

这是非工作查询的日志

D: Request Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.5
D: Our Implementation Version Name:   OFFIS_DCMTK_365
D: Their Implementation Class UID:    
D: Their Implementation Version Name: 
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    KATIBA
D: Called Application Name:     ORTHANC
D: Responding Application Name: ORTHANC
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  0
D: Presentation Contexts:
D:   Context ID:        1 (Proposed)
D:     Abstract Syntax: =FINDStudyRootQueryRetrieveinformationModel
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-RQ ======================
I: Requesting Association
T: DUL  FSM Table: State: 1 Event: 0
T: DUL  Event:  A-ASSOCIATE request (local user)
T: DUL  Action: AE 1 Transport Connect
D: setting network send timeout to 60 seconds
D: setting network receive timeout to 60 seconds
T: checking whether environment variable TCP_BUFFER_LENGTH is set
T:   environment variable TCP_BUFFER_LENGTH not set,using the system defaults
T: checking whether environment variable TCP_NODELAY is set
T:   environment variable TCP_NODELAY not set,using the default value (0)
T: DUL  FSM Table: State: 4 Event: 1
T: DUL  Event:  Transport conn confirmation (local)
T: DUL  Action: AE 2 Send Associate RQ PDU
D: Constructing Associate RQ PDU
T: setting timeout for first PDU to be read to 30 seconds
T: Read PDU HEAD TCP: 02 00 00 00 00 ba
T: Read PDU HEAD TCP: type: 02,length: 186 (ba)
T: DUL  FSM Table: State: 5 Event: 2
T: DUL  Event:  A-ASSOCIATE-AC PDU (on transport)
T: DUL  Action: AE 3 Associate Confirmation Accept
D: PDU Type: Associate Accept,PDU Length: 186 + 6 bytes PDU header
D:   02  00  00  00  00  ba  00  01  00  00  4f  52  54  48  41  4e
D:   43  20  20  20  20  20  20  20  20  20  4b  41  54  49  42  41
D:   20  20  20  20  20  20  20  20  20  20  00  00  00  00  00  00
D:   00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
D:   00  00  00  00  00  00  00  00  00  00  10  00  00  15  31  2e
D:   32  2e  38  34  30  2e  31  30  30  30  38  2e  33  2e  31  2e
D:   31  2e  31  21  00  00  1b  01  00  00  00  40  00  00  13  31
D:   2e  32  2e  38  34  30  2e  31  30  30  30  38  2e  31  2e  32
D:   2e  31  50  00  00  3a  51  00  00  04  00  00  40  00  52  00
D:   00  1b  31  2e  32  2e  32  37  36  2e  30  2e  37  32  33  30
D:   30  31  30  2e  33  2e  30  2e  33  2e  36  2e  34  55  00  00
D:   0f  4f  46  46  49  53  5f  44  43  4d  54  4b  5f  33  36  34
D: 
D: Parsing an A-ASSOCIATE PDU
T: PDU type: 2 (A-ASSOCIATE AC),PDU Length: 186
T: DICOM Protocol: 1
T: Called AP Title:  ORTHANC
T: Calling AP Title: KATIBA
T: Parsing remaining 118 bytes of A-ASSOCIATE PDU
T: Next item type: 10
T: Subitem parse: Type 10,Length 0021,Content: 1.2.840.10008.3.1.1.1
T: Successfully parsed Application Context
T: Parsing remaining 93 bytes of A-ASSOCIATE PDU
T: Next item type: 21
T: Parsing Presentation Context: (21),Length: 27
T: Presentation Context ID: 01
T: Parsing remaining 23 bytes of Presentation Context
T: Next item type: 40
T: Subitem parse: Type 40,Length 0019,Content: 1.2.840.10008.1.2.1
T: Successfully parsed Transfer Syntax
T: Successfully parsed Presentation Context
T: Parsing remaining 62 bytes of A-ASSOCIATE PDU
T: Next item type: 50
T: Parsing user info field (50),Length: 58
T: Parsing remaining 58 bytes of User information
T: Next item type: 51
T: Maximum PDU Length: 16384
T: Successfully parsed Maximum PDU Length
T: Parsing remaining 50 bytes of User information
T: Next item type: 52
T: Subitem parse: Type 52,Length 0027,Content: 1.2.276.0.7230010.3.0.3.6.4
T: Parsing remaining 19 bytes of User information
T: Next item type: 55
T: Subitem parse: Type 55,Length 0015,Content: OFFIS_DCMTK_364
T: Successfully parsed User information
D: Association Parameters Negotiated:
D: ====================== BEGIN A-ASSOCIATE-AC =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.5
D: Our Implementation Version Name:   OFFIS_DCMTK_365
D: Their Implementation Class UID:    1.2.276.0.7230010.3.0.3.6.4
D: Their Implementation Version Name: OFFIS_DCMTK_364
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    KATIBA
D: Called Application Name:     ORTHANC
D: Responding Application Name: ORTHANC
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  16384
D: Presentation Contexts:
D:   Context ID:        1 (Accepted)
D:     Abstract Syntax: =FINDStudyRootQueryRetrieveinformationModel
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianExplicit
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-AC ======================
I: Association Accepted (Max Send PDV: 16372)

I: Sending Find Request
D: ===================== OUTGOING DimsE MESSAGE ====================
D: Message Type                  : C-FIND RQ
D: Presentation Context ID       : 1
D: Message ID                    : 1
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveinformationModel
D: Data Set                      : present
D: Priority                      : medium
D: ======================= END DimsE MESSAGE =======================
I: Request Identifiers:
I: 
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0016) UI (no value available)                     #   0,0 SOPClassUID
I: (0008,0018) UI (no value available)                     #   0,0 SOPInstanceUID
I: (0008,0020) DA [20210218-]                              #  10,1 StudyDate
I: (0008,0021) DA [20210218-]                              #  10,1 SeriesDate
I: (0008,0030) TM [0000-2359]                              #  10,1 StudyTime
I: (0008,0031) TM [0000-2359]                              #  10,1 SeriesTime
I: (0008,0050) SH (no value available)                     #   0,0 AccessionNumber
I: (0008,0052) CS [SERIES]                                 #   6,1 QueryRetrieveLevel
I: (0008,0061) CS [SR]                                     #   2,1 ModalitiesInStudy
I: (0008,0070) LO (no value available)                     #   0,0 Manufacturer
I: (0008,0080) LO (no value available)                     #   0,0 InstitutionName
I: (0008,0090) PN (no value available)                     #   0,0 ReferringPhysicianName
I: (0008,1030) LO (no value available)                     #   0,0 StudyDescription
I: (0008,103e) LO (no value available)                     #   0,0 SeriesDescription
I: (0008,1040) LO (no value available)                     #   0,0 InstitutionalDepartmentName
I: (0008,1048) PN (no value available)                     #   0,0 PhysiciansOfRecord
I: (0010,0010) PN (no value available)                     #   0,0 PatientName
I: (0010,0020) LO [200167394]                              #  10,1 PatientID
I: (0010,0030) DA (no value available)                     #   0,0 PatientBirthDate
I: (0010,0040) CS (no value available)                     #   0,0 PatientSex
I: (0010,1010) AS (no value available)                     #   0,0 PatientAge
I: (0010,21b0) LT (no value available)                     #   0,0 AdditionalPatientHistory
I: (0020,000d) UI (no value available)                     #   0,0 StudyInstanceUID
I: (0020,0010) SH (no value available)                     #   0,0 StudyID
I: (0032,1032) PN (no value available)                     #   0,0 RequestingPhysician
I: (0040,a730) SQ (Sequence with explicit length #=0)      #   0,1 ContentSequence
I: (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) #   0,0 SequenceDelimitationItem
I: 
T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning
T: DcmItem::insert() Element (0000,0100) VR="US" inserted
T: DcmItem::insert() Element (0000,0110) VR="US" inserted
T: DcmItem::insert() Element (0000,0800) VR="US" inserted

T: DcmItem::insert() Element (0000,0002) VR="UI" inserted
T: DcmItem::insert() Element (0000,0700) VR="US" inserted
T: DimsE Command to be sent on Presentation Context ID: 1
T: DimsE Command to send:
T: 
T: # Dicom-Data-Set
T: # Used TransferSyntax: Little Endian Explicit
T: (0000,0000) UL 0                                        #   4,1 CommandGroupLength
T: (0000,0002) UI =FINDStudyRootQueryRetrieveinformationModel #  28,1 AffectedSOPClassUID
T: (0000,0100) US 32                                       #   2,1 CommandField
T: (0000,0110) US 1                                        #   2,1 MessageID
T: (0000,0700) US 0                                        #   2,1 Priority
T: (0000,0800) US 1                                        #   2,1 CommandDataSetType
T: 
T: DimsE sendDcmDataset: sending 88 bytes
T: DUL  FSM Table: State: 6 Event: 8
T: DUL  Event:  P-DATA request primitive
T: DUL  Action: DT 1 Send P DATA PDU
T: DimsE sendDcmDataset: sending 270 bytes
T: DUL  FSM Table: State: 6 Event: 8
T: DUL  Event:  P-DATA request primitive
T: DUL  Action: DT 1 Send P DATA PDU
T: DimsE receiveCommand
T: Read PDU HEAD TCP: 04 00 00 00 00 5e
T: Read PDU HEAD TCP: type: 04,length: 94 (5e)
T: DUL  FSM Table: State: 6 Event: 9
T: DUL  Event:  P-DATA-TF PDU (on transport)
T: DUL  Action: DT 2 Indicate P DATA PDU Received
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
T: DcmItem::insert() Element (0000,0000) VR="UL" inserted at beginning
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::insert() Element (0000,0002) VR="UI" inserted
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::insert() Element (0000,0100) VR="US" inserted
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::insert() Element (0000,0120) VR="US" inserted
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::insert() Element (0000,0800) VR="US" inserted
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::insert() Element (0000,0900) VR="US" inserted
T: DcmItem::readSubItem() returns error = normal
T: DcmItem::read() returns error = normal
T: DcmDataset::read() returns error = normal
T: DimsE receiveCommand: 1 PDVs (88 bytes),PresID=1
T: DimsE Command Received:
T: 
T: # Dicom-Data-Set
T: # Used TransferSyntax: Little Endian Implicit
T: (0000,0100) US 32800                                    #   2,0120) US 1                                        #   2,1 MessageIDBeingRespondedTo
T: (0000,0800) US 257                                      #   2,1 CommandDataSetType
T: (0000,0900) US 49152                                    #   2,1 Status
T: 
T: DcmItem::searchSubFromHere() Element (0000,0100) found
T: DcmItem::searchSubFromHere() Element (0000,0120) found
T: DcmItem::searchSubFromHere() Element (0000,0800) found
T: DcmItem::searchSubFromHere() Element (0000,0900) found
T: DcmItem::searchSubFromHere() Element (0000,0002) found
I: Received Final Find Response
D: ===================== INCOMING DimsE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Message ID Being Responded To : 1
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveinformationModel
D: Data Set                      : none
D: DimsE Status                  : 0xc000: Error: Failed - Unable to process
D: ======================= END DimsE MESSAGE =======================
I: Releasing Association
T: DUL  FSM Table: State: 6 Event: 10
T: DUL  Event:  A-RELEASE request primitive
T: DUL  Action: AR 1 Send Release RQ
T: Read PDU HEAD TCP: 06 00 00 00 00 04
T: Read PDU HEAD TCP: type: 06,length: 4 (04)
T: DUL  FSM Table: State: 7 Event: 12
T: DUL  Event:  A-RELEASE-RP PDU (on transport)
T: DUL  Action: AR 3 Confirm Release

这是工作查询的日志:

D: Request Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.5
D: Our Implementation Version Name:   OFFIS_DCMTK_365
D: Their Implementation Class UID:    
D: Their Implementation Version Name: 
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    KATIBA
D: Called Application Name:     ORTHANC
D: Responding Application Name: ORTHANC
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  0
D: Presentation Contexts:
D:   Context ID:        1 (Proposed)
D:     Abstract Syntax: =FINDStudyRootQueryRetrieveinformationModel
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianExplicit
D:       =BigEndianExplicit
D:       =LittleEndianImplicit
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-RQ ======================
I: Requesting Association
T: DUL  FSM Table: State: 1 Event: 0
T: DUL  Event:  A-ASSOCIATE request (local user)
T: DUL  Action: AE 1 Transport Connect
D: setting network send timeout to 60 seconds
D: setting network receive timeout to 60 seconds
T: checking whether environment variable TCP_BUFFER_LENGTH is set
T:   environment variable TCP_BUFFER_LENGTH not set,0020) LO [01TEST12]                               #   8,0800) VR="US" inserted
T: DcmItem::insert() Element (0000,1 CommandDataSetType
T: 
T: DimsE sendDcmDataset: sending 88 bytes
T: DUL  FSM Table: State: 6 Event: 8
T: DUL  Event:  P-DATA request primitive
T: DUL  Action: DT 1 Send P DATA PDU
T: DimsE sendDcmDataset: sending 268 bytes
T: DUL  FSM Table: State: 6 Event: 8
T: DUL  Event:  P-DATA request primitive
T: DUL  Action: DT 1 Send P DATA PDU
T: DimsE receiveCommand
T: Read PDU HEAD TCP: 04 00 00 00 00 5e
T: Read PDU HEAD TCP: type: 04,0000) VR="UL" inserted at beginning
T: DcmItem::readSubItem() returns error = normal
T: DcmDataset::read() returns error = normal

T: DimsE receiveCommand: 1 PDVs (88 bytes),0900) US 65280                                    #   2,0002) found
T: Read PDU HEAD TCP: 04 00 00 00 3f f8
T: Read PDU HEAD TCP: type: 04,length: 16376 (3ff8)
T: DUL  FSM Table: State: 6 Event: 9
T: DUL  Event:  P-DATA-TF PDU (on transport)
T: DUL  Action: DT 2 Indicate P DATA PDU Received
D: DcmDataset::read() TransferSyntax="Little Endian Explicit"

T: DcmSequenceOfItems::read() returns error = normal
T: DcmItem::insert() Element (0040,a043) VR="SQ" inserted
T: DcmItem::readSubItem() returns error = normal
T: DimsE receiveDataSetInMemory: 11642 bytes read (last: YES)
T: DcmItem::searchSubFromHere() Element (0008,0018) found
T: DcmItem::searchSubFromHere() Element (0008,0016) found
T: DcmItem::searchSubFromHere() Element (0040,a730) found
T: DcmItem::searchSubFromHere() Element (0040,a010) found
T: DcmItem::searchSubFromHere() Element (0040,a040) found
T: DcmItem::searchSubFromHere() Element (0040,a043) found
//more truncated repetitive log
T: DimsE receiveCommand
T: Read PDU HEAD TCP: 04 00 00 00 00 5e
T: Read PDU HEAD TCP: type: 04,0900) US 0                                        #   2,0002) found
I: Received Final Find Response
D: ===================== INCOMING DimsE MESSAGE ====================
D: Message Type                  : C-FIND RSP
D: Message ID Being Responded To : 1
D: Affected SOP Class UID        : FINDStudyRootQueryRetrieveinformationModel
D: Data Set                      : none
D: DimsE Status                  : 0x0000: Success
D: ======================= END DimsE MESSAGE =======================
I: Releasing Association

解决方法

您的请求的不同之处仅在于您的非工作查询查询不同的患者 ID。

两个查询中的一个明显错误是,对于 STUDY-ROOT 中的 SERIES 级请求,您不能包含患者 ID 的值,而是研究实例 UID 的值。这在 DICOM 方面是错误的,但 Orthanc 似乎能够处理它。然而,这是我可以从您的日志中获得的唯一提示,所以我会尝试一下。

请注意,内容序列不是 C-FIND 的强制返回键,因此您永远不能依赖支持它的 SCP。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...