pydicom / pynetdicom

A Python implementation of the DICOM networking protocol
https://pydicom.github.io/pynetdicom
MIT License
500 stars 176 forks source link

pynetdicom 2.1.0 scu received [Early termination of tag. Data is missing] #941

Closed Cnbcaroline closed 3 months ago

Cnbcaroline commented 3 months ago
Frame 478032: 204 bytes on wire (1632 bits), 204 bytes captured (1632 bits) on interface \Device\NPF_{DA79A545-AE6D-4C3A-84B1-7CBAD0BE82D7}, id 0
    Section number: 1
    Interface id: 0 (\Device\NPF_{DA79A545-AE6D-4C3A-84B1-7CBAD0BE82D7})
        Interface name: \Device\NPF_{DA79A545-AE6D-4C3A-84B1-7CBAD0BE82D7}
        Interface description: 以太网
    Encapsulation type: Ethernet (1)
    Arrival Time: Jun  5, 2024 13:45:21.840739000 中国标准时间
    [Time shift for this packet: 0.000000000 seconds]
    Epoch Time: 1717566321.840739000 seconds
    [Time delta from previous captured frame: 0.000169000 seconds]
    [Time delta from previous displayed frame: 0.096167000 seconds]
    [Time since reference or first frame: 4762.129773000 seconds]
    Frame Number: 478032
    Frame Length: 204 bytes (1632 bits)
    Capture Length: 204 bytes (1632 bits)
    [Frame is marked: False]
    [Frame is ignored: False]
    [Protocols in frame: eth:ethertype:ip:tcp:dicom]
    [Coloring Rule Name: TCP]
    [Coloring Rule String: tcp]
Ethernet II, Src: Giga-Byt_cb:33:b4 (74:56:3c:cb:33:b4), Dst: ASUSTekC_d6:c2:33 (04:d9:f5:d6:c2:33)
    Destination: ASUSTekC_d6:c2:33 (04:d9:f5:d6:c2:33)
        Address: ASUSTekC_d6:c2:33 (04:d9:f5:d6:c2:33)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Source: Giga-Byt_cb:33:b4 (74:56:3c:cb:33:b4)
        Address: Giga-Byt_cb:33:b4 (74:56:3c:cb:33:b4)
        .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
        .... ...0 .... .... .... .... = IG bit: Individual address (unicast)
    Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.10.91, Dst: 192.168.10.31
    0100 .... = Version: 4
    .... 0101 = Header Length: 20 bytes (5)
    Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
        0000 00.. = Differentiated Services Codepoint: Default (0)
        .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
    Total Length: 190
    Identification: 0x2e53 (11859)
    010. .... = Flags: 0x2, Don't fragment
        0... .... = Reserved bit: Not set
        .1.. .... = Don't fragment: Set
        ..0. .... = More fragments: Not set
    ...0 0000 0000 0000 = Fragment Offset: 0
    Time to Live: 128
    Protocol: TCP (6)
    Header Checksum: 0x361c [validation disabled]
    [Header checksum status: Unverified]
    Source Address: 192.168.10.91
    Destination Address: 192.168.10.31
Transmission Control Protocol, Src Port: 141, Dst Port: 49264, Seq: 4331, Ack: 150181, Len: 150
    Source Port: 141
    Destination Port: 49264
    [Stream index: 686]
    [Conversation completeness: Complete, WITH_DATA (31)]
    [TCP Segment Len: 150]
    Sequence Number: 4331    (relative sequence number)
    Sequence Number (raw): 682633940
    [Next Sequence Number: 4481    (relative sequence number)]
    Acknowledgment Number: 150181    (relative ack number)
    Acknowledgment number (raw): 401658559
    0101 .... = Header Length: 20 bytes (5)
    Flags: 0x018 (PSH, ACK)
        000. .... .... = Reserved: Not set
        ...0 .... .... = Accurate ECN: Not set
        .... 0... .... = Congestion Window Reduced: Not set
        .... .0.. .... = ECN-Echo: Not set
        .... ..0. .... = Urgent: Not set
        .... ...1 .... = Acknowledgment: Set
        .... .... 1... = Push: Set
        .... .... .0.. = Reset: Not set
        .... .... ..0. = Syn: Not set
        .... .... ...0 = Fin: Not set
        [TCP Flags: ·······AP···]
    Window: 8212
    [Calculated window size: 2102272]
    [Window size scaling factor: 256]
    Checksum: 0xd012 [unverified]
    [Checksum Status: Unverified]
    Urgent Pointer: 0
    [Timestamps]
        [Time since first frame in this TCP stream: 0.209495000 seconds]
        [Time since previous frame in this TCP stream: 0.000169000 seconds]
    [SEQ/ACK analysis]
        [iRTT: 0.000496000 seconds]
        [Bytes in flight: 150]
        [Bytes sent since last PSH flag: 150]
    TCP payload (150 bytes)
    TCP segment data (150 bytes)
[2 Reassembled TCP Segments (162 bytes): #478025(12), #478032(150)]
    [Frame: 478025, payload: 0-11 (12 bytes)]
    [Frame: 478032, payload: 12-161 (150 bytes)]
    [Segment count: 2]
    [Reassembled TCP length: 162]
    [Reassembled TCP Data: 04000000009c000000981f0300000000040000008a000000000002001a000000312e322e…]
DICOM, Command
    PDU Type: Data (0x04)
    PDU Length: 156
    PDV, Command
        PDV Length: 152
        Context: 0x1f (Deflated Explicit VR Little Endian, CT Image Storage)
        Flags: 0x03 (Command, Last Fragment)
        (d95b,b377)      52447 Private Tag                                   [�d] <incomplete>
            [Expert Info (Error/Malformed): Early termination of tag. Data is missing]
                [Early termination of tag. Data is missing]
                [Severity level: Error]
                [Group: Malformed]
  1. use send_c_store to send CT Image Storage
  2. dicom file is stored successfully, but the cstore scu did not receive successful response
  3. the package I captured use wireshark show the P-DATA Command has mistake as above image
scaramallion commented 3 months ago

Can you post your code and the output from debug_logger(), please?

from pynetdicom import debug_logger

debug_logger()

# ... your code

Can you also attach the dataset you're trying to send, or if that's not possible can you confirm that it's readable using pydicom:

from pydicom import dcmread

ds = dcmread("path/to/dataset")
print(ds)
Cnbcaroline commented 3 months ago

I resolved it . default transfer_syntax is DeflatedExplicitVRLittleEndian, but scp dose not support it, I use transfer_syntax=[ImplicitVRLittleEndian, ExplicitVRLittleEndian] ,then it work. Thanks for you!