예제 #1
0
        public static bool VerifyAssociation(IDicomServerContext context, AssociationParameters assocParms, out DicomRejectResult result, out DicomRejectReason reason)
        {
            string calledTitle = (assocParms.CalledAE ?? "").Trim();
            string callingAE   = (assocParms.CallingAE ?? "").Trim();

            result = DicomRejectResult.Permanent;
            reason = DicomRejectReason.NoReasonGiven;

            var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration();

            if (!extendedConfiguration.AllowUnknownCaller && ServerDirectory.GetRemoteServersByAETitle(callingAE).Count == 0)
            {
                reason = DicomRejectReason.CallingAENotRecognized;
            }
            else if (calledTitle != context.AETitle)
            {
                reason = DicomRejectReason.CalledAENotRecognized;
            }
            else
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
        private static IEnumerable <SupportedSop> GetSupportedSops()
        {
            var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration();

            foreach (SopClass sopClass in GetSopClasses(extendedConfiguration.ImageStorageSopClassUids))
            {
                var supportedSop = new SupportedSop
                {
                    SopClass = sopClass
                };

                supportedSop.AddSyntax(TransferSyntax.ExplicitVrLittleEndian);
                supportedSop.AddSyntax(TransferSyntax.ImplicitVrLittleEndian);

                foreach (TransferSyntax transferSyntax in GetTransferSyntaxes(extendedConfiguration.StorageTransferSyntaxUids))
                {
                    if (transferSyntax.DicomUid.UID != TransferSyntax.ExplicitVrLittleEndianUid &&
                        transferSyntax.DicomUid.UID != TransferSyntax.ImplicitVrLittleEndianUid)
                    {
                        supportedSop.AddSyntax(transferSyntax);
                    }
                }

                yield return(supportedSop);
            }
        }