Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 protected DcmJpegCodec(DicomTransferSyntax transferSyntax, DcmJpegParameters defaultParameters = null)
 {
     _transferSyntax = transferSyntax;
     _defaultParameters = defaultParameters ?? new DcmJpegParameters();
 }
Esempio n. 3
0
		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);
		}