C#
VB
C++
Sends a C-STORE-REQ message to a peer member of a connection defined by SCP.
public void Store(DicomScp Scp,DicomDataSet dataset)
Public Overloads Sub Store( _ByVal Scp As Leadtools.Dicom.Scu.DicomScp, _ByVal dataset As Leadtools.Dicom.DicomDataSet _)
public:void Store(Leadtools.Dicom.Scu.DicomScp^ Scp,Leadtools.Dicom.DicomDataSet^ dataset)
Scp
The peer connection to send the C-STORE-REQ to.
dataset
The dataset to send.
Exceptions
| Exception | Description |
|---|---|
| System.ArgumentNullException | Thrown when SCP is null. |
Stores a dataset a remote DICOM server.
using Leadtools;using Leadtools.Dicom.Scu;using Leadtools.Dicom.Scu.Common;using Leadtools.Dicom;using Leadtools.Dicom.Common.DataTypes;public void StoreDataset(){DicomEngine.Startup();DicomNet.Startup();StoreScu storeDataset = new StoreScu();DicomScp scp = new DicomScp();DicomDataSet ds = new DicomDataSet();//// Change these parameters to reflect the calling AETitle.//storeDataset.AETitle = "LEAD_CLIENT";storeDataset.HostPort = 1000;storeDataset.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);//// Change these parameters to reflect the called AETitle (server).//scp.AETitle = "MI_SERVER";scp.Port = 104;scp.Timeout = 60;scp.PeerAddress = IPAddress.Parse("10.1.1.96");string fileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.dcm");ds.Load(fileName, DicomDataSetLoadFlags.None);storeDataset.ReceiveBuffer += new ReceiveBufferDelegate(storeDataset_ReceiveBuffer);storeDataset.BeforeCStore += new BeforeCStoreDelegate(storeDataset_BeforeCStore);storeDataset.AfterCStore += new AfterCStoreDelegate(storeDataset_AfterCStore);storeDataset.Compression = Compression.Lossless;storeDataset.Store(scp, ds);DicomNet.Shutdown();DicomEngine.Shutdown();}void storeDataset_ReceiveBuffer(object sender, ReceiveBufferEventArgs e){Console.WriteLine("{0} bytes of data received", e.BufferSize);}void storeDataset_BeforeCStore(object sender, BeforeCStoreEventArgs e){//// Stop storing if we received an error//if (e.Error != null)e.Skip = SkipMethod.AllFiles;}void storeDataset_AfterCStore(object sender, AfterCStoreEventArgs e){string msg;msg = string.Format("Dataset store complete. Status: {0}", e.Status);Console.WriteLine(msg);}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.Dicom.ScuImports Leadtools.Dicom.Scu.CommonImports Leadtools.DicomImports Leadtools.Dicom.Common.DataTypesPublic Sub StoreDataset()DicomEngine.Startup()DicomNet.Startup()Dim cstoreDataset As StoreScu = New StoreScu()Dim scp As DicomScp = New DicomScp()Dim ds As DicomDataSet = New DicomDataSet()'' Change these parameters to reflect the calling AETitle.'cstoreDataset.AETitle = "LEAD_CLIENT"cstoreDataset.HostPort = 1000cstoreDataset.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(Function(ip) ip.AddressFamily = AddressFamily.InterNetwork)'' Change these parameters to reflect the called AETitle (server).'scp.AETitle = "MI_SERVER"scp.Port = 104scp.Timeout = 60scp.PeerAddress = IPAddress.Parse("10.1.1.96")ds.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.dcm"), DicomDataSetLoadFlags.None)AddHandler cstoreDataset.ReceiveBuffer, AddressOf cstoreDataset_ReceiveBufferAddHandler cstoreDataset.BeforeCStore, AddressOf cstoreDataset_BeforeCStoreAddHandler cstoreDataset.AfterCStore, AddressOf cstoreDataset_AfterCStorecstoreDataset.Compression = Compression.LosslesscstoreDataset.Store(scp, ds)DicomNet.Shutdown()DicomEngine.Shutdown()End SubPrivate Sub cstoreDataset_ReceiveBuffer(ByVal sender As Object, ByVal e As ReceiveBufferEventArgs)Console.WriteLine("{0} bytes of data received", e.BufferSize)End SubPrivate Sub cstoreDataset_BeforeCStore(ByVal sender As Object, ByVal e As BeforeCStoreEventArgs)'' Stop storing if we received an error'If Not e.Error Is Nothing Thene.Skip = SkipMethod.AllFilesEnd IfEnd SubPrivate Sub cstoreDataset_AfterCStore(ByVal sender As Object, ByVal e As AfterCStoreEventArgs)Dim msg As Stringmsg = String.Format("Dataset store complete. Status: {0}", e.Status)Console.WriteLine(msg)End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
