com.pixelmed.network

## Class GetSOPClassSCU

- java.lang.Object
- - com.pixelmed.dicom.SOPClass
  - - com.pixelmed.network.GetSOPClassSCU

    public class GetSOPClassSCU
    extends SOPClass

This class implements the SCU role of C-GET SOP Classes.

The class has no methods other than the constructor (and a main method for testing). The constructor establishes an association, sends the C-GET request, and releases the association. Any identifiers received are handled by the supplied `IdentifierHandler`. Any objects received are handled by the supplied `ReceivedObjectHandler`.

Note the need to supply a list of supported Storage SOP Classes to be negotiated during association establishment - if the list is known a priori it should be supplied, otherwise a list of all known SOP Classes can be supplied; however, since the latter is rather large it can easily exceed the maximum number of presentation contexts allowed by the standard (128), hence considerable control is provided over the number of transfer syntaxes proposed, should it be necessary; when in doubt allow the SCP to choose from a list of multiple transfer syntaxes for each abstract syntax which consumes only a single presentation context.

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

The main method is also useful in its own right as a command-line utility, which will store requested files in a specified directory.

For example, to have GETSCU command GETSCP to get a single image instance of unknown SOP Class to GETSCU using the transfer syntax of the SCP's choice:

    try {
        AttributeList identifier = new AttributeList();
        { AttributeTag t = TagFromName.QueryRetrieveLevel; Attribute a = new CodeStringAttribute(t); a.addValue("IMAGE"); identifier.put(t,a); }
        { AttributeTag t = TagFromName.StudyInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); a.addValue("1.3.6.1.4.1.5962.1.2.0.1064923879.2077.3232235877"); identifier.put(t,a); }
        { AttributeTag t = TagFromName.SeriesInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); a.addValue("1.3.6.1.4.1.5962.1.3.0.0.1064923879.2077.3232235877"); identifier.put(t,a); }
        { AttributeTag t = TagFromName.SOPInstanceUID; Attribute a = new UniqueIdentifierAttribute(t); a.addValue("1.3.6.1.4.1.5962.1.1.0.0.0.1064923879.2077.3232235877"); identifier.put(t,a); }
        new GetSOPClassSCU("theirhost","104","GETSCP","GETSCU",SOPClass.StudyRootQueryRetrieveInformationModelGet,identifier,new IdentifierHandler(),"/tmp",new OurReceivedObjectHandler(),SOPClass.getSetOfStorageSOPClasses(),true,false,false,1);
    }
    catch (Exception e) {
        e.printStackTrace(System.err);
    }

See Also:
  `IdentifierHandler`, `ReceivedObjectHandler`, `PresentationContextListFactory`

### Field Summary

### Fields inherited from class com.pixelmed.dicom.SOPClass

`AmbulatoryECGStorage, arrayOfQuerySOPClasses, arrayOfRetrieveWithGetSOPClasses, arrayOfRetrieveWithMoveSOPClasses, arrayOfStorageSOPClasses, ArterialPulseWaveformStorage, AudioSRStorageTrialRetired, AutorefractionMeasurementsStorage, BasicStructuredDisplayStorage, BasicTextSRStorage, BasicVoiceStorage, BlendingSoftcopyPresentationStateStorage, BreastTomosynthesisImageStorage, CardiacElectrophysiologyWaveformStorage, ChestCADSRStorage, ColonCADSRStorage, ColorPaletteInformationModelFind, ColorPaletteInformationModelGet, ColorPaletteInformationModelMove, ColorPaletteStorage, ColorSoftcopyPresentationStateStorage, Comprehensive3DSRStorage, ComprehensiveSRStorage, ComprehensiveSRStorageTrialRetired, ComputedRadiographyImageStorage, CornealTopographyMapStorage, CTImageStorage, DeformableSpatialRegistrationStorage, DetailSRStorageTrialRetired, DICONDEEddyCurrentImageStorage, DICONDEEddyCurrentMultiframeImageStorage, 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, LegacyConvertedEnhancedCTImageStorage, LegacyConvertedEnhancedMRImageStorage, LegacyConvertedEnhancedPETImageStorage, 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, TextSRStorageTrialRetired, 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

Constructors
Constructor and Description

`GetSOPClassSCU(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, java.lang.String affectedSOPClass, AttributeList identifier, IdentifierHandler identifierHandler, java.io.File savedImagesFolder, StoredFilePathStrategy storedFilePathStrategy, ReceivedObjectHandler receivedObjectHandler, java.util.Set setOfStorageSOPClasses, boolean theirChoice, boolean ourChoice, boolean asEncoded, int debugLevel)`

### Method Summary

Methods
`static void` `main(java.lang.String[] arg)` For testing, establish an association to the specified AE and perform a retrieve using a C-GET request.

### Methods inherited from class com.pixelmed.dicom.SOPClass

`getPlausibleStandardSOPClassUIDsForModality, getSetOfStorageSOPClasses, isCompositeInstanceQuery, isCompositeInstanceRetrieve, isCompositeInstanceRetrieveWithGet, isCompositeInstanceRetrieveWithMove, isDICONDEImageStorage, 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, isTrialRetiredStructuredReport, isVerification, isWaveform`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GetSOPClassSCU

    public GetSOPClassSCU(java.lang.String hostname,
                  int port,
                  java.lang.String calledAETitle,
                  java.lang.String callingAETitle,
                  java.lang.String affectedSOPClass,
                  AttributeList identifier,
                  IdentifierHandler identifierHandler,
                  java.io.File savedImagesFolder,
                  StoredFilePathStrategy storedFilePathStrategy,
                  ReceivedObjectHandler receivedObjectHandler,
                  java.util.Set setOfStorageSOPClasses,
                  boolean theirChoice,
                  boolean ourChoice,
                  boolean asEncoded,
                  int debugLevel)
                   throws DicomNetworkException,
                          DicomException,
                          java.io.IOException

Parameters:
  `hostname` - their hostname or IP address
  `port` - their port
  `calledAETitle` - their AE Title
  `callingAETitle` - our AE Title
  `affectedSOPClass` - the SOP Class defining which query model, e.g. `SOPClass.StudyRootQueryRetrieveInformationModelGet`
  `identifier` - the list of unique keys and move level
  `identifierHandler` - the handler to use for each returned identifier
  `savedImagesFolder` - the folder in which to store received data sets (may be null, to ignore received data for testing)
  `storedFilePathStrategy` - the strategy to use for naming received files and folders
  `receivedObjectHandler` - the handler to call after each data set has been received and stored
  `setOfStorageSOPClasses` - the `Set` of Storage SOP Class UIDs (as `String`) that are acceptable
  `theirChoice` - propose a single presentation context with all transfer syntaxes to allow them to choose
  `ourChoice` - propose separate presentation contexts for each transfer syntax to allow us to choose
  `asEncoded` - propose a separate presentation context for the specified transfer syntax in which the data set is known to be encoded
  `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 perform a retrieve using a C-GET request.

Parameters:
  `arg` - array of seven, eight or nine strings - their hostname, their port, their AE Title, our AE Title, the directory in which to store the incoming files, the retrieve level (STUDY, SERIES or IMAGE), then the Study Instance UID, optionally the Series Instance UID (if SERIES) and optionally the SOP Instance UID (if IMAGE)