←Select platform

GetDicomDataSet Method

Summary

Retrieves a DicomDataSet with the specified SOPInstanceUID from the storage source.

Syntax
C#
C++/CLI
public DicomDataSet GetDicomDataSet( 
   string sopInstanceUID 
) 
public:  
   DicomDataSet^ GetDicomDataSet( 
      String^ sopInstanceUID 
   ) 

Parameters

sopInstanceUID

The SOPInstanceUID of the DicomDataSet to be retrieved.

Return Value

A DicomDataSet whose SOPInstanceUID is sopInstanceUID.

If no such DicomDataSet exists, then null is returned.

Example
C#
using Leadtools.Dicom; 
using Leadtools.DicomDemos; 
using Leadtools.Medical.DataAccessLayer; 
using Leadtools.Medical.DataAccessLayer.Catalog; 
using Leadtools.Medical.Storage.DataAccessLayer; 
using Leadtools.Medical.Storage.DataAccessLayer.Configuration; 
 
public static IStorageDataAccessAgent5 GetStorageDataAccessAgent5() 
{ 
   // Before running this sample, follow these steps: 
   // 1. Run CSPacsDatabaseConfigurationDemo.exe to create the databases 
   // 2. Run CSPACSConfigDemo.exe to create the DICOM services 
   // 3. Set 'serviceDirectory' to the DICOM service folder 
   string serviceDirectory = @"C:\LEADTOOLS22\Bin\Dotnet4\x64\L22_PACS_SCP64"; 
   string productName = "StorageServer"; 
   string serviceName = "L22_PACS_SCP64"; 
   System.Configuration.Configuration configuration = DicomDemoSettingsManager.GetGlobalPacsAddinsConfiguration(serviceDirectory); 
 
   StorageDataAccessConfigurationView view = new StorageDataAccessConfigurationView(configuration, productName, serviceName); 
   IStorageDataAccessAgent5 agent = DataAccessFactory.GetInstance(view).CreateDataAccessAgent<IStorageDataAccessAgent5>(); 
   return agent; 
} 
 
public static void GetDicomDataSetExample() 
{ 
   IStorageDataAccessAgent5 agent = GetStorageDataAccessAgent5(); 
 
   // The CSPacsDatabaseConfigurationDemo.exe stores the following two images: 
   // PatientID   LastName    FirstName   StudyInstanceUid                             SeriesInstanceUid                                        SopInstanceUid 
   // 12341234    JONES       JR          2.16.840.1.114151.4.862.39853.4041.912374    1.2.392.200036.9107.500.305.5577.557709021107405.121     1.2.392.200036.9107.500.305.5577.20090211.93715.105577 
   //                                                                                                                                           1.2.392.200036.9107.500.305.5577.20090211.93718.105577 
 
   string patientId = "12341234"; 
   string studyInstanceUid = "2.16.840.1.114151.4.862.39853.4041.912374"; 
   string sopInstanceUid1 = "1.2.392.200036.9107.500.305.5577.20090211.93715.105577"; 
   string sopInstanceUid2 = "1.2.392.200036.9107.500.305.5577.20090211.93718.105577"; 
 
   // ********* 
   // Example 1: 
   // Verify that the two instances exists 
   bool exists1 = agent.ExistsDicomDataSet(sopInstanceUid1); 
   bool exists2 = agent.ExistsDicomDataSet(sopInstanceUid2); 
   Debug.Assert(exists1 && exists2); 
 
   // ********* 
   // Example 2: 
   // Get a DicomDataSet from the data source based on SopInstanceUid 
   using (DicomDataSet ds = agent.GetDicomDataSet(sopInstanceUid1)) 
   { 
      string sID = ds.GetValue<string>(DicomTag.SOPInstanceUID, string.Empty); 
      Debug.Assert(sID == sopInstanceUid1); 
   } 
 
   // ********* 
   // Example 3: 
   // Get a DicomDataSet from the data source based on a DataSet 
   // Retrieve all DicomDataSets with PatientID == "12341234" 
   MatchingParameterCollection matchingCollection = new MatchingParameterCollection(); 
   MatchingParameterList matchingList = new MatchingParameterList(); 
   matchingCollection.Add(matchingList); 
   ICatalogEntity patientEntity = RegisteredEntities.GetPatientEntity(patientId); 
   matchingList.Add(patientEntity); 
 
   DataSet result = agent.QueryCompositeInstances(matchingCollection); 
   List<DicomDataSet> dsList = new List<DicomDataSet>(); 
   if (result != null) 
   { 
      dsList = agent.GetDicomDataSets(result); 
 
      // There should be exactly two DicomDataSets 
      Debug.Assert(dsList.Count == 2); 
   } 
 
   // ********* 
   // Example 4: 
   // Retrieve all DicomDataSets from the same StudyInstanceUID -- there will be two 
   dsList.Clear(); 
   dsList = agent.GetDicomDataSets(string.Empty, studyInstanceUid, string.Empty, string.Empty); 
   // There should be exactly two DicomDataSets 
   Debug.Assert(dsList.Count == 2); 
 
   // ********* 
   // Example 5: 
   // Retrieve all DicomDataSets using a MatchingParameterCollection 
   matchingCollection = new MatchingParameterCollection(); 
   matchingList = new MatchingParameterList(); 
   matchingCollection.Add(matchingList); 
   ICatalogEntity instanceEntity = RegisteredEntities.GetInstanceEntity(sopInstanceUid2); 
   matchingList.Add(instanceEntity); 
   dsList = agent.GetDicomDataSets(matchingCollection); 
   // There should be exactly one DicomDataSets 
   Debug.Assert(dsList.Count == 1); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.2.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Medical.Storage.DataAccessLayer Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.