Communication, transfer syntax...

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
guy
Posts: 41
Joined: Tue, 2004-11-09, 16:55

Communication, transfer syntax...

#1 Post by guy »

As you know, I work on Basic Color Print Management using DCMTK.

After writing the stored Print Object with the UID_BasicColorImageBoxSOPClass in the DCM_PrintManagementCapabilitiesSequencen,
I have rewrited the function read of the DVPSStoredPrint class to consider a Basic Color Image Box.
Then I have included the diregist.h to allow DICOM RGB Image.

I work actually on the N-SET BasicImageBox of the Stored Print Object and I have a lot of problems.

I have rewrited the function printSCUsetBasicImageBox of the DVPStored Print class to set the sequence of a basic color image box.

I try now to rewrite the communication code but it's not very easy.
Indeed, I have rewrited the SetRQ of the DVPrintManagementHandler to call my function findAcceptedPC2 based on findAcceptedPC but it can't return me a presentation context.

My code :

T_ASC_PresentationContextID CEncapsulationPrintHandler::findAcceptedPC2(const char *sopclassuid)
{
if ((assoc==NULL)||(sopclassuid==NULL)) return 0;

// if the SOP class is one of the Basic Grayscale Print Management Meta SOP Classes,
// look for a presentation context for Basic Grayscale Print.
OFString sopclass(sopclassuid);
if ((sopclass == UID_BasicFilmSessionSOPClass) ||
(sopclass == UID_BasicFilmBoxSOPClass) ||
(sopclass == UID_BasicGrayscaleImageBoxSOPClass) ||
(sopclass == UID_PrinterSOPClass)) sopclassuid = UID_BasicGrayscalePrintManagementMetaSOPClass;
if (sopclass == UID_BasicColorImageBoxSOPClass) sopclassuid = UID_BasicColorPrintManagementMetaSOPClass;
return ASC_findAcceptedPresentationContextID(assoc, sopclassuid);
}

the function ASC_findAcceptedPresentationContextID returns me an error (in fact non presentation context found I think for my class Basic Color).

If you can help me in how to N-SET the basic color image box on the stored print object, it would be great because it is very very hard to understand this part of the DCMTK.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

Your code will not be able to find a presentation context for Basic Film Session or Basic Film Box because these SOP classes are handled through the Meta SOP Class (read Part 4 about how the Meta SOP classes work). You will need something like

Code: Select all

if (colorMode)
{
   if ((sopclass == UID_BasicFilmSessionSOPClass) ||
      (sopclass == UID_BasicFilmBoxSOPClass) ||
      (sopclass == UID_BasicColorImageBoxSOPClass) ||
      (sopclass == UID_PrinterSOPClass)) sopclassuid =   UID_BasicColorPrintManagementMetaSOPClass;
}
else 
{
   if ((sopclass == UID_BasicFilmSessionSOPClass) ||
      (sopclass == UID_BasicFilmBoxSOPClass) ||
      (sopclass == UID_BasicGrayscaleImageBoxSOPClass) ||
      (sopclass == UID_PrinterSOPClass)) sopclassuid =   UID_BasicGrayscalePrintManagementMetaSOPClass;
}
return ASC_findAcceptedPresentationContextID(assoc, sopclassuid);
You also need to negotiate either the Basic Color or the Basic Grayscale Print Management Meta SOP Class (but never both if you want to save yourselfes from trouble!) during association negotiation, depending on whether you are in "color mode" or "grayscale mode", which depends on the SOP classes you find in the Stored Print object.

guy
Posts: 41
Joined: Tue, 2004-11-09, 16:55

Association negociation

#3 Post by guy »

I made the modifications you told me but due to the fact that DCMTK doesn't implement Basic Color Print Management, I still have an error for the function findAcceptedPC when I transmit the UID of Basic Color Image PrintManagement.

Indeed, the function setRQ calls findAcceptPC which calls ASC_findAcceptedPresentationContextID and when it's the SOP Class UID of Basic Color Print Management which is passed in parameter, it's not found and the function findAcceptedPC returns DIMSE_NOVALIDPRESENTATIONCONTEXTID.

I don't understand very well how the function ASC_findAcceptedPresentationContextID works with the list of SOP Class UID supported and how to implement the Basic Color Print Management.

If you can give me some etaps, it would be fantastic.

guy
Posts: 41
Joined: Tue, 2004-11-09, 16:55

Same as previous

#4 Post by guy »

Below, is my code.
I have rewrited the function printSCUcreateBasicFilmSession and added an argument to pass (OFBool bColor) to negociate Basic Color Print or Basic Grayscale Print.
I have rewrited the function printSCUcreateBasicFilmBox in the same way as printSCUcreateBasicFilmSession .
I have rewrited the function printSCUsetBasicImageBox.

I have also rewrited the function createRQ for create the Basic Film Box and the Basic Film Session adding them an argument (bColor).

My problem occurs when creating a Basic Film Session in Color mode, with the function findAcceptedPC which returns me DIMSE_NOVALIDPRESENTATIONCONTEXTID.

Can you give me some advices or points.


if (EC_Normal != (iResult = iStoredPrint.printSCUgetPrinterInstance(iPrintHandler))) AfxMessageBox ("spooler: printer communication failed, unable to request printer settings.");
else AfxMessageBox ("récupération paramètres printer ok");

if (EC_Normal==iResult)
{
if (EC_Normal != (iResult = iStoredPrint.printSCUpreparePresentationLUT(
iPrintHandler, m_iTargetData.bTargetRequiresMatchingLUT, m_iTargetData.bTargetPreferSCPLUTRendering, m_iTargetData.bTargetSupports12bit))) AfxMessageBox ("spooler: printer communication failed, unable to create presentation LUT.");
else AfxMessageBox ("prépare présentation LUT ok");
}

if (EC_Normal==iResult)
{
if (EC_Normal != (iResult = iInterface.printSCUcreateBasicFilmSession2(iPrintHandler, m_iTargetData.bTargetPLUTinFilmSession, OFTrue))) AfxMessageBox ("spooler: printer communication failed, unable to create basic film session.");
else AfxMessageBox ("création Basic Film Session ok");
}

if (EC_Normal==iResult)
{
if (EC_Normal != (iResult = iStoredPrint.printSCUcreateBasicFilmBox2(iPrintHandler, m_iTargetData.bTargetPLUTinFilmSession, OFTrue))) AfxMessageBox ("spooler: printer communication failed, unable to create basic film box.");
else AfxMessageBox ("Création basic Film Box ok");
}

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#5 Post by Marco Eichelberg »

Make sure you negotiate Basic Color Print Management instead of Basic Grayscale Print Management during association negotiation, which happens in DVPSPrintMessageHandler::negotiateAssociation. Of course the Print SCP also needs to support color print management, and the one provided in module dcmpstat does not. Association negotiation for the Print SCP component (the dcmprscp tool) is implemented in DVPSPrintSCP::negotiateAssociation in dcmpstat/libsrc/dcmpsprt.cc

guy
Posts: 41
Joined: Tue, 2004-11-09, 16:55

Same subject

#6 Post by guy »

Ok ! I have forgotten to rewrite the function NegociateAssociation!
I use the JDICOM PRint Server GUI which seems to support BAsic Color Print Management.

I have rewrite the function NegociateAssociation in my CEncapsulationPrintHandler class and I have an error with the function :

gethostname

--> undeclared identifier

but I have included all files which are in dvpspr.cxx ! any idea of this problem ?

guy
Posts: 41
Joined: Tue, 2004-11-09, 16:55

Viewing my Stored Print Object Color as in Dicomscope

#7 Post by guy »

Yes ! Thanks you Jorg and M. Eichelberg, it's right!
I have managed to print in Color mode ! (in fact I simulate it with JDicom and Print Server GUI) and I watch the hardcopy sent and it's right!

Do you know Application which can read stored print object (color) as dicomscope do it for hardcopy to see the preview result of my print job!

Thanks!

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1437
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#8 Post by Marco Eichelberg »

Congratulations.

Regarding applications supporting Stored Print with color images, our DCMPRINT module does, but if you wanted to use that, there would not have been any need to extend DCMTK's dcmpstat module.
Besides that, I am only aware of a commercial implementation of Stored Print by Merge, but I don't remember the product name.

Post Reply

Who is online

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