Beispiel #1
0
        protected override IEnumerable <TransferSyntax> GetProposedTransferSyntaxesForUncompressedObjects(string sopClassUid)
        {
            List <TransferSyntax> syntaxes;

            if (!_sopClassUncompressedProposedTransferSyntaxes.TryGetValue(sopClassUid, out syntaxes))
            {
                syntaxes = new List <TransferSyntax>();

                // Check the ServerSopClass table to see if only implicit LE should be used when handling the sop class
                var configuration     = new PartitionSopClassConfiguration();
                var partitionSopClass = configuration.GetPartitionSopClass(_partition, sopClassUid);
                if (partitionSopClass != null)
                {
                    if (partitionSopClass.ImplicitOnly)
                    {
                        Platform.Log(LogLevel.Info, "System is being configured to send {0} using Implicit LE.", SopClass.GetSopClass(partitionSopClass.SopClassUid));
                    }
                    else
                    {
                        syntaxes.Add(TransferSyntax.ExplicitVrLittleEndian);
                    }

                    syntaxes.Add(TransferSyntax.ImplicitVrLittleEndian);
                }

                _sopClassUncompressedProposedTransferSyntaxes.Add(sopClassUid, syntaxes);
            }

            return(syntaxes);
        }
Beispiel #2
0
        /// <summary>
        /// Returns a list of the DICOM services supported by this plugin.
        /// </summary>
        /// <returns></returns>
        public override IList <SupportedSop> GetSupportedSopClasses()
        {
            if (!Context.AllowStorage)
            {
                return(new List <SupportedSop>());
            }

            // Note: this method is called on startup to set the server's presentation contexts and then on every association.
            // If the settings change between those calls, the server may either throw an exception (if the sop is removed) or
            // does not behave as expected unless the server is restarted.

            if (_list == null)
            {
                // Load from the database the non-image sops that are current configured for this server partition.
                _list = new List <SupportedSop>();

                var partitionSopClassConfig = new PartitionSopClassConfiguration();
                var sopClasses = partitionSopClassConfig.GetAllPartitionSopClasses(Partition);
                if (sopClasses != null)
                {
                    // Now process the SOP Class list
                    foreach (PartitionSopClass partitionSopClass in sopClasses)
                    {
                        if (partitionSopClass.Enabled &&
                            partitionSopClass.NonImage)
                        {
                            var sop = new SupportedSop
                            {
                                SopClass = SopClass.GetSopClass(partitionSopClass.SopClassUid)
                            };

                            if (!partitionSopClass.ImplicitOnly)
                            {
                                sop.SyntaxList.Add(TransferSyntax.ExplicitVrLittleEndian);
                            }

                            sop.SyntaxList.Add(TransferSyntax.ImplicitVrLittleEndian);

                            _list.Add(sop);
                        }
                    }
                }
            }

            return(_list);
        }
        /// <summary>
        /// Returns a list of the services supported by this plugin.
        /// </summary>
        /// <returns></returns>
        public override IList <SupportedSop> GetSupportedSopClasses()
        {
            if (!Context.AllowStorage)
            {
                return(new List <SupportedSop>());
            }

            if (_sopList == null)
            {
                _sopList = new List <SupportedSop>();

                // Get the SOP Classes
                using (IReadContext read = _store.OpenReadContext())
                {
                    // Get the transfer syntaxes
                    _syntaxList = LoadTransferSyntaxes(read, Partition.GetKey(), true);
                }

                var partitionSopClassConfig = new PartitionSopClassConfiguration();
                var sopClasses = partitionSopClassConfig.GetAllPartitionSopClasses(Partition);
                if (sopClasses != null)
                {
                    // Now process the SOP Class List
                    foreach (PartitionSopClass partitionSopClass in sopClasses)
                    {
                        if (partitionSopClass.Enabled &&
                            !partitionSopClass.NonImage)
                        {
                            var sop = new SupportedSop
                            {
                                SopClass = SopClass.GetSopClass(partitionSopClass.SopClassUid)
                            };

                            foreach (PartitionTransferSyntax syntax in _syntaxList)
                            {
                                sop.SyntaxList.Add(TransferSyntax.GetTransferSyntax(syntax.Uid));
                            }
                            _sopList.Add(sop);
                        }
                    }
                }
            }
            return(_sopList);
        }