private List <SeriesInformation> GetSeriesForLoading(string dicomDirFile)
        {
            List <SeriesInformation> seriesInfo;
            DicomDirQueryClient      client;

            DicomDataSet[] seriesDataSets;


            seriesInfo     = new List <SeriesInformation> ( );
            client         = new DicomDirQueryClient(dicomDirFile);
            seriesDataSets = client.FindSeries(new FindQuery( ));


            foreach (DicomDataSet sereisDs in seriesDataSets)
            {
                SeriesInformation series;


                series = new SeriesInformation(sereisDs.GetValue <string> (DicomTag.PatientID, string.Empty),
                                               sereisDs.GetValue <string> (DicomTag.StudyInstanceUID, string.Empty),
                                               sereisDs.GetValue <string> (DicomTag.SeriesInstanceUID, string.Empty),
                                               sereisDs.GetValue <string> (DicomTag.SeriesDescription, string.Empty));

                seriesInfo.Add(series);

                sereisDs.Dispose( );
            }

            return(seriesInfo);
        }
Ejemplo n.º 2
0
        public static QueryClient CreateQueryClient(DicomClientMode clientMode)
        {
            try
            {
                switch (clientMode)
                {
                case DicomClientMode.LocalDb:
                {
                    QueryClient             client;
                    IStorageDataAccessAgent dataAccess;


                    if (!ConfigurationData.SupportLocalQueriesStore)
                    {
                        throw new InvalidOperationException("Feature is not supported.");
                    }

                    dataAccess = DataAccessServices.GetDataAccessService <IStorageDataAccessAgent> ( );

                    if (null == dataAccess)
                    {
                        throw new InvalidOperationException("Storage Service is not registered.");
                    }

                    client = new DbQueryClient(ConfigurationData.WorkstationClient.ToAeInfo( ), dataAccess);

                    client.EnableLog   = ConfigurationData.Debugging.GenerateLogFile;
                    client.LogFileName = ConfigurationData.Debugging.LogFileName;

                    return(client);
                }


                case DicomClientMode.Pacs:
                {
                    QueryClient client;
                    Leadtools.Dicom.Scu.DicomScp scp;


                    if (!ConfigurationData.SupportDicomCommunication)
                    {
                        throw new InvalidOperationException("Feature is not supported.");
                    }

                    scp = new Leadtools.Dicom.Scu.DicomScp( );

                    scp.AETitle     = ConfigurationData.ActivePacs.AETitle;
                    scp.PeerAddress = Utils.ResolveIPAddress(ConfigurationData.ActivePacs.Address);
                    scp.Port        = ConfigurationData.ActivePacs.Port;
                    scp.Timeout     = ConfigurationData.ActivePacs.Timeout;

                    client = new PacsQueryClient(ConfigurationData.WorkstationClient.ToAeInfo( ),
                                                 scp);

                    client.EnableLog   = ConfigurationData.Debugging.GenerateLogFile;
                    client.LogFileName = ConfigurationData.Debugging.LogFileName;

                    return(client);
                }

                case DicomClientMode.DicomDir:
                {
                    DicomDirQueryClient client = new DicomDirQueryClient(ConfigurationData.CurrentDicomDir);

                    return(client);
                }

                default:
                {
                    throw new NotImplementedException("Dicom Client not implemented.");
                }
                }
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false, exception.Message);

                throw;
            }
        }