The StoreSCU example demonstrates how to use the DCF to construct and use the low level store SCU class LaurelBridge.DCF.Dicom.Store.StoreSCU.
Classes
Class | Description | |
---|---|---|
Options |
Command line options class for parsing user options for StoreSCU.
| |
Program |
Basic store service class user example which should be run with StoreSCPCallback.
|
Examples
StoreSCU Sample Code
public class Program { /// <summary> /// Main entry point for StoreSCU. /// </summary> /// <param name="args">Command line args.</param> [STAThread] public static void Main(string[] args) { try { Options options; if (!Options.TryParse(args, out options)) return; new Program(options); // and we're done } catch (Exception e) { Console.WriteLine("Exception caught during execution: {0}{1}Please verify the Store Server is up and running.", e, Environment.NewLine); } finally { if (System.Diagnostics.Debugger.IsAttached) { Console.Write("Press any key to continue . . . "); Console.ReadKey(); } } } /// <summary> /// The class submits C-Store requests using the StoreSCU class. /// </summary> /// <param name="options">Parsed command line options class.</param> public Program(Options options) { DicomDataSet dds; string sopClass; string transferSyntax; // Note that this contrived example reads the entire DicomDataSet, including the pixel data, into memory. // In a more real world scenario, the user of the StoreSCU class would either: // a) already know what the SOP class and transfer syntax would be (for example, a modality). // b) discover this information by some other means, such as reading external records which stated the information // (for example, see the DoCMoveOnThread method in the SampleVNAQuerySCP.cs file in the SampleVNA example for // how a Query SCP might persist/discover this information for populating the RequestedPresentationContext objects). using (DicomFileInput dfi = new DicomFileInput(options.InputPath)) { dds = dfi.ReadDataSet(); dds.ExpandStreamingModeData(true); sopClass = dds.GetElementStringValue(Tags.SOPClassUID); transferSyntax = dfi.FileMetaInformation.TransferSyntaxUid; } AssociationInfo ainfo = new AssociationInfo(); ainfo.CalledPresentationAddress = options.RemoteHost + ":" + options.RemotePort; ainfo.CalledTitle = options.CalledAETitle; ainfo.CallingTitle = options.CallingAETitle; ainfo.AddRequestedPresentationContext(new RequestedPresentationContext(0, sopClass, transferSyntax)); Dicom.Store.StoreSCU scu = new Dicom.Store.StoreSCU(ainfo); scu.RequestAssociation(); CStoreResponse response = scu.CStore(dds, 5); Console.WriteLine(response); scu.ReleaseAssociation(); } }