Leadtools.Dicom.Scu Requires Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Store(DicomScp,DicomDataSet) Method
See Also  Example
Leadtools.Dicom.Scu Namespace > StoreScu Class > Store Method : Store(DicomScp,DicomDataSet) Method




Scp
The peer connection to send the C-STORE-REQ to.
dataset
The dataset to send.
Scp
The peer connection to send the C-STORE-REQ to.
dataset
The dataset to send.
Sends a C-STORE-REQ message to a peer member of a connection defined by SCP.

Syntax

Visual Basic (Declaration) 
Overloads Public Sub Store( _
   ByVal Scp As DicomScp, _
   ByVal dataset As DicomDataSet _
) 
Visual Basic (Usage)Copy Code
Dim instance As StoreScu
Dim Scp As DicomScp
Dim dataset As DicomDataSet
 
instance.Store(Scp, dataset)
C# 
public void Store( 
   DicomScp Scp,
   DicomDataSet dataset
)
Managed Extensions for C++ 
public: void Store( 
   DicomScp* Scp,
   DicomDataSet dataset
) 
C++/CLI 
public:
void Store( 
   DicomScp^ Scp,
   DicomDataSet dataset
) 

Parameters

Scp
The peer connection to send the C-STORE-REQ to.
dataset
The dataset to send.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when SCP is null.

Example

Stores a dataset a remote DICOM server.

Visual BasicCopy Code
Public 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 your Dicom server.
   '
   scp.AETitle = "MI_SERVER"
   scp.Port = 104
   scp.Timeout = 60
   scp.PeerAddress = IPAddress.Parse("10.1.1.96")

   ds.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Image1.dic", DicomDataSetLoadFlags.None)

   AddHandler cstoreDataset.ReceiveBuffer, AddressOf cstoreDataset_ReceiveBuffer
   AddHandler cstoreDataset.BeforeCStore, AddressOf cstoreDataset_BeforeCStore
   AddHandler cstoreDataset.AfterCStore, AddressOf cstoreDataset_AfterCStore
   cstoreDataset.Compression = Compression.Lossless
   cstoreDataset.Store(scp, ds)

   DicomNet.Shutdown()
   DicomEngine.Shutdown()
End Sub

Private Sub cstoreDataset_ReceiveBuffer(ByVal sender As Object, ByVal e As ReceiveBufferEventArgs)
   Console.WriteLine("{0} bytes of data received", e.BufferSize)
End Sub

Private Sub cstoreDataset_BeforeCStore(ByVal sender As Object, ByVal e As BeforeCStoreEventArgs)
   '
   ' Stop storing if we received an error
   '
   If Not e.Error Is Nothing Then
      e.Skip = SkipMethod.AllFiles
   End If
End Sub

Private Sub cstoreDataset_AfterCStore(ByVal sender As Object, ByVal e As AfterCStoreEventArgs)
   Dim msg As String

   msg = String.Format("Dataset store complete. Status: {0}", e.Status)
   Console.WriteLine(msg)
End Sub
C#Copy Code
public void StoreDataset() 

    DicomEngine.Startup(); 
    DicomNet.Startup(); 
 
    StoreScu storeDataset = new StoreScu(); 
    DicomScp scp = new DicomScp(); 
    DicomDataSet ds = new DicomDataSet(); 
 
    // 
    // Change these parameters to reflect your Dicom server. 
    // 
    scp.AETitle = "MI_SERVER"; 
    scp.Port = 104; 
    scp.Timeout = 60; 
    scp.PeerAddress = IPAddress.Parse("10.1.1.96"); 
    string fileName = LeadtoolsExamples.Common.ImagesPath.Path + "Image1.dic"; 
    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); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Dicom.Scu requires a Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features