The StoreJob example demonstrates how to use the DCF to construct and use the high level store SCU class LaurelBridge.DCF.Dicom.Store.StoreJob.
Classes
Class | Description | |
---|---|---|
Options |
Command line options class for parsing user options for StoreJob.
| |
Program |
Basic store service class user example which should be run with StoreSCP.
|
Examples
StoreJob Sample Code
public class Program { private static Options _options; /// <summary> /// Main entry point for StoreJob. /// </summary> /// <param name="args">Program arguments.</param> [STAThread] public static void Main(string[] args) { try { Options options; if (!Options.TryParse(args, out options)) return; new Program(options); } catch (Exception e) { Console.WriteLine("Error during execution: {0}", e); Environment.ExitCode = 1; } finally { if (System.Diagnostics.Debugger.IsAttached) { Console.Write("Press any key to continue . . . "); Console.ReadKey(); } } } /// <summary> /// The class submits a store job. /// </summary> /// <param name="options">Parsed command line options class.</param> public Program(Options options) { _options = options; Dicom.Store.StoreJob job = new Dicom.Store.StoreJob(); job.Destination = new DicomAddress(_options.RemoteHost, _options.RemotePort, _options.CalledAETitle); job.Source = new DicomAddress("0.0.0.0", 0, _options.CallingAETitle); job.Add(new DicomInstanceInfo(_options.InputPath)); StoreJobStatus status = job.Execute(); Console.WriteLine(status); } }