public void Store(
DicomScp Scp,
DicomDataSet dataset
)
public:
void Store(
DicomScp^ Scp,
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;
using Leadtools.Dicom.Common.DataTypes.Status;
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, "DICOM", "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);
if (e.Status != DicomCommandStatusType.Success)
{
string statusAllString = e.StatusAll.ToString(StatusFormatFlags.IgnoreStatus, "\n", "\t");
Console.WriteLine(statusAllString);
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.