示例#1
0
文件: MainForm.cs 项目: xiaotie/mdcm
        private void OnSend(object sender, EventArgs e)
        {
            ToggleSendButtons(false);

            SaveConfig();

            CStoreClient scu = new CStoreClient();

            scu.DisableFileStreaming           = true;
            scu.CallingAE                      = Config.LocalAE;
            scu.CalledAE                       = Config.RemoteAE;
            scu.MaxPduSize                     = Config.MaxPdu;
            scu.ConnectTimeout                 = 0;
            scu.SocketTimeout                  = Config.Timeout;
            scu.DimseTimeout                   = Config.Timeout;
            scu.SerializedPresentationContexts = true;
            scu.PreferredTransferSyntax        = TransferSyntaxes[Config.TransferSyntax];

            //if (scu.PreferredTransferSyntax == DicomTransferSyntax.JPEGProcess1 ||
            //    scu.PreferredTransferSyntax == DicomTransferSyntax.JPEGProcess2_4) {
            //    DcmJpegParameters param = new DcmJpegParameters();
            //    param.Quality = Config.Quality;
            //    scu.PreferredTransferSyntaxParams = param;
            //}
            //else if (scu.PreferredTransferSyntax == DicomTransferSyntax.JPEG2000Lossy) {
            //    DcmJpeg2000Parameters param = new DcmJpeg2000Parameters();
            //    param.Rate = Config.Quality;
            //    scu.PreferredTransferSyntaxParams = param;
            //}

            scu.OnCStoreResponseReceived = delegate(CStoreClient client, CStoreRequestInfo info) {
                Invoke(new CStoreRequestCallback(UpdateSendInfo), client, info);
            };

            foreach (ListViewItem lvi in lvSendImages.Items)
            {
                lvi.ImageIndex       = 0;
                lvi.SubItems[3].Text = "Pending";

                CStoreRequestInfo info = (CStoreRequestInfo)lvi.Tag;
                scu.AddFile(info);
            }

            ThreadPool.QueueUserWorkItem(new WaitCallback(RunDicomSend), scu);
        }
示例#2
0
 private void UpdateSendInfo(CStoreClient client, CStoreRequestInfo info)
 {
     ListViewItem lvi = (ListViewItem)info.UserState;
     lvi.ImageIndex = (info.Status == DcmStatus.Success) ? 1 : 2;
     lvi.SubItems[3].Text = info.Status.Description;
     lvSendImages.EnsureVisible(lvi.Index);
 }
示例#3
0
        private void OnSendAddImage(object sender, EventArgs e)
        {
            OpenFileDialog fd = new OpenFileDialog();
            fd.Multiselect = true;
            if (fd.ShowDialog(this) == DialogResult.OK) {
                foreach (string filename in fd.FileNames) {
                    try {
                        CStoreRequestInfo info = new CStoreRequestInfo(filename);

                        ListViewItem item = new ListViewItem(filename, 0);
                        item.SubItems.Add(info.SOPClassUID.Description);
                        item.SubItems.Add(info.TransferSyntax.UID.Description);
                        item.SubItems.Add(info.Status.Description);

                        item.Tag = info;
                        info.UserState = item;

                        lvSendImages.Items.Add(item);
                    }
                    catch { }
                }
            }
        }