Sends a C-GET-REQ message to a peer member of a connection defined by Scp.
public void Get(DicomScp scp,DicomDataSet request)
Public Overloads Sub Get( _ByVal scp As Leadtools.Dicom.Scu.DicomScp, _ByVal request As Leadtools.Dicom.DicomDataSet _)
public:void Get(Leadtools.Dicom.Scu.DicomScp^ scp,Leadtools.Dicom.DicomDataSet^ request)
scp
The peer connection to send the C-GET-REQ to
request
The DICOM data sets which describes the C-GET-REQ information to retrieve.
The parameter request should contain the QueryRetrieveLevel (0008,0052), which should be one of "STUDY", "SERIES", or "IMAGE".
This example does an image-level C-GET to retrieve an instance from a DICOM Server that supports C-GET Specifically, it retrieves one of the SMITH^TERRY instances that are in the LXX_SERVER32 database of the CSLeadtools.Dicom.Server.exe Replace XX with the version of the toolkit (i.e. for version 19, this would be L19_SERVER32) This overload takes a DicomDataSet that contains QueryRetrieveLevel, as well as the UIDs associated with the level Note that for this overload of Get, you must specifically add the SOP Class UID of the instance that you are retrieving to the Association
using Leadtools;using Leadtools.Dicom.Scu;using Leadtools.Dicom.Scu.Common;using Leadtools.Dicom;using Leadtools.Dicom.Common.DataTypes;public void QueryRetrieveScu_Get2(){DicomEngine.Startup();DicomNet.Startup();//// Change these parameters to reflect the calling AETitle.//QueryRetrieveScu getScu = new QueryRetrieveScu();getScu.AETitle = "LEAD_CLIENT";getScu.HostPort = 1000;getScu.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);//// Change these parameters to reflect the called AETitle (server).//DicomScp scp = new DicomScp();scp.AETitle = "LEAD_GET_SCP";scp.Port = 404;scp.Timeout = 60;scp.PeerAddress = IPAddress.Parse("192.168.0.168");getScu.BeforeCGet += new BeforeCGetDelegate(getStudy_BeforeCGet2);getScu.AfterCGet += new AfterCGetDelegate(getStudy_AfterCGet2);getScu.ReceivedStoreRequest += new ReceivedStoreRequestDelegate(getStudy_ReceivedStoreRequest2);getScu.BeforeAssociateRequest += new BeforeAssociationRequestDelegate(getStudy_BeforeAssociateRequest2);// The C-GET must know the Media Storage SOP Class UID of the DICOM Datasets that you want to retrieve// In this example, the five SMITH^TERRY instances are retrieved// SOP Class UID of the instances is:// MR Image Storage// 1.2.840.10008.5.1.4.1.1.4// StudyInstanceUid of the study is:// 1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034// SeriesInstanceUid of the series is:// 1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0// SOPInstanceUid of one of the five instances is:// 1.3.12.2.1107.5.2.31.30563.2008120317404382714631941string studyInstanceUid = "1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034";string seriesInstanceUid = "1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0";string sopInstanceUid = "1.3.12.2.1107.5.2.31.30563.2008120317404382714631941";// InstanceLevel with a dataset -- retrieves one instanceDicomDataSet ds = new DicomDataSet();ds.InsertElementAndSetValue(DicomTag.QueryRetrieveLevel, "IMAGE");ds.InsertElementAndSetValue(DicomTag.StudyInstanceUID, studyInstanceUid);ds.InsertElementAndSetValue(DicomTag.SeriesInstanceUID, seriesInstanceUid);ds.InsertElementAndSetValue(DicomTag.SOPInstanceUID, sopInstanceUid);getScu.Get(scp, ds);DicomNet.Shutdown();DicomEngine.Shutdown();}// Here we add the SOP Class UID of the instance that being retrieved to the associationvoid getStudy_BeforeAssociateRequest2(object sender, BeforeAssociateRequestEventArgs e){int presentationCount = e.Associate.PresentationContextCount;byte newId = (byte)(2 * (presentationCount + 1));e.Associate.AddPresentationContext(newId, DicomAssociateAcceptResultType.AbstractSyntax, DicomUidType.MRImageStorage);e.Associate.AddTransfer(newId, DicomUidType.ExplicitVRLittleEndian);}void getStudy_BeforeCGet2(object sender, BeforeCGetEventArgs e){Console.WriteLine("Before CGet");}void getStudy_ReceivedStoreRequest2(object sender, ReceivedStoreRequestEventArgs e){Console.WriteLine("==========================================");Console.WriteLine("Patient Name:\t{0}", e.Patient.Name.Full);Console.WriteLine("SOPInstanceUID:\t{0}", e.Instance.SOPInstanceUID);}void getStudy_AfterCGet2(object sender, AfterCGetEventArgs e){Console.WriteLine("After CGet");Console.WriteLine("\t{0} Completed", e.Completed);Console.WriteLine("\t{0} Failed", e.Failed);Console.WriteLine("\t{0} Warning", e.Warning);Console.WriteLine("\tStatus: {0}", e.Status);}private void Form1_Load(object sender, EventArgs e){QueryRetrieveScu_Get2();}
Imports LeadtoolsImports Leadtools.Dicom.ScuImports Leadtools.Dicom.Scu.CommonImports Leadtools.DicomImports Leadtools.Dicom.Common.DataTypesPublic Sub QueryRetrieveScu_Get2()DicomEngine.Startup()DicomNet.Startup()'' Change these parameters to reflect the calling AETitle.'Dim getScu As New QueryRetrieveScu()getScu.AETitle = "LEAD_CLIENT"getScu.HostPort = 1000getScu.HostAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault(Function(ip) ip.AddressFamily = AddressFamily.InterNetwork)'' Change these parameters to reflect the called AETitle (server).'Dim scp As New DicomScp()scp.AETitle = "LEAD_GET_SCP"scp.Port = 404scp.Timeout = 60scp.PeerAddress = IPAddress.Parse("192.168.0.168")AddHandler getScu.BeforeCGet, AddressOf getStudy_BeforeCGet2AddHandler getScu.AfterCGet, AddressOf getStudy_AfterCGet2AddHandler getScu.ReceivedStoreRequest, AddressOf getStudy_ReceivedStoreRequest2AddHandler getScu.BeforeAssociateRequest, AddressOf getStudy_BeforeAssociateRequest2' The C-GET must know the Media Storage SOP Class UID of the DICOM Datasets that you want to retrieve' In this example, the five SMITH^TERRY instances are retrieved' SOP Class UID of the instances is:' MR Image Storage' 1.2.840.10008.5.1.4.1.1.4' StudyInstanceUid of the study is:' 1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034' SeriesInstanceUid of the series is:' 1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0' SOPInstanceUid of one of the five instances is:' 1.3.12.2.1107.5.2.31.30563.2008120317404382714631941Dim studyInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.30000008120313112035900000034"Dim seriesInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.2008120317404292381631917.0.0.0"Dim sopInstanceUid As String = "1.3.12.2.1107.5.2.31.30563.2008120317404382714631941"' InstanceLevel with a dataset -- retrieves one instanceDim ds As New DicomDataSet()ds.InsertElementAndSetValue(DicomTag.QueryRetrieveLevel, "IMAGE")ds.InsertElementAndSetValue(DicomTag.StudyInstanceUID, studyInstanceUid)ds.InsertElementAndSetValue(DicomTag.SeriesInstanceUID, seriesInstanceUid)ds.InsertElementAndSetValue(DicomTag.SOPInstanceUID, sopInstanceUid)getScu.Get(scp, ds)DicomNet.Shutdown()DicomEngine.Shutdown()End Sub' Here we add the SOP Class UID of the instance that being retrieved to the associationPrivate Sub getStudy_BeforeAssociateRequest2(ByVal sender As Object, ByVal e As BeforeAssociateRequestEventArgs)Dim presentationCount As Integer = e.Associate.PresentationContextCountDim newId As Byte = CByte(2 * (presentationCount + 1))e.Associate.AddPresentationContext(newId, DicomAssociateAcceptResultType.AbstractSyntax, DicomUidType.MRImageStorage)e.Associate.AddTransfer(newId, DicomUidType.ExplicitVRLittleEndian)End SubPrivate Sub getStudy_BeforeCGet2(ByVal sender As Object, ByVal e As BeforeCGetEventArgs)Console.WriteLine("Before CGet")End SubPrivate Sub getStudy_ReceivedStoreRequest2(ByVal sender As Object, ByVal e As ReceivedStoreRequestEventArgs)Console.WriteLine("==========================================")Console.WriteLine("Patient Name:" & Constants.vbTab & "{0}", e.Patient.Name.Full)Console.WriteLine("SOPInstanceUID:" & Constants.vbTab & "{0}", e.Instance.SOPInstanceUID)End SubPrivate Sub getStudy_AfterCGet2(ByVal sender As Object, ByVal e As AfterCGetEventArgs)Console.WriteLine("After CGet")Console.WriteLine(Constants.vbTab & "{0} Completed", e.Completed)Console.WriteLine(Constants.vbTab & "{0} Failed", e.Failed)Console.WriteLine(Constants.vbTab & "{0} Warning", e.Warning)Console.WriteLine(Constants.vbTab & "Status: {0}", e.Status)End SubPrivate Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)QueryRetrieveScu_Get2()End Sub
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
