Creating a PAC

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Forward
Posts: 17
Joined: Mon, 2011-05-02, 11:54

Creating a PAC

#1 Post by Forward »

Hi,
Is there anyway i can use DcmSCP to simulate a PACServer?

Here's an example what i'm trying to do

Code: Select all

DcmSCP m_scp;
 
   transfer_syntax.push_back(UID_LittleEndianImplicitTransferSyntax);
   transfer_syntax.push_back(UID_JPEG2000LosslessOnlyTransferSyntax);
   transfer_syntax.push_back(UID_DeflatedExplicitVRLittleEndianTransferSyntax);
   transfer_syntax.push_back(UID_JPEG2000TransferSyntax);
   transfer_syntax.push_back(UID_JPEG2000LosslessOnlyTransferSyntax);
   
   m_scp.setPort(5678);
   m_scp.setAETitle("PACSERVER");
   m_scp.addPresentationContext(UID_FINDPatientRootQueryRetrieveInformationModel, transfer_syntax);
   m_scp.addPresentationContext(UID_MOVEPatientRootQueryRetrieveInformationModel, transfer_syntax);
   m_scp.addPresentationContext(UID_CTImageStorage, transfer_syntax);
The problem i have is that on the client side (SCU) when i try to send image it gaves me the 'Bad Presentation Context ID' error again.
I'm using the same Transfer Syntax in both

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

DcmSCP is suited for receiving images like a PACS does (however, per default it does not store the images, you must overwrite something like handleIncomingCStoreMessage()).

It is difficult to say where the problem is. Can you provide a log from server or client? Here is shown how you can enable debug logging in your DCMTK-based code.

Michael

Forward
Posts: 17
Joined: Mon, 2011-05-02, 11:54

#3 Post by Forward »

Hmmm i used the log but seems the SCP is trying again to convert file from JPEG2000 to Little ENdian

Code: Select all

sendMessage: unable to convert DICOM file 'c:\ll.dcm' from 'JPEG 2000 (Lossless or Lossy)' transfer syntax to 'Little Endian Implicit'

Can't understand why if i told that the transfer syntax could be any of them

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#4 Post by Michael Onken »

Hi,

for every presentation context you add the list of 5 transfer syntaxes. Please note that for a association request from the SCU, the server must choose one of those and it chooses to accept the first one that matches in the proposed transfer syntax list, which is Little Endian Implicit. (this is what I guess from what I know).

"sendMessage" sounds like this is the SCU log, right? So the SCU chooses to send on the Little Endian Implicit presentation context (which is probably the one accepted by the SCP, see above), but is not able to decompress it accordingly from JPEG2000 (which is a commercial add-on for DCMTK).

So you should force the SCU only(!) proposing JPEG2000 of your CT Image Storage presentation contexts (at the moment, your only one). Then the server would have no chance but to accept that transfer syntax and thus the client would not need to do the de-compression.

Michael

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#5 Post by Michael Onken »

P.S: Please note that there is no code that performs actual work when you try to do query/retrieve with the server, i.e. that has to be programmed yourself. Or have a look at the dcmqrscp tool that implements a little PACS (though it is based on the old C API and does not make use of DcmSCP).

Michael

Forward
Posts: 17
Joined: Mon, 2011-05-02, 11:54

#6 Post by Forward »

Hmm I changed both, SCP and SCU, to only inkove(receive) JPEG2000

SCP

Code: Select all

transfer_syntax.push_back(UID_JPEG2000TransferSyntax);
   
   m_scp.setPort(5678);
   m_scp.setAETitle("PACSERVER");
   m_scp.addPresentationContext(UID_FINDPatientRootQueryRetrieveInformationModel, transfer_syntax);
   m_scp.addPresentationContext(UID_MOVEPatientRootQueryRetrieveInformationModel, transfer_syntax);
   m_scp.addPresentationContext(UID_CTImageStorage, transfer_syntax);
SCU

Code: Select all

 const char  *transfer_syntax[1] = {UID_JPEG2000TransferSyntax };

retcode = ASC_addPresentationContext(m_params, OFstatic_cast(Uint8, i*2+1), m_presentation[i], transfer_syntax, 1);

But it stills showing the same message error, cannot convert from JPEG2000 to Little Endian.

Even forcing the presetation contexto to image

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#7 Post by Michael Onken »

Hi,

that sounds very weird. Are you sure that you do not use a send routine that tries implicitly (or even explicitly) to send in little endian implicit? Do you use the right JPEG2000 transfer syntax?

Michael

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 1 guest