コード例 #1
0
 private void AddStoragePresentationContexts(DcmAssociate associate)
 {
     foreach (DicomUID uid in DicomUID.Entries.Values)
     {
         if (uid.Description.Contains("Storage"))
         {
             byte pcid = associate.AddPresentationContext(uid);
             associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
             associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);
         }
     }
 }
コード例 #2
0
        protected override void OnConnected()
        {
            DcmAssociate associate = new DcmAssociate();

            byte pcid = associate.AddPresentationContext(FindSopClassUID);

            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            associate.CalledAE         = CalledAE;
            associate.CallingAE        = CallingAE;
            associate.MaximumPduLength = MaxPduSize;

            SendAssociateRequest(associate);
        }
コード例 #3
0
        protected override void OnConnected()
        {
            var associate = new DcmAssociate();

            byte pcid = associate.AddPresentationContext(DicomUID.PrinterSOPClass);

            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            pcid = associate.AddPresentationContext(DicomUID.BasicGrayscalePrintManagementMetaSOPClass);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            pcid = associate.AddPresentationContext(DicomUID.BasicColorPrintManagementMetaSOPClass);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            associate.CalledAE         = CalledAE;
            associate.CallingAE        = CallingAE;
            associate.MaximumPduLength = MaxPduSize;

            SendAssociateRequest(associate);
        }
コード例 #4
0
        protected override void OnConnected()
        {
            if (OnCStoreConnected != null)
            {
                try {
                    OnCStoreConnected(this);
                }
                catch (Exception e) {
                    Log.Error("Unhandled exception in user C-Store Connected Callback: {0}", e.Message);
                }
            }

            if (PendingCount > 0)
            {
                DcmAssociate associate = new DcmAssociate();

                lock (_lock) {
                    foreach (DicomUID uid in _presContextMap.Keys)
                    {
                        if (_preferredTransferSyntax != null)
                        {
                            if (!_presContextMap[uid].Contains(_preferredTransferSyntax))
                            {
                                _presContextMap[uid].Remove(_preferredTransferSyntax);
                            }
                            _presContextMap[uid].Insert(0, _preferredTransferSyntax);
                        }
                        if (_offerExplicit && !_presContextMap[uid].Contains(DicomTransferSyntax.ExplicitVRLittleEndian))
                        {
                            _presContextMap[uid].Add(DicomTransferSyntax.ExplicitVRLittleEndian);
                        }
                        if (!_presContextMap[uid].Contains(DicomTransferSyntax.ImplicitVRLittleEndian))
                        {
                            _presContextMap[uid].Add(DicomTransferSyntax.ImplicitVRLittleEndian);
                        }

                        if (!DicomUID.IsImageStorage(uid))
                        {
                            List <DicomTransferSyntax> remove = new List <DicomTransferSyntax>();
                            foreach (DicomTransferSyntax tx in _presContextMap[uid])
                            {
                                if (DicomTransferSyntax.IsImageCompression(tx))
                                {
                                    remove.Add(tx);
                                }
                            }
                            foreach (DicomTransferSyntax tx in remove)
                            {
                                _presContextMap[uid].Remove(tx);
                            }
                        }
                    }

                    if (SerializedPresentationContexts)
                    {
                        foreach (DicomUID uid in _presContextMap.Keys)
                        {
                            foreach (DicomTransferSyntax ts in _presContextMap[uid])
                            {
                                byte pcid = associate.AddPresentationContext(uid);
                                associate.AddTransferSyntax(pcid, ts);
                            }
                        }
                    }
                    else
                    {
                        foreach (DicomUID uid in _presContextMap.Keys)
                        {
                            byte pcid = associate.AddOrGetPresentationContext(uid);
                            foreach (DicomTransferSyntax ts in _presContextMap[uid])
                            {
                                associate.AddTransferSyntax(pcid, ts);
                            }
                        }
                    }
                }

                associate.CalledAE         = CalledAE;
                associate.CallingAE        = CallingAE;
                associate.MaximumPduLength = MaxPduSize;

                SendAssociateRequest(associate);
            }
            else
            {
                Close();
            }
        }
コード例 #5
0
ファイル: PrintClient.cs プロジェクト: GMZ/mdcm
        protected override void OnConnected()
        {
            var associate = new DcmAssociate();

            byte pcid = associate.AddPresentationContext(DicomUID.PrinterSOPClass);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            pcid = associate.AddPresentationContext(DicomUID.BasicGrayscalePrintManagementMetaSOPClass);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            pcid = associate.AddPresentationContext(DicomUID.BasicColorPrintManagementMetaSOPClass);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ExplicitVRLittleEndian);
            associate.AddTransferSyntax(pcid, DicomTransferSyntax.ImplicitVRLittleEndian);

            associate.CalledAE = CalledAE;
            associate.CallingAE = CallingAE;
            associate.MaximumPduLength = MaxPduSize;

            SendAssociateRequest(associate);
        }