`
qimo601
  • 浏览: 3418491 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

DCMTK DCMSCU例子

阅读更多

转载:http://forum.dcmtk.org/viewtopic.php?f=1&t=2812&hilit=DCMNET



Post new topic Reply to topic  [ 31 posts ]  Go to page 123  Next
Author Message
 Post subject: connect to PACS system biginner question
PostPosted: Wed, 2011-01-26, 13:57 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Hi all, 

I need sample code / example in how to connect to pacs sustem and test teh connection 


your fast reply is highly appreciated


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-01-26, 14:59 
Offline

Joined: Wed, 2009-07-08, 17:06
Posts: 88
Location: Oldenburg, Germany
I would recommend using the DCMSCU Class 
Here is a simplified pseudocode 
Quote:
DcmSCU *SCU = new DcmSCU (this);
OFList<OFString> XferSyntaxes;

if (SCU != NULL)
{
SCU ->setPeerAETitle(PeerAETitle);
SCU ->setPeerHostName(PeerHostName);
SCU ->setPeerPort(PeerPortNumber);
// Add Preferred Outgoing Transfer Syntaxes 
XferSyntaxes.push_back (UID_LittleEndianImplicitTransferSyntax);
XferSyntaxes.push_back(UID_LittleEndianExplicitTransferSyntax);
.....
.....
// Add Presentation Context for each required SOP Class UID
SCU ->addPresentationContext(SOPClassUID, XferSyntaxes);
.....
.....
status = SCU ->initNetwork();
status=SCU->negotiateAssociation();
const T_ASC_PresentationContextID presID = SCU->findPresentationContextID(AbstractSyntax,TransferSyntax);
//Send Request on a presentation context ID
...
...

//Close Association
SCU->closeAssociation();
}


Last edited by omarelgazzar on Wed, 2011-05-25, 13:12, edited 3 times in total. 

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-01-26, 15:03 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
omarelgazzar wrote:
There is an example in the documentation for echoscu

However, I would recommend using the DCMSCU Class

Quote:
SCU = new DcmSCU (this);

if (SCU != NULL)
{
SCU ->setPeerAETitle(PeerAETitle);
SCU ->setPeerHostName(PeerHostName);
SCU ->setPeerPort(PeerPortNumber);
SCU ->addPresentationContexts(PreferredOutgoingSyntax);
status = SCU ->initNetwork();
status=SCU->negotiateAssociation();
SCU->findPresentationContext(..,..)
//Send Request
...
...

//Close Association
SCU->closeAssociation();
}

Hope that helps.


I face a problem while use DCMTK which is 

/Users/abduljaleelmalik/full-dcmtk/include/dcmtk/ofstd/ofstream.h:80:0 /Users/abduljaleelmalik/full-dcmtk/include/dcmtk/ofstd/ofstream.h:80:2: error: #error DCMTK needs stringstream or strstream type 


#define INCLUDE_CSTDIO 
#include "dcmtk/ofstd/ofstdinc.h" 
#include <dcmtk/dcmimgle/dcmimage.h> 
#include <dcmtk/config/osconfig.h> 
#include <dcmtk/dcmimgle/dcmimage.h> 

how can I override that


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-01-26, 15:33 
Offline

Joined: Wed, 2009-07-08, 17:06
Posts: 88
Location: Oldenburg, Germany
First of all, you should include osconfig.h at the top of all other included files. So, your code should look like 

#define INCLUDE_CSTDIO 
#include <dcmtk/config/osconfig.h> 
... 
...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 09:12 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
omarelgazzar wrote:
First of all, you should include osconfig.h at the top of all other included files. So, your code should look like

#define INCLUDE_CSTDIO
#include <dcmtk/config/osconfig.h> 
...
...


it gave the same error


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 11:49 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

try to add "-DHAVE_CONFIG_H" to your compiler flags, otherwise including osconfig.h does actually nothing. 

Best regards, 
Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 11:59 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Michael Onken wrote:
Hi,

try to add "-DHAVE_CONFIG_H" to your compiler flags, otherwise including osconfig.h does actually nothing.

Best regards,
Michael


how can I do that in xcode , there're no direct compiler flag 

there're 
OpenMP linker flags 
other linker flags 
symbol ordering flags 
warning linker flag 

I tried add it to other linker flags , but the same error appeared 

I tried also to add 

#undef verifty 
#define INCLUDE_CSTDIO 
#include <dcmtk/config/osconfig.h> 
#include <dcmtk/dcmimgle/dcmimage.h> 

but the error /DCMTK_BINARY/include/dcmtk/ofstd/ofstream.h:80:0 /DCMTK_BINARY/include/dcmtk/ofstd/ofstream.h:80:2: error: #error DCMTK needs stringstream or strstream type 

still appear in ofstream.h 

#include <iostream.h> 
#include <fstream.h> 
// For old STREAMS library: preference for strstream 
#if defined(HAVE_STRSTREA_H) || defined(HAVE_STRSTREAM_H) 
#ifdef HAVE_STRSTREA_H 
#include <strstrea.h> 
#else 
#include <strstream.h> 
#endif 
#elif defined(HAVE_SSTREAM_H) 
#include <sstream.h> 
#define USE_STRINGSTREAM 
#else 
#error DCMTK needs stringstream or strstream type 
#endif 
#include <iomanip.h>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 12:10 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

It is not a Linker flag, it is a compiler flag. First, every .cc file is compiled into an object file, then in the end, they are linked together into applications. You can recognize an application if one of the objects (and only one) contains a main() function. 

I do not have a mac here, but there will surely be change to change the compile flags, not only the linker flags. Just right-click on file to be compiled, and look for compiler or build flags. Maybe again, google may help

This is not a dcmtk-related problem. 

Best regards, 
Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 12:34 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Michael Onken wrote:
Hi,

It is not a Linker flag, it is a compiler flag. First, every .cc file is compiled into an object file, then in the end, they are linked together into applications. You can recognize an application if one of the objects (and only one) contains a main() function.

I do not have a mac here, but there will surely be change to change the compile flags, not only the linker flags. Just right-click on file to be compiled, and look for compiler or build flags. Maybe again, google may help.

This is not a dcmtk-related problem.

Best regards,
Michael


I build dcmtk succesfuly my problem in using it 
the error appear while usiing it


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 12:38 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Right, and I said you would to do (add a compile flag); the rest is now up to you: learning how to do that with your compiler (Xcode/gcc).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 13:30 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Michael Onken wrote:
Right, and I said you would to do (add a compile flag); the rest is now up to you: learning how to do that with your compiler (Xcode/gcc).


it compiled corectly , 

I need example to 
-test the connection with pacs I missed omarelgazar reply 
- read local dicom file and convert it to buffer data 

any suggestion please


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 13:51 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

Omar's code snippet was just fine. If you need a full example, look might look at the demo SCU from the CTK project

Good luck, 
Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 13:57 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Michael Onken wrote:
Hi,

Omar's code snippet was just fine. If you need a full example, look might look at the demo SCU from the CTK project.

Good luck,
Michael

thanks alot , 
what about read local dcm file , I need to read the image data as buffer 

any suggestion please


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 14:54 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

have a look at the dcmdata online documentation

Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-01-27, 14:57 
Offline

Joined: Sun, 2010-12-26, 18:34
Posts: 85
Michael Onken wrote:
Hi,

have a look at the dcmdata online documentation.

Michael


final question, and sorry for my naive questions, I am in my first steps in imaging 

how to get the following information using DCMTK 
bitsPerComponent; 
bitsPerPixel; 
bytesPerRow; 

from the DCM file


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous: All posts 1 day 7 days 2 weeks 1 month 3 months 6 months 1 year Sort by Author Post time Subject Ascending Descending 
Post new topic Reply to topic  [ 31 posts ]  Go to page 123  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: qimo601 and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum

Search for:  
Jump to:   Select a forum  ------------------  General     Announcements     Imprint / Impressum     Off-topic  DCMTK     DCMTK - FAQ     DCMTK - Installation     DCMTK - General     Third-Party DCMTK Applications  DICOMscope     DICOMscope - Installation     DICOMscope - General     IHE MESA CPI Test Suite  Other Tools     DCMPRINT     DCMCHECK     DCMJP2K     DCMRT     Other DICOM Tools  DRG CD-Test (in German language)     Allgemeine Diskussion / General Discussion     Anforderungskatalog / CD Specification     Leitfaden für Patienten-CDs / Guidelines for Handling Patient CDs     CD-Prüfung / CD Validation     
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired username to the OFFIS DICOM team
Last visit was: Thu, 2012-09-13, 09:16 It is currently Thu, 2012-09-13, 12:48

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  123  Next
Author Message
 Post subject:
PostPosted: Thu, 2011-01-27, 16:43 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
You should read about that in part 3 of the DICOM standard to find out which DICOM attributes (tags) you really need. The ones you quoted do not exist directly.

So read about the Image Pixel Module, especially look for the attributes Bts Allocated, Stored, and High Bit. Start with the module description in section C.7.6.3. Bits Allocated is how many bits do you have reserved for one pixel component, Bits Stored is how many bits you actually use from those, and High Bit says in which bit from Bits Allocated you start from, i.e. how the Bits Stored are aligned within Bits Allocated. The number of components per pixel is in the attribute Samples per Pixel. 

If you look into the dcmdata example i have directed you to, just exchange DCM_PatientData with the attributes you are interested in and use a number access method, e.g. (according to the example) 
Code:
Uint16 bitsAlloc = 0;
fileformat.getDataset()->findAndGetUint16(DCM_BitsAllocated, bitsAlloc);
// now bitsAlloc contains the content of attribute Bits Allocated


For some examples and figures of various Bits allocated/stored/high bit settings, look into part, read Annex D, especially look at the nice little images in D.2 

Best regards, 
Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat, 2011-03-19, 19:12 
Offline

Joined: Wed, 2011-03-16, 15:30
Posts: 14
hi Micheal, I'm also a beginner of dicom. can i have your email or google talk. I have some questions need your help. i am using xcode to make an application to retrieve pacs server data. but I'm really stuck here. your help will be best appreciated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-03-21, 11:07 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

no sorry I cannot provide you with private help since I have work to do. Any questions about DCMTK can be asked in the forum and will also help other people having similar problems. If you have serious problems to be solved and you need commercial support, you may send us an email to dicom at offis de. 

Best regards, 
Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-03-21, 15:30 
Offline

Joined: Wed, 2011-03-16, 15:30
Posts: 14
hi micheal 
I only have some small problems, and i just want the answers instantly, since my project open day is this Thursday. So if you can help me, I will appreciate it very much. It won't cost long time of you... 

now i get a problem. I wanna make a button linked to pacs server. 
Quote:
SCU = new DcmSCU (this); 

if (SCU != NULL) 

SCU ->setPeerAETitle(PeerAETitle); 
SCU ->setPeerHostName(PeerHostName); 
SCU ->setPeerPort(PeerPortNumber); 
SCU ->addPresentationContexts(PreferredOutgoingSyntax); 
status = SCU ->initNetwork(); 
status=SCU->negotiateAssociation(); 
SCU->findPresentationContext(..,..) 
//Send Request 
... 
... 

//Close Association 
SCU->closeAssociation(); 
}

Is this code working? 
Another question, how to request to pacs server then? 
I hope you can reply asap, thanks a million!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-05-16, 20:04 
Offline

Joined: Mon, 2011-04-18, 20:36
Posts: 112
Location: France
Aww the moon198831 answer should be intersting for me too !! 
I want to create the same button but this code doesn't work... 

So I try with this code, from ctkDICOMDemoSCUMain.cpp : 

Code:
int Import::connection(QString qipAdress, QString qport, QString qaet){
  DcmSCU scu;
  OFString host(qipAdress.toAscii());
  scu.setPeerHostName(host);
  unsigned int port = atoi(qport.toAscii());
  scu.setPeerPort(port);
  OFString verificationSOP = UID_VerificationSOPClass;
  OFList<OFString> ts;
  ts.push_back(UID_LittleEndianExplicitTransferSyntax);
  ts.push_back(UID_BigEndianExplicitTransferSyntax);
  ts.push_back(UID_LittleEndianImplicitTransferSyntax);
  scu.addPresentationContext(verificationSOP, ts);
  OFString peerAET = qaet.toAscii();
  if (peerAET != "")
  {
    scu.setPeerAETitle(peerAET);
  }
  OFCondition result = scu.initNetwork();
  if (result.bad())
  {
    std::cerr << "Error setting up SCU: " << result.text() << "\n";
    return 2;
  }
  
  // Negotiate association
  result = scu.negotiateAssociation();
  if (result.bad())
  {
    std::cerr << "Error negotiating association: " << result.text() << "\n";
    return 2;
  }
  
  // Issue ECHO request and let scu find presentation context itself (0)
  result = scu.sendECHORequest(0);
  if (result.bad())
  {
    std::cerr << "Error issuing ECHO request or received rejecting response: " << result.text() << "\n";
    return 2;
  }
  std::cout << "Successfully sent DICOM Echo to host " << host << " on port " << port << "\n";
  return 0;
}


with this import : 
    #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
    #include "dcmtk/dcmnet/scu.h"
    #include "Import.h"
    #include "dcmtk\dcmnet\assoc.h"
    #include "dcmtk\dcmnet\dimse.h"

    #include <cstdlib>
    #include <iostream>
    #include <fstream>


But there is a error message appeared : 
Erreur 1 error LNK2019: symbole externe non résolu "public: virtual __thiscall DcmSCU::~DcmSCU(void)" (??1DcmSCU@@UAE@XZ) référencé dans la fonction "public: static int __cdecl Import::connection(class QString,class QString,class QString)" (?connection@Import@@SAHVQString@@00@Z) C:\Users\Nicolas\Documents\Visual Studio 2010\Projects\Importation\Importation\Import.obj Importation

_________________
Respectueusement, 
MitMal
 

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-05-23, 10:24 
Offline

Joined: Mon, 2011-04-18, 20:36
Posts: 112
Location: France
No idea ???

_________________
Respectueusement, 
MitMal
 

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon, 2011-05-23, 16:50 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Moon: Looking at your code: 

- why are you using the copy constructor? It is defined private in DcmSCU, i.e. shall/can not be used. Just say "SCU = new DcmSCU()"; 
- For adding the presentation context: A presentation context always contains a SOP class and one or more transfer syntaxes. Thus you could do the following (Verification Service with all 3 uncompressed transfer syntaxes): 
Code:
OFList<OFString> ts; 
ts.push_back(UID_LittleEndianExplicitTransferSyntax);
ts.push_back(UID_BigEndianExplicitTransferSyntax);
ts.push_back(UID_LittleEndianImplicitTransferSyntax);
  SCU.addPresentationContext(UID_VerificationSOPClass, ts);


The rest looks OK without testing it (but hey, just try it!).


------------8<-------------------8<------------------

Mitmal: DcmSCU actually has a virtual destructor which is also public (implementation does some memory cleanups).

Code:
virtual ~DcmSCU();


Are you sure you actually link your binary with the dcmnet library? 

Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-05-25, 13:03 
Offline

Joined: Tue, 2011-05-17, 15:34
Posts: 28
Please give me code snippet to retrieve image from Pacs server using DcmSCU class. 

Quick reply would be helpful. 

Thanks in advance.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-05-25, 16:44 
Offline

Joined: Mon, 2011-05-02, 12:54
Posts: 17
Try to use DIMSE_moveUser 

if you can use findrequest you have all info to use moveUser to retrieve imae from PACS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed, 2011-05-25, 17:14 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

here is code that uses DcmSCU and does the following: 

Negotiating Verification (echo), as well as FIND (query) and MOVE (retrieve) SOP Classes with the PACS. Then, send ECHO, send FIND and retrieve all studies that were found within the FIND step by sending a MOVE for each study. Then, release the association. 

Best regards, 
Michael 

Code:
/*
*
*  Copyright (C) 2011, OFFIS e.V.
*  All rights reserved.  See COPYRIGHT file for details.
*
*  This software and supporting documentation were developed by
*
*    OFFIS e.V.
*    R&D Division Health
*    Escherweg 2
*    D-26121 Oldenburg, Germany
*
*
*  Module:  dcmnet
*
*  Author:  Michael Onken
*
*  Purpose: Test for move feature of the DcmSCU class
*
*  Last Update:      $Author: joergr $
*  Update Date:      $Date: 2011-03-17 09:46:02 $
*  CVS/RCS Revision: $Revision: 1.54 $
*  Status:           $State: Exp $
*
*  CVS/RCS Log at end of file
*
*/

#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
#include "dcmtk/dcmnet/testscu.h"
#include "dcmtk/dcmnet/diutil.h"


#define OFFIS_CONSOLE_APPLICATION "testscu"

static OFLogger echoscuLogger = OFLog::getLogger("dcmtk.apps." OFFIS_CONSOLE_APPLICATION);

static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
  OFFIS_DCMTK_VERSION " " OFFIS_DCMTK_RELEASEDATE " $";

// our application entity title used for calling the peer machine
#define APPLICATIONTITLE     "TEST-SCU"

// host name of the peer machine
#define PEERHOSTNAME         "www.dicomserver.co.uk"

// TCP/IP port to connect to on peer machine
#define PEERPORT 11112

// application entity title of the peer machine
#define PEERAPPLICATIONTITLE "MOVESCP"

// MOVE target AE Title
#define MOVEAPPLICATIONTITLE "TEST-SCU"

static Uint8 findUncompressedPC(const OFString& sopClass,
                                DcmSCU& scu)
{
  Uint8 pc;
  pc = scu.findPresentationContextID(sopClass, UID_LittleEndianExplicitTransferSyntax);
  if (pc == 0)
    scu.findPresentationContextID(sopClass, UID_BigEndianExplicitTransferSyntax);
  if (pc == 0)
    scu.findPresentationContextID(sopClass, UID_LittleEndianImplicitTransferSyntax);
  return pc;
}

// ********************************************

int main(int argc, char *argv[])
{
  /* Setup DICOM connection parameters */
  OFLog::configure(OFLogger::DEBUG_LOG_LEVEL);
  DcmTestSCU scu;
  // set AE titles
  scu.setAETitle(APPLICATIONTITLE);
  scu.setPeerHostName(PEERHOSTNAME);
  scu.setPeerPort(PEERPORT);
  scu.setPeerAETitle(PEERAPPLICATIONTITLE);
  // Use presentation context for FIND/MOVE in study root, propose all uncompressed transfer syntaxes
  OFList<OFString> ts; 
  ts.push_back(UID_LittleEndianExplicitTransferSyntax);
  ts.push_back(UID_BigEndianExplicitTransferSyntax);
  ts.push_back(UID_LittleEndianImplicitTransferSyntax);
  scu.addPresentationContext(UID_FINDStudyRootQueryRetrieveInformationModel, ts);
  scu.addPresentationContext(UID_MOVEStudyRootQueryRetrieveInformationModel, ts);
  scu.addPresentationContext(UID_VerificationSOPClass, ts);

  /* Initialize network */
  OFCondition result = scu.initNetwork();
  if (result.bad())
  {
    DCMNET_ERROR("Unable to set up the network: " << result.text());
    return 1;
  }

  /* Negotiate Association */
  result = scu.negotiateAssociation();
  if (result.bad())
  {
    DCMNET_ERROR("Unable to negotiate association: " << result.text());
    return 1;
  }

  /* Let's look whether the server is listening: 
     Assemble and send C-ECHO request 
   */
  result = scu.sendECHORequest(0);
  if (result.bad())
  {
    DCMNET_ERROR("Could not process C-ECHO with the server: " << result.text());
    return 1;
  }


  /* Assemble and send C-FIND request */
  FINDResponses findResponses;
  DcmDataset req;
  req.putAndInsertOFStringArray(DCM_QueryRetrieveLevel, "STUDY");
  req.putAndInsertOFStringArray(DCM_StudyInstanceUID, "");
  T_ASC_PresentationContextID presID = findUncompressedPC(UID_FINDStudyRootQueryRetrieveInformationModel, scu);
  if (presID == 0)
  {
    DCMNET_ERROR("There is no uncompressed presentation context for Study Root FIND");
    return 1;
  }
  result = scu.sendFINDRequest(presID, &req, &findResponses);
  if (result.bad())
    return 1;
  else 
    DCMNET_INFO("There are " << findResponses.numResults() << " studies available");

  /* Assemble and send C-MOVE request, for each study identified above*/
  presID = findUncompressedPC(UID_MOVEStudyRootQueryRetrieveInformationModel, scu);
  if (presID == 0)
  {
    DCMNET_ERROR("There is no uncompressed presentation context for Study Root MOVE");
    return 1;
  }
  OFListIterator(FINDResponse*) study = findResponses.begin();
  Uint32 studyCount = 1;
  OFBool failed = OFFalse;
  while (study != findResponses.end() && result.good())
  {
    // Every loop run will get all image for a specific study
    MOVEResponses moveResponses;
    // be sure we are not in the last response which does not have a dataset
    if ( (*study)->m_dataset != NULL)
    {
      OFString studyInstanceUID;
      result = (*study)->m_dataset->findAndGetOFStringArray(DCM_StudyInstanceUID, studyInstanceUID);
      // only try to get study if we actually have study instance uid, otherwise skip it
      if (result.good())
      {
        req.putAndInsertOFStringArray(DCM_StudyInstanceUID, studyInstanceUID);
        // fetches all images of this particular study
        result = scu.sendMOVERequest(presID, MOVEAPPLICATIONTITLE, &req, &moveResponses);
        if (result.good())
        {
          DCMNET_INFO("Received study #" << std::setw(7) << studyCount << ": " << studyInstanceUID);
          studyCount++;
        }
      }
    }
    study++;
  }
  if (result.bad())
  {
    DCMNET_ERROR("Unable to retrieve all studies: " << result.text());
  }
  /* Release association */
  scu.closeAssociation(DCMSCU_RELEASE_ASSOCIATION);
  return 0;
}

P.S: The header file would be trivial: 
Code:
#ifndef TESTSCU_H
#define TESTSCU_H

#include "dcmtk/config/osconfig.h"  /* make sure OS specific configuration is included first */

#include "dcmtk/dcmnet/scu.h"     /* Covers most common dcmdata classes */


class DcmTestSCU : public DcmSCU
{

public:

  DcmTestSCU()  {}
  ~DcmTestSCU() {}

};

#endif // TESTSCU_H


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Can't find the method scu.sendMOVERequest
PostPosted: Sun, 2011-07-24, 05:17 
Offline

Joined: Tue, 2011-06-28, 14:36
Posts: 28
Location: Chennai
Hi, 

while I m trying to call the method "sendMOVERequest" it says no such method found. Can you please help me out, what I am missing. I am having my latest dcmtk 3.6.0 version. 

Thanks in advance 

with regards 
Manoj Kumar D

_________________
with regards 
Manoj Kumar D
 

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue, 2011-07-26, 11:54 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

sendMOVERequest is only in 3.6.1, it was introduced 2011.04.28 and 3.6.1 was released 2011.02.01. 

All of this information can be found in the CHANGES file. The latest public version is always accessible on the git web interface. Click on "tree" next to one of the files and then on the CHANGES file. 

I recommend you to use the lastest snapshot

MIchael


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu, 2011-08-04, 23:49 
Offline

Joined: Mon, 2010-06-14, 17:41
Posts: 44
Quote:
sendMOVERequest is only in 3.6.1, it was introduced 2011.04.28 and 3.6.1 was released 2011.02.01.


You should add this comment on the wiki page. It took me neraly the whole day for finding this forum thread because i used the last stable release and ask my what i did wrong with the "MOVEResponses moveResponses;" and where is it. :? 

But on this way - i wanna say thank you for the example and the dcmtk code. :-) 

Thank you


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri, 2011-08-05, 12:05 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Alright, thanks for the hint, done now

Michael


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Getting Will not wait for further C-MOVE responses
PostPosted: Fri, 2011-08-12, 17:42 
Offline

Joined: Tue, 2011-06-28, 14:36
Posts: 28
Location: Chennai
Hi, 
I am developing the Dicom app for iPhone. I tried DCMTestSCU with storescp but I am getting 

I: Send C-MOVE Request
W: Status is 0xc001 (unknown)
W: Will not wait for further C-MOVE responses


The code snippet is this: 

Code:
storescp -d 11112

result = scu.sendMOVERequest(presID, "MOVESCP", &req, &moveResponses);


The "APPLICATIONTITLE" in storescp is "MOVESCP" 

Please help me out I m a beginner for PACS Server. 

Thanx in advance.

_________________
with regards 
Manoj Kumar D
 

Report this post
Top
 Profile  
Reply with quote  
Display posts from previous: All posts 1 day 7 days 2 weeks 1 month 3 months 6 months 1 year Sort by Author Post time Subject Ascending Descending 
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  123  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot]qimo601 and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum

Search for:  
Jump to:   Select a forum  ------------------  General     Announcements     Imprint / Impressum     Off-topic  DCMTK     DCMTK - FAQ     DCMTK - Installation     DCMTK - General     Third-Party DCMTK Applications  DICOMscope     DICOMscope - Installation     DICOMscope - General     IHE MESA CPI Test Suite  Other Tools     DCMPRINT     DCMCHECK     DCMJP2K     DCMRT     Other DICOM Tools  DRG CD-Test (in German language)     Allgemeine Diskussion / General Discussion     Anforderungskatalog / CD Specification     Leitfaden für Patienten-CDs / Guidelines for Handling Patient CDs     CD-Prüfung / CD Validation     
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired username to the OFFIS DICOM team
Last visit was: Thu, 2012-09-13, 09:16 It is currently Thu, 2012-09-13, 12:48

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  123
Author Message
 Post subject:
PostPosted: Mon, 2011-08-15, 09:14 
Offline
OFFIS DICOM Team
OFFIS DICOM Team

Joined: Fri, 2004-11-05, 14:47
Posts: 1153
Location: Oldenburg, Germany
Hi, 

The server sends a status that the client (your SCU) does not understand. What kind of PACS server are you using? I do not know (and therefore DcmSCU) the error code and the default behaviour of DcmSCU is then to not expect any MOVE responses. You might change this behaviour by overwriting the function DcmSCU::handleMOVEResponse() with your own class derived from DcmSCU. 

Best regards, 
Michael


Report this post
Top
 Profile  
Reply with quote  


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics