Class TestSendingCommandAndDataInOnePDU


  • public class TestSendingCommandAndDataInOnePDU
    extends StorageSOPClassSCU

    This class implements the SCU role of SOP Classes of the Storage Service Class.

    The class has no methods other than the constructor (and a main method for testing). The constructor establishes an association, sends the C-STORE request, and releases the association.

    Debugging messages with a varying degree of verbosity can be activated.

    For example:

    try {
        new TestSendingCommandAndDataInOnePDU("theirhost","104","STORESCP","STORESCU","/tmp/testfile.dcm","1.2.840.10008.5.1.4.1.1.7","1.3.6.1.4.1.5962.1.1.0.0.0.1064923879.2077.3232235877",0,0);
    }
    catch (Exception e) {
        e.printStackTrace(System.err);
    }
     
    • Constructor Detail

      • TestSendingCommandAndDataInOnePDU

        public TestSendingCommandAndDataInOnePDU​(java.lang.String hostname,
                                                 int port,
                                                 java.lang.String calledAETitle,
                                                 java.lang.String callingAETitle,
                                                 java.lang.String fileName,
                                                 java.lang.String affectedSOPClass,
                                                 java.lang.String affectedSOPInstance,
                                                 int compressionLevel,
                                                 int debugLevel)
                                          throws DicomNetworkException,
                                                 DicomException,
                                                 java.io.IOException

        Establish an association to the specified AE, send the instance contained in the file, and release the association.

        Parameters:
        hostname - their hostname or IP address
        port - their port
        calledAETitle - their AE Title
        callingAETitle - our AE Title
        fileName - the name of the file containing the data set to send
        affectedSOPClass - must be the same as the SOP Class UID contained within the data set
        affectedSOPInstance - must be the same as the SOP Instance UID contained within the data set
        compressionLevel - 0=none,1=propose deflate,2=propose deflate and bzip2
        debugLevel - zero for no debugging messages, higher values more verbose messages
        Throws:
        java.io.IOException
        DicomException
        DicomNetworkException
    • Method Detail

      • main

        public static void main​(java.lang.String[] arg)

        For testing, establish an association to the specified AE and send a DICOM instance (send a C-STORE request).

        Parameters:
        arg - array of seven or nine strings - their hostname, their port, their AE Title, our AE Title, the filename containing the instance to send, optionally the SOP Class and the SOP Instance (otherwise will be read from the file), the compression level (0=none,1=propose deflate,2=propose deflate and bzip2) and the debugging level