Available in LEADTOOLS Medical Imaging toolkits. |
The DICOM standard defines the Print Management Service Class to facilitate the printing of images and image related data. The functionality offered by the LDicomPrintSCU class simplifies the process of building a Print Management Service Class User (Print SCU). The LDicomPrintSCU class is derived from LDicomNet and provides functions to handle all the SOP and Meta SOP Classes defined by the Print Management Service Class.
The functionality of the LDicomPrintSCU class can be divided into the following categories:
Association
The Association with the Print Management Service Class Provider (Print SCP) can be simply established by calling the function LDicomPrintSCU::Associate. The SOP/Meta SOP Classes supported by the Print SCU itself are specified when calling this function. The following functions are also related to Association handling:
LDicomPrintSCU::GetAssociateRejectInfo
LDicomPrintSCU::IsClassSupported
Basic Print Management
Having the Association established, the Basic Print Management can be started by requesting the Print SCP to create a Film Session. This is done using the function LDicomPrintSCU::CreateFilmSession. The following functions are related to Film Session handling:
LDicomPrintSCU::GetFilmSessionInstanceUID
LDicomPrintSCU::UpdateFilmSession
LDicomPrintSCU::PrintFilmSession
LDicomPrintSCU::DeleteFilmSession
LDicomPrintSCU::GetDefaultFilmSessionParameters
Once the Film Session is created, the Print SCP can be requested to create one or more Film Boxes. A Film Box can be created using the function LDicomPrintSCU::CreateFilmBox. The following functions are related to Film Box handling:
LDicomPrintSCU::GetFilmBoxInstanceUID
LDicomPrintSCU::GetDefaultFilmBoxParameters
When the Print SCP is requested to create a Film Box, it will also create one or more Image Boxes. The function LDicomPrintSCU::GetImageBoxesCount returns the count of these Image Boxes, which can be handled using the following functions:
LDicomPrintSCU::GetImageBoxInstanceUID
LDicomPrintSCU::UpdateImageBox
LDicomPrintSCU::GetDefaultImageBoxParameters
LDicomPrintSCU::FreeImageBoxesInstanceUIDs
Similarly, when the Print SCP is requested to create a Film Box, it might also create one or more Annotation Boxes. The function LDicomPrintSCU::GetAnnotationBoxesCount returns the count of these Annotation Boxes, which can be handled using the following functions:
LDicomPrintSCU::GetAnnotationBoxInstanceUID
LDicomPrintSCU::UpdateAnnotationBox
LDicomPrintSCU::FreeAnnotationBoxesInstanceUIDs
If the Presentation LUT SOP Class is supported on the Association, the Print SCP can be requested to create a Presentation LUT. Once a Presentation LUT is created, it can be referenced by the Film Boxes and Grayscale Image Boxes. The following functions handle Presentation LUTs:
LDicomPrintSCU::CreatePresentationLUT
LDicomPrintSCU::GetPresentationLUTInstanceUID
LDicomPrintSCU::DeletePresentationLUT
If the Basic Print Image Overlay Box SOP Class is supported on the Association, the Print SCP can be requested to create an Image Overlay Box, which can then be referenced by the Image Boxes. The following functions handle Image Overlay Boxes:
LDicomPrintSCU::CreateOverlayBox
LDicomPrintSCU::GetOverlayBoxInstanceUID
LDicomPrintSCU::UpdateOverlayBox
LDicomPrintSCU::DeleteOverlayBox
LDicomPrintSCU::GetDefaultOverlayBoxParameters
Pull Stored Print Management
Having the Association established, the Pull Stored Print Management can be started by using the function LDicomPrintSCU::CreatePullPrintRequest to request the Print SCP to create a Pull Print Request SOP Instance. The following functions handle Pull Stored Print Management sessions:
LDicomPrintSCU::GetPullPrintRequestInstanceUID
LDicomPrintSCU::PrintPullPrintRequestSession
LDicomPrintSCU::DeletePullPrintRequest
LDicomPrintSCU::GetDefaultPullPrintRequestParameters
Printer
The function LDicomPrintSCU::GetPrinterInfo can be used to query the Print SCP for information about the printer. Information that can be retrieved includes Printer Name, Printer Manufacturer, Printer Status, etc. The callback function LDicomPrintSCU::OnPrinterReport will be called whenever a printer status report is received from the Print SCP.
The function LDicomPrintSCU::GetPrinterConfiguration can be used to query the Print SCP for the printer configuration information. The retrieved information is stored in the data member LDicomPrintSCU::m_PrinterConfiguration, which is an LDicomDS object.
Print Jobs
When a printing request is sent to the Print SCP, and if the Print Job SOP Class is supported on the Association, the Print SCP will create a Print Job SOP Instance for the new Print Job. The SOP Instance UID of that Instance is returned by the function LDicomPrintSCU::GetPrintJobInstanceUID. This SOP Instance UID can then be passed to the function LDicomPrintSCU::GetPrintJobInfo to query the Print SCP for information about the Print Job. The callback function LDicomPrintSCU::OnPrintJobReport will be called whenever a Print Job status report is received from the Print SCP.
In addition to the functions mentioned above:
The callback function LDicomPrintSCU::OnStatus can be used to monitor the status of the Print SCU itself.
The function LDicomPrintSCU::GetLastOperationStatus returns the status code specified in the response of the Print SCP.
The function LDicomPrintSCU::SetTimeout sets the timeout value for communicating with the Print SCP.
The following sample function illustrates the simplicity of using the LDicomPrintSCU class to print a single DICOM image:
L_VOID PrintImage(L_CHAR* pszImageFilename)
{
LDicomPrintSCU PrintSCU;
// Startup the network
LDicomNet::StartUp();
// Establish the Association
PrintSCU.Associate ("10.0.2.20", 7104, "PrintSCP", "PrintSCU",
PRINTSCU_BASIC_GRAYSCALE_PM_META_SOP_CLASS);
// Create the Film Session
PrintSCU.CreateFilmSession (NULL);
// Create the Film Box
FILMBOXPARAMETERS FBParams;
PrintSCU.GetDefaultFilmBoxParameters (&FBParams, sizeof(FILMBOXPARAMETERS));
PrintSCU.CreateFilmBox (&FBParams);
// Update the Image Box
IMAGEBOXPARAMETERS IBParams;
PrintSCU.GetDefaultImageBoxParameters (&IBParams, sizeof(IMAGEBOXPARAMETERS));
LDicomDS Image;
Image.LoadDS(pszImageFilename, DS_LOAD_CLOSE);
PrintSCU.UpdateImageBox (PrintSCU.GetImageBoxInstanceUID(0), &Image,
&IBParams);
// Print the Film Box
PrintSCU.PrintFilmBox ();
// Delete the Film Session
PrintSCU.DeleteFilmSession ();
// Release the Association
PrintSCU.Release ();
}