How to implement C-GET in .NET

C-GET in the new .NET version of DicomOjects can be done via DicomQuery object or DicomConnection object:

  • DicomQuery.Get ( 2 Overload Methods )
  • DicomConnection.Get

Following are sample VB.NET code to show how to implement C-GET using DicomQuery and DicomConnection Objects.

DicomQuery.Get()

Dim q As New DicomObjects.DicomQuery
Dim results As DicomObjects.DicomDataSetCollection
Dim result As DicomObjects.DicomDataSet

q.Root = "STUDY"                  ' Root 
q.Level = "IMAGE"                 ' Level
q.Node = "localhost"              ' IP address of Remote SCP 
q.Port = 105                      ' Port number of Remote SCP

q.PatientID = "222.22.2222"                                ' Patient ID
q.StudyUID = "999.999.2.19941105.112000"                   ' Study UID
q.SeriesUID = "1.2.826.0.1.3680043.4.1.19990124221049.3"   ' Series UID
q.InstanceUID = "1.2.826.0.1.3680043.4.1.19990124230602.1" ' Instance UID

results = q.Get()           ' Send C-GET Request to Remote SCP

For Each result In results  ' C-GET results can be found in the returned DataSetCollection object
  MsgBox(result.Name)
Next

Note: if nothing has been matched, an empty DataSetCollection will be returned - this is not an error!


 

DicomQuery.Get(Request)

Dim q As New DicomObjects.DicomQuery
Dim Request As New DicomObjects.DicomDataSet
Dim results As DicomObjects.DicomDataSetCollection
Dim result As DicomObjects.DicomDataSet

q.Root = "STUDY"                  ' Root 
q.Node = "localhost"              ' IP address of Remote SCP 
q.Port = 105                      ' Port number of Remote SCP

Request.PatientID = "222.22.2222"                                ' Patient ID
Request.StudyUID = "999.999.2.19941105.112000"                   ' Study UID
Request.SeriesUID = "1.2.826.0.1.3680043.4.1.19990124221049.3"   ' Series UID
Request.InstanceUID = "1.2.826.0.1.3680043.4.1.19990124230602.1" ' Instance UID

Request.Add(&H8, &H52, "IMAGE")   ' Level 
Request.Add(&H8, &H60, "US")      ' Modality

results = q.Get(Request)   ' Send C-GET Request to Remote SCP

For Each result In results ' C-GET results can be found in the returned DataSetCollection object
  MsgBox(result.Name)
Next

DicomConnection.Get()

Dim cn As New DicomObjects.DicomConnection
Dim Request As New DicomObjects.DicomDataSet

cn.Open("localhost", 105, "client", "server")

Request.PatientID = "222.22.2222"                                ' Patient ID
Request.StudyUID = "999.999.2.19941105.112000"                   ' Study UID
Request.SeriesUID = "1.2.826.0.1.3680043.4.1.19990124221049.3"   ' Series UID
Request.InstanceUID = "1.2.826.0.1.3680043.4.1.19990124230602.1" ' Instance UID

Request.Add(&H8, &H52, "IMAGE")   ' Level 
Request.Add(&H8, &H60, "US")      ' Modality

cn.Get("STUDY", Request)          ' Send C-GET Request to Remote SCP

MsgBox(cn.ReturnedDataSets.Count) ' C-GET results can be found in the ReturnedDataSets property

Note: C-GET request must be sent after the Open method has been called.


Relevance: