com.pixelmed.network
Class TestSendingCommandAndDataInOnePDU

java.lang.Object
  extended by com.pixelmed.dicom.SOPClass
      extended by com.pixelmed.network.StorageSOPClassSCU
          extended by com.pixelmed.network.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);
}
 


Nested Class Summary
 
Nested classes/interfaces inherited from class com.pixelmed.network.StorageSOPClassSCU
StorageSOPClassSCU.CStoreResponseHandler
 
Field Summary
 
Fields inherited from class com.pixelmed.network.StorageSOPClassSCU
debugLevel, trappedExceptions
 
Fields inherited from class com.pixelmed.dicom.SOPClass
AmbulatoryECGStorage, arrayOfQuerySOPClasses, arrayOfRetrieveWithGetSOPClasses, arrayOfRetrieveWithMoveSOPClasses, arrayOfStorageSOPClasses, ArterialPulseWaveformStorage, AutorefractionMeasurementsStorage, BasicStructuredDisplayStorage, BasicTextSRStorage, BasicVoiceStorage, BlendingSoftcopyPresentationStateStorage, BreastTomosynthesisImageStorage, CardiacElectrophysiologyWaveformStorage, ChestCADSRStorage, ColonCADSRStorage, ColorPaletteInformationModelFind, ColorPaletteInformationModelGet, ColorPaletteInformationModelMove, ColorPaletteStorage, ColorSoftcopyPresentationStateStorage, Comprehensive3DSRStorage, ComprehensiveSRStorage, ComputedRadiographyImageStorage, CTImageStorage, DeformableSpatialRegistrationStorage, DICOS2DAITStorage, DICOS3DAITStorage, DICOSCTImageStorage, DICOSDigitalXRayImageStorageForPresentation, DICOSDigitalXRayImageStorageForProcessing, DICOSQuadrupoleResonanceStorage, DICOSThreatDetectionReportStorage, DigitalIntraoralXRayImageStorageForPresentation, DigitalIntraoralXRayImageStorageForProcessing, DigitalMammographyXRayImageStorageForPresentation, DigitalMammographyXRayImageStorageForProcessing, DigitalXRayImageStorageForPresentation, DigitalXRayImageStorageForProcessing, EncapsulatedCDAStorage, EncapsulatedPDFStorage, EnhancedCTImageStorage, EnhancedMRColorImageStorage, EnhancedMRImageStorage, EnhancedPETImageStorage, EnhancedSRStorage, EnhancedUSVolumeStorage, EnhancedXAImageStorage, EnhancedXRFImageStorage, GeneralAudioWaveformStorage, GeneralECGStorage, GenericImplantTemplateStorage, GrayscaleSoftcopyPresentationStateStorage, HemodynamicWaveformStorage, ImplantAssemblyTemplateStorage, ImplantationPlanSRStorage, ImplantTemplateGroupStorage, IntraocularLensCalculationsStorage, IVOCTImageStorageForPresentation, IVOCTImageStorageForProcessing, KeratometryMeasurementsStorage, KeyObjectSelectionDocumentStorage, LensometryMeasurementsStorage, MacularGridThicknessAndVolumeReportStorage, MammographyCADSRStorage, MediaStorageDirectoryStorage, MRImageStorage, MRSpectroscopyStorage, MultiframeGrayscaleByteSecondaryCaptureImageStorage, MultiframeGrayscaleWordSecondaryCaptureImageStorage, MultiframeSingleBitSecondaryCaptureImageStorage, MultiframeTrueColorSecondaryCaptureImageStorage, NuclearMedicineImageStorage, NuclearMedicineImageStorageRetired, OphthalmicAxialMeasurementsStorage, OphthalmicPhotography16BitImageStorage, OphthalmicPhotography8BitImageStorage, OphthalmicThicknessMapStorage, OphthalmicTomographyImageStorage, OphthalmicVisualFieldStaticPerimetryMeasurementsStorage, PatientRootQueryRetrieveInformationModelFind, PatientRootQueryRetrieveInformationModelGet, PatientRootQueryRetrieveInformationModelMove, PatientStudyOnlyQueryRetrieveInformationModelFind, PatientStudyOnlyQueryRetrieveInformationModelGet, PatientStudyOnlyQueryRetrieveInformationModelMove, PETImageStorage, PrivateFujiCRImageStorage, PrivateGE3DModelStorage, PrivateGECollageStorage, PrivateGEeNTEGRAProtocolOrNMGenieStorage, PrivateGEPETRawDataStorage, PrivatePhilips3DObject2Storage, PrivatePhilips3DObjectStorage, PrivatePhilips3DPresentationStateStorage, PrivatePhilipsCompositeObjectStorage, PrivatePhilipsCTSyntheticImageStorage, PrivatePhilipsCXImageStorage, PrivatePhilipsCXSyntheticImageStorage, PrivatePhilipsLiveRunStorage, PrivatePhilipsMRCardio2Storage, PrivatePhilipsMRCardioAnalysis2Storage, PrivatePhilipsMRCardioAnalysisStorage, PrivatePhilipsMRCardioProfileStorage, PrivatePhilipsMRCardioStorage, PrivatePhilipsMRColorImageStorage, PrivatePhilipsMRExamcardStorage, PrivatePhilipsMRSeriesDataStorage, PrivatePhilipsMRSpectrumStorage, PrivatePhilipsMRSyntheticImageStorage, PrivatePhilipsPerfusionImageStorage, PrivatePhilipsPerfusionStorage, PrivatePhilipsPrivateXRayMFStorage, PrivatePhilipsReconstructionStorage, PrivatePhilipsRunStorage, PrivatePhilipsSpecialisedXAStorage, PrivatePhilipsSurface2Storage, PrivatePhilipsSurfaceStorage, PrivatePhilipsVolume2Storage, PrivatePhilipsVolumeSetStorage, PrivatePhilipsVolumeStorage, PrivatePhilipsVRMLStorage, PrivatePixelMedLegacyConvertedEnhancedCTImageStorage, PrivatePixelMedLegacyConvertedEnhancedMRImageStorage, PrivatePixelMedLegacyConvertedEnhancedPETImageStorage, PrivatePixelMedLegacyFloatingPointImageStorage, PrivatePMODMultiframeImageStorage, PrivateSiemensCSANonImageStorage, ProcedureLogStorage, PseudoColorSoftcopyPresentationStateStorage, RawDataStorage, RealWorldValueMappingStorage, RespiratoryWaveformStorage, RTBeamsDeliveryInstructionStorage, RTBeamsDeliveryInstructionStorageTrial, RTBeamsTreatmentRecordStorage, RTBrachyTreatmentRecordStorage, RTDoseStorage, RTImageStorage, RTIonBeamsTreatmentRecordStorage, RTIonPlanStorage, RTPlanStorage, RTStructureSetStorage, RTTreatmentSummaryRecordStorage, SecondaryCaptureImageStorage, SegmentationStorage, SpatialFiducialsStorage, SpatialRegistrationStorage, SpectaclePrescriptionReportStorage, StandaloneCurveStorage, StandaloneModalityLUTStorage, StandaloneOverlayStorage, StandalonePETCurveStorage, StandaloneVOILUTStorage, StereometricRelationshipStorage, StudyRootQueryRetrieveInformationModelFind, StudyRootQueryRetrieveInformationModelGet, StudyRootQueryRetrieveInformationModelMove, SubjectiveRefractionMeasurementsStorage, SurfaceScanMeshStorage, SurfaceScanPointCloudStorage, SurfaceSegmentationStorage, TwelveLeadECGStorage, UltrasoundImageStorage, UltrasoundImageStorageRetired, UltrasoundMultiframeImageStorage, UltrasoundMultiframeImageStorageRetired, Verification, VideoEndoscopicImageStorage, VideoMicroscopicImageStorage, VideoPhotographicImageStorage, VisibleLightDraftImageStorage, VisibleLightEndoscopicImageStorage, VisibleLightMicroscopicImageStorage, VisibleLightMultiFrameDraftImageStorage, VisibleLightPhotographicImageStorage, VisibleLightSlideCoordinatesMicroscopicImageStorage, VisualAcuityMeasurementsStorage, VLWholeSlideMicroscopyImageStorage, XAXRFGrayscaleSoftcopyPresentationStateStorage, XRay3DAngiographicImageStorage, XRay3DCraniofacialImageStorage, XRayAngiographicBiplaneImageStorage, XRayAngiographicImageStorage, XRayRadiationDoseSRStorage, XRayRadioFlouroscopicImageStorage
 
Constructor Summary
protected TestSendingCommandAndDataInOnePDU()
          Dummy constructor allows testing subclasses to use different constructor.
  TestSendingCommandAndDataInOnePDU(String hostname, int port, String calledAETitle, String callingAETitle, String fileName, String affectedSOPClass, String affectedSOPInstance, int compressionLevel, int debugLevel)
          Establish an association to the specified AE, send the instance contained in the file, and release the association.
 
Method Summary
static void main(String[] arg)
          For testing, establish an association to the specified AE and send a DICOM instance (send a C-STORE request).
protected  boolean sendOneSOPInstance(Association association, String affectedSOPClass, String affectedSOPInstance, String inputTransferSyntaxUID, DicomInputStream din, byte presentationContextID, String outputTransferSyntaxUID)
           
 
Methods inherited from class com.pixelmed.network.StorageSOPClassSCU
encounteredTrappedExceptions, sendMultipleSOPInstances, sendMultipleSOPInstances, sendOneSOPInstance, sendOneSOPInstance
 
Methods inherited from class com.pixelmed.dicom.SOPClass
getPlausibleStandardSOPClassUIDsForModality, getSetOfStorageSOPClasses, isCompositeInstanceQuery, isCompositeInstanceRetrieve, isCompositeInstanceRetrieveWithGet, isCompositeInstanceRetrieveWithMove, isDICOSImageStorage, isDICOSNonImageStorage, isDirectory, isEncapsulatedDocument, isEnhancedMultiframeImageStorage, isEnhancedMultiframeImageWithPlanePositionOrientationAndMeasuresStorage, isImageStorage, isKeyObjectSelectionDocument, isMiscellaneousCompositeNonImageStorage, isMiscellaneousNonCompositeStorage, isMultiframeSecondaryCaptureImageStorage, isNonImageStorage, isOphthalmicMeasurementStorage, isPatientRootCompositeInstanceQuery, isPatientRootCompositeInstanceRetrieve, isPatientRootCompositeInstanceRetrieveWithGet, isPatientRootCompositeInstanceRetrieveWithMove, isPatientStudyOnlyCompositeInstanceQuery, isPatientStudyOnlyCompositeInstanceRetrieve, isPatientStudyOnlyCompositeInstanceRetrieveWithGet, isPatientStudyOnlyCompositeInstanceRetrieveWithMove, isPresentationState, isPrivateImageStorage, isPrivateNonImageStorage, isRadiotherapy, isRawData, isSecondaryCaptureImageStorage, isSpectroscopy, isStandalone, isStandardImageStorage, isStorage, isStructuredReport, isStudyRootCompositeInstanceQuery, isStudyRootCompositeInstanceRetrieve, isStudyRootCompositeInstanceRetrieveWithGet, isStudyRootCompositeInstanceRetrieveWithMove, isVerification, isWaveform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestSendingCommandAndDataInOnePDU

protected TestSendingCommandAndDataInOnePDU()
                                     throws DicomNetworkException,
                                            DicomException,
                                            IOException

Dummy constructor allows testing subclasses to use different constructor.

Throws:
DicomNetworkException
DicomException
IOException

TestSendingCommandAndDataInOnePDU

public TestSendingCommandAndDataInOnePDU(String hostname,
                                         int port,
                                         String calledAETitle,
                                         String callingAETitle,
                                         String fileName,
                                         String affectedSOPClass,
                                         String affectedSOPInstance,
                                         int compressionLevel,
                                         int debugLevel)
                                  throws DicomNetworkException,
                                         DicomException,
                                         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:
IOException
DicomException
DicomNetworkException
Method Detail

sendOneSOPInstance

protected boolean sendOneSOPInstance(Association association,
                                     String affectedSOPClass,
                                     String affectedSOPInstance,
                                     String inputTransferSyntaxUID,
                                     DicomInputStream din,
                                     byte presentationContextID,
                                     String outputTransferSyntaxUID)
                              throws AReleaseException,
                                     DicomNetworkException,
                                     DicomException,
                                     IOException
Overrides:
sendOneSOPInstance in class StorageSOPClassSCU
Parameters:
association -
affectedSOPClass -
affectedSOPInstance -
inputTransferSyntaxUID -
din -
presentationContextID -
outputTransferSyntaxUID -
Throws:
IOException
DicomException
DicomNetworkException
AReleaseException

main

public static void main(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