public void AddDS(DicomDataSet addDS) { DicomDataSet ds = new DicomDataSet(); ds.Copy(addDS, null, null); dsCollection.Add(ds); }
public DicomCommandStatusType OnNAction(DicomClient Client, byte PresentationId, int MessageId, string AffectedClass, string Instance, int Action, DicomDataSet Request, DicomDataSet Response) { DicomDataSet ds = new DicomDataSet(Client.Server.TemporaryDirectory); string ConnectionString = "Data Source='" + Client.Server.ServerDirectory + @"\Dicom.sdf'"; string DBFile = Client.Server.ServerDirectory + @"\Dicom.sdf"; if (!File.Exists(DBFile)) { return(DicomCommandStatusType.ResourceLimitation); } ds.Copy(Request, null, null); MyParameters parameters = new MyParameters(); parameters._client = Client; parameters._ds = ds; parameters._connectionString = ConnectionString; parameters._presentationId = PresentationId; parameters._messageId = MessageId; parameters.ServerAE = Client.Server.AETitle; result = AsyncHelper.Execute <MyParameters>(new Action <MyParameters>(this.MyDelegate), parameters); Response = null; return(DicomCommandStatusType.Success); }
public static DicomDataSet Copy(this DicomDataSet dataset, string tempDirectory) { DicomDataSet copy = null; if (dataset == null) { return(copy); } copy = new DicomDataSet(tempDirectory); copy.Copy(dataset, null, null); return(copy); }
protected override void OnReceiveCStoreRequest(byte presentationID, int messageID, string affectedClass, string instance, DicomCommandPriorityType priority, string moveAE, int moveMessageID, DicomDataSet dataSet) { DicomDataSet ds = new DicomDataSet(); server.cfind.InvokeStatusEvent(StatusType.ReceiveCStoreRequest, DicomExceptionCode.Success); if (dataSet == null) { SendCStoreResponse(presentationID, messageID, affectedClass, instance, DicomCommandStatusType.ProcessingFailure); return; } ds.Copy(dataSet, null, null); server.dsCollection.Add(ds); server.cfind.InvokeStatusEvent(StatusType.SendCStoreResponse, DicomExceptionCode.Success); SendCStoreResponse(presentationID, messageID, affectedClass, instance, DicomCommandStatusType.Success); }
private DicomDataSet Anonymize() { DicomDataSet dsAnonymized = new DicomDataSet(); try { DicomElement pixelData = null; pixelData = _ActiveDataSet.FindFirstElement(null, DicomTag.PixelData, true); _Anonymizer.BlackoutRects.Clear(); if (toolStripButtonRedact.Checked && pixelData != null && _ActiveDataSet.GetImageCount(pixelData) > 0) { using (SelectBlackoutRectsDialog dlgRects = new SelectBlackoutRectsDialog(_ActiveDataSet)) { if (dlgRects.ShowDialog(this) == DialogResult.OK && dlgRects.BlackoutRects.Count > 0) { _Anonymizer.BlackoutRects.AddRange(dlgRects.BlackoutRects); } } } if (_ActiveDataSet.InformationClass != DicomClassType.BasicDirectory) { dsAnonymized.Copy(_ActiveDataSet, null, null); ToggleProgress(true); _Anonymizer.Anonymize(dsAnonymized); ShowDifference(_ActiveDataSet, dsAnonymized); } } catch (Exception exception) { Messager.ShowError(this, exception); } finally { ToggleProgress(false); } return(dsAnonymized); }
private static DicomDataSet Copy(DicomDataSet dsOriginal) { DicomDataSet copy = new DicomDataSet(); AutoResetEvent copyEvent = new AutoResetEvent(false); if (dsOriginal == null) { return(null); } try { copy.Copy(dsOriginal, null, null, DicomCopyCallback); } catch (Exception e) { Exception ex = e; string errorMessage = string.Empty; while (ex != null) { errorMessage += ex.ToString() + "\r\n"; ex = ex.InnerException; } try { DicomLogEntry logEntry = new DicomLogEntry(); logEntry.ClientAETitle = "Logger"; logEntry.Description = errorMessage; logEntry.LogType = LogType.Error; Logger.Global.Log(logEntry); } catch { } } return(copy); }
public DicomDS Copy() { return(new DicomDS(_Dataset.Copy())); }