DCMTK: DcmSCP, error:QueryRetrieveLevel larger remaining bytes

最近在DcmSCU发送一个findRequest后,DcmSCP总是报一个错误:

 

hi, all.

when i send a findRequest in DcmSCU, it will be successful to receive response.
but then the DcmServer will take place an error, as follows.

Quote:
"2012-11-03 16:12:25.758 INFO: Sending C-Find Response" 
"2012-11-03 16:12:27.795 DEBUG: C-FIND Response successfully sent" 
"2012-11-03 16:12:29.678 DEBUG: DcmDataset::read() TransferSyntax="Little Endian Implicit"" 
"2012-11-03 16:12:29.678 WARN: DcmItem: Length of element (0008,0052) is odd" 
"2012-11-03 16:12:29.679 ERROR: DcmElement: QueryRetrieveLevel (0008,0052) larger (414531) than remaining bytes (20) in file, premature end of stream" 
"2012-11-03 16:12:29.679 DEBUG: DIMSE Error, detail (if available): 0006:020d DIMSE: receiveCommand: cmdSet->read() Failed2012-11-03 16:12:29.679 DEBUG: 0001:0004 Invalid stream" 
"2012-11-03 16:12:59.681 DEBUG: DcmSCP: Association Terminated" 
"2012-11-03 16:12:59.681 DEBUG: +++++++++++++++++++++++++++++

 

最后的解决方法是:

 

I have found the anwser  Something about the findscu tool

we should implement the callback function to set response->DimseStatus=STATUS_Success;

Code:
typedef void (*DIMSE_FindProviderCallback)(
        /* in */
        void *callbackData,
        OFBool cancelled, T_DIMSE_C_FindRQ *request,
        DcmDataset *requestIdentifiers, int responseCount,
        /* out */
        T_DIMSE_C_FindRSP *response,
        DcmDataset **responseIdentifiers,
        DcmDataset **statusDetail);

DCMTK_DCMNET_EXPORT OFCondition
DIMSE_findProvider(
        /* in */
        T_ASC_Association *assoc,
        T_ASC_PresentationContextID presIdCmd,
        T_DIMSE_C_FindRQ *request,
        DIMSE_FindProviderCallback callback, void *callbackData,
        /* blocking info for data set */
        T_DIMSE_BlockingMode blockMode, int timeout);



my callBack function:
Code:
void FindProviderCallback(
   /* in */ 
   void *callbackData,  
   OFBool cancelled, T_DIMSE_C_FindRQ *request, 
   DcmDataset *requestIdentifiers, int responseCount,
   /* out */
   T_DIMSE_C_FindRSP *response,
   DcmDataset **responseIdentifiers,
   DcmDataset **statusDetail)
{
   if (responseCount>1)
   {
      //*responseIdentifiers=NULL;
      response->DimseStatus=STATUS_Success;
   }
   else   
   {
      if(request->DataSetType==DIMSE_DATASET_PRESENT) //or some other conditions are met
         *responseIdentifiers=new DcmDataset(*requestIdentifiers);     
   }
}


Thanks all.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值