找回密码
 欢迎注册
搜索
热搜: 活动 交友 discuz
查看: 2478|回复: 3

dicom 打印

[复制链接]
发表于 2009-5-4 10:43:48 | 显示全部楼层 |阅读模式
有以下这此过程:

Association Request

1. 创建Print Job:用 N-CREATE 创建一次打印操作

2. 创建Film Session :用 N-CREATE 创建一个打印会话

3. 创建Film Box :用 N-CREATE 创建,这个创建的就是一张胶片!

4. 设置Image Box :用N-SET设置要打印到胶片上的图片!

...根据需要设置打印的图片数

N-ACTION :开始打印

N-DELETE :删除Film Box

N-DELETE :删除Film Session

N-DELETE :删除Print Job

Release Association。

我在网上看到打印需要这几个步骤,哪位大侠能不能解释下。
发表于 2009-5-4 12:04:06 | 显示全部楼层
大概就是这样的,还需要什么解释啊?剩下的就是编程照此和DICOM标准进行实现了,呵呵
 楼主| 发表于 2009-5-5 14:34:41 | 显示全部楼层
这是我根据上面步骤参考DCMTK 里面dcmprscu工程写了段代码

   opt_ownerID="mypringd";
   opt_mediumtype="CS";//printer medium type identifier, may be empty. VR=CS, VM=1
   opt_destination="CS";//printer film destination identifier, may be empty. VR=CS, VM=1
   opt_sessionlabel="CS";//printer film session label, may be empty. VR=LO, VM=1
   opt_priority="MED";  //  printer print priority, may be empty. VR=CS, VM=1, *  enumerated values: HIGH, MED, LOW
   targetHostname              ="127.0.0.1";
   targetDescription           ="first printer test";
   targetAETitle               ="DataAEtitle";
   targetPort                  =104;
   targetMaxPDU                =32768;
   targetImplicitOnly          =OFTrue;
   targetDisableNewVRs         =OFFalse;   
   targetSupportsPLUT          =OFTrue;
   targetSupportsAnnotation    =OFTrue;
   targetSupports12bit         = OFTrue;
   targetPLUTinFilmSession     =OFTrue;
   targetRequiresMatchingLUT   =OFTrue;
   deleteTerminateJobs         = OFFalse;
   useTLS                      = OFFalse;

   // we have successfully read the Stored Print, now open connection to printer
   OFString NetWorkAETitle("app first printe");
  
   DVPSPrintMessageHandler printHandler;
   result = printHandler.negotiateAssociation(tlayer,
    NetWorkAETitle.c_str(),//
    targetAETitle,//
    targetHostname,
    targetPort,
    targetMaxPDU,//32768
    targetSupportsPLUT, //true
    targetSupportsAnnotation, //false
    targetImplicitOnly);//false

   if(result!=EC_Normal)
   {
    return false;
   }
   DVPSStoredPrint storePrint(2000,10,NULL);
   result = storePrint.printSCUgetPrinterInstance(printHandler);
   if (EC_Normal != result)
   {
    *logstream << "spooler: printer communication failed, unable to request printer settings." << endl;
   }
   if (EC_Normal==result)
   {
    result = storePrint.printSCUpreparePresentationLUT(printHandler,
               targetRequiresMatchingLUT,
               targetPreferSCPLUTRendering,
               targetSupports12bit);
    if (EC_Normal != result)
     *logstream << "unable to create presentation LUT." << endl;
   }
   if (EC_Normal==result)
   {
    result = storePrint.printSCUcreateBasicFilmSession(printHandler, *dset,OFTrue);
    if (EC_Normal != result)
     *logstream << " unable to create basic film session." << endl;
   }
   if (EC_Normal==result)   
   {
    targetPLUTinFilmSession=OFFalse;
    result = storePrint.printSCUcreateBasicFilmBox(printHandler, targetPLUTinFilmSession);//失败了。??????????
    if (EC_Normal != result)
     *logstream << "unable to create basic film box." << endl;
   
   }  

但storePrint.printSCUcreateBasicFilmBox(printHandler, targetPLUTinFilmSession);返回失败了。
是不是我调用顺序错了?
发表于 2009-8-15 23:34:20 | 显示全部楼层
dcmtk我原来用这个开发出来打印的,但改了不少程序,很多都是自己加进去,才能满足医院需求,现在不用了。
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

快速回复 返回顶部 返回列表