dcm4che 5.22.0 dcmqrscp IncompatibleSpecificCharaterSetException 异常

dcm4che 5.22.0 dcmqrscp IncompatibleSpecificCharaterSetException

我正在尝试使用新的 dcm4che 版本 5.22.0 更具体地说 dcmqrscp 工具: https://github.com/dcm4che/dcm4che/blob/master/dcm4che-tool/dcm4che-tool-dcmqrscp/README.md

我正在启动一个实例:

dcmqrscp -b DCMROUTER:435 --dicomdir /media/cdrom/DICOMDIR

但是我在关联请求期间收到以下异常(无论我尝试发送的研究是什么):

11:12:29,896 INFO  - Accept connection Socket[addr=/127.0.0.1,port=52127,localport=4006]
11:12:29,917 DEBUG - /127.0.0.1:4006<-/127.0.0.1:52127(1): enter state: Sta2 - Transport connection open
11:12:29,937 INFO  - DCMROUTER<-MAYAM(1) >> A-ASSOCIATE-RQ
11:12:29,942 DEBUG - A-ASSOCIATE-RQ[
  calledAET: DCMROUTER
  callingAET: MAYAM
  applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
  implClassUID: 1.2.40.0.13.1.1
  implVersionName: dcm4che-2.0
  maxPDULength: 16384
  maxOpsInvoked/maxOpsPerformed: 0/0
  PresentationContext[id: 1
    as: 1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
    ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
  ]
  PresentationContext[id: 3
    as: 1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
    ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
  ]
]
11:12:29,942 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta3 - Awaiting local A-ASSOCIATE response primitive
11:12:29,942 INFO  - DCMROUTER<-MAYAM(1) << A-ASSOCIATE-AC
11:12:29,942 DEBUG - A-ASSOCIATE-AC[
  calledAET: DCMROUTER
  callingAET: MAYAM
  applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
  implClassUID: 1.2.40.0.13.1.3
  implVersionName: dcm4che-5.22.0
  maxPDULength: 16378
  maxOpsInvoked/maxOpsPerformed: 0/0
  PresentationContext[id: 1
    result: 0 - acceptance
    ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
  ]
  PresentationContext[id: 3
    result: 0 - acceptance
    ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
  ]
]
11:12:29,943 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta6 - Association established and ready for data transfer
11:12:29,947 INFO  - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ[pcid=3, prior=0
  cuid=1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
  iuid=2.25.236888348187743071893701493905889154404.2 - ?
  tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian]
11:12:29,968 DEBUG - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ Command:
(0000,0002) UI [1.2.840.10008.5.1.4.1.1.4] AffectedSOPClassUID
(0000,0100) US [1] CommandField
(0000,0110) US [1] MessageID
(0000,0700) US [0] Priority
(0000,0800) US [0] CommandDataSetType
(0000,1000) UI [2.25.236888348187743071893701493905889154404.2] AffectedSOPIns

11:12:29,969 DEBUG - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ Dataset receiving...
11:12:29,969 INFO  - DCMROUTER<-MAYAM(1): M-WRITE \media\cdrom.25.236888348187743071893701493905889154404.2
11:12:29,988 INFO  - DCMROUTER<-MAYAM(1): M-RENAME \media\cdrom.25.236888348187743071893701493905889154404.2
11:12:30,072 INFO  - M-UPDATE \media\cdrom\DICOMDIR: add STUDY Record
11:12:30,074 INFO  - DCMROUTER<-MAYAM(1): M-DELETE \media\cdrom\DICOMEEF683AA0D620E6BFF30
11:12:30,075 INFO  - DCMROUTER<-MAYAM(1): processing 1:C-STORE-RQ[pcid=3, prior=0
  cuid=1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
  iuid=2.25.236888348187743071893701493905889154404.2 - ?
  tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian] failed. Caused by:
  org.dcm4che3.net.service.DicomServiceException: org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Specific Character Sets [] and [ISO_IR 100] not compatible
        at org.dcm4che3.tool.dcmqrscp.DcmQRSCP$CStoreSCPImpl.store(DcmQRSCP.java:176)
        at org.dcm4che3.net.service.BasicCStoreSCP.onDimseRQ(BasicCStoreSCP.java:72)
        at org.dcm4che3.net.service.DicomServiceRegistry.onDimseRQ(DicomServiceRegistry.java:86)
        at org.dcm4che3.net.ApplicationEntity.onDimseRQ(ApplicationEntity.java:474)
        at org.dcm4che3.net.Association.onDimseRQ(Association.java:746)
        at org.dcm4che3.net.PDUDecoder.decodeDIMSE(PDUDecoder.java:467)
        at org.dcm4che3.net.Association.handlePDataTF(Association.java:729)
        at org.dcm4che3.net.State.onPDataTF(State.java:103)
        at org.dcm4che3.net.Association.onPDataTF(Association.java:725)
        at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:177)
        at org.dcm4che3.net.Association.run(Association.java:562)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Specific Character Sets [] and [ISO_IR 100] not compatible
        at org.dcm4che3.data.Attributes.add(Attributes.java:2103)
        at org.dcm4che3.data.Attributes.addSelected(Attributes.java:2060)
        at org.dcm4che3.media.RecordFactory.createRecord(RecordFactory.java:255)
        at org.dcm4che3.tool.dcmqrscp.DcmQRSCP.addDicomDirRecords(DcmQRSCP.java:1087)
        at org.dcm4che3.tool.dcmqrscp.DcmQRSCP$CStoreSCPImpl.store(DcmQRSCP.java:167)
        ... 13 more
11:12:30,083 INFO  - DCMROUTER<-MAYAM(1) << 1:C-STORE-RSP[pcid=3, status=110H, errorComment=org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Spec
  tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian]
11:12:30,083 DEBUG - DCMROUTER<-MAYAM(1) << 1:C-STORE-RSP Command:
(0000,0100) US [32769] CommandField
(0000,0120) US [1] MessageIDBeingRespondedTo
(0000,0800) US [257] CommandDataSetType
(0000,0900) US [272] Status
(0000,0902) LO [org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Sp

11:12:30,088 INFO  - DCMROUTER<-MAYAM(1) >> A-RELEASE-RQ
11:12:30,088 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta8 - Awaiting local A-RELEASE response primitive
11:12:30,088 INFO  - DCMROUTER<-MAYAM(1) << A-RELEASE-RP
11:12:30,089 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta13 - Awaiting Transport Connection Close Indication
11:12:30,093 DEBUG - DCMROUTER<-MAYAM(1): closing Socket[addr=/127.0.0.1,port=52127,localport=4006] in 50 ms
11:12:30,142 INFO  - DCMROUTER<-MAYAM(1): close Socket[addr=/127.0.0.1,port=52127,localport=4006]
11:12:30,142 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta1 - Idle

知道 5.22.0 中发生了什么变化并可能导致此错误吗?

查看 github 上的源代码,似乎最近添加了例外。

package org.dcm4che3.data;

/**
 * @author Gunter Zeilinger (gunterze@protonmail.com)
 * @since Mar 2020
 */
public class IncompatibleSpecificCharaterSetException extends IllegalArgumentException {
    public IncompatibleSpecificCharaterSetException(String s) {
        super(s);
    }
}

显然,您需要自己set支持的特定字符集。

public void setSpecificCharacterSet(String... codes) {
    ensureModifiable();
    decodeStringValuesUsingSpecificCharacterSet();
    setString(Tag.SpecificCharacterSet, VR.CS, codes);
}

没有它,它会抛出异常 here and here

readme中提到的命令行上:

--fs-desc-cs <code>                 Character Set used in File-set
                                        Descriptor File ("ISO_IR 100" =
                                        ISO Latin 1)

@thanili 的

这是一个错误,希望现在已修复。详情请参考github源代码。