private void SetText() { if (bytes != null) { int position = ScrollBar.Value; TextBox.Text = DicomObject.ToText(bytes, 16 * position, 16 * 8); } }
public void Load(DicomFile[] files, DicomObject dicomObject) { dicomObject.FileNames = new string[files.Length]; for (int i = 0; i < files.Length; i++) { dicomObject.FileNames[i] = files[i].File.Name; } if (files.Length > 0) { dicomObject.PatientId = files[0].Dataset.Get <string>(DicomTag.PatientID, ""); dicomObject.PatientName = files[0].Dataset.Get <string>(DicomTag.PatientName, ""); dicomObject.SeriesUid = files[0].Dataset.Get <string>(DicomTag.SeriesInstanceUID, ""); dicomObject.Modality = files[0].Dataset.Get <string>(DicomTag.Modality, ""); } }
protected void Load(DicomFile[] files, DicomObject dicomObject, IProgress <double> progress) { dicomObject.FileNames = new string[files.Length]; for (int i = 0; i < files.Length; i++) { dicomObject.FileNames[i] = files[i].File.Name; } if (files.Length > 0) { dicomObject.PatientId = files[0].Dataset.Get <string>(DicomTag.PatientID, ""); dicomObject.PatientName = files[0].Dataset.Get <string>(DicomTag.PatientName, ""); dicomObject.SeriesUid = files[0].Dataset.Get <string>(DicomTag.SeriesInstanceUID, ""); dicomObject.Modality = files[0].Dataset.Get <string>(DicomTag.Modality, ""); dicomObject.SeriesDescription = files[0].Dataset.Get <string>(DicomTag.SeriesDescription, ""); dicomObject.StudyDescription = files[0].Dataset.Get <string>(DicomTag.StudyDescription, ""); } }
private void CopyToolStripMenuItem_Click(object sender, EventArgs e) { TreeNode node = this.TreeView.SelectedNode; if (node != null) { Tag head = EK.Capture.Dicom.DicomToolKit.Tag.Head(node.Name.Substring(0, node.Name.IndexOf(' '))); Element element = dicom[head.ToString()]; string text = "Not implemented!"; if (element.VR != "SQ") { if (element.Value is Array) { if (element.VR == "OB" || element.VR == "UN") { text = DicomObject.ToText((byte[])element.Value); } else if (element.VR == "OW") { short[] source = (short[])element.Value; int count = source.Length * sizeof(short); byte[] bytes = new byte[count]; Buffer.BlockCopy((short[])element.Value, 0, bytes, 0, count); text = DicomObject.ToText(bytes); } else { text = String.Empty; foreach (object value in element.Value as Array) { if (text.Length > 0) { text += @"\"; } text += value.ToString().TrimEnd(); } } } else { text = element.Value.ToString(); } } Clipboard.SetText(text); } }
protected void Load(DicomFile[] files, DicomObject dicomObject, IProgress <double> progress) { try { if (files.Length > 0) { dicomObject.FileNames = new string[files.Length]; for (int i = 0; i < files.Length; i++) { dicomObject.FileNames[i] = files[i].File.Name; } dicomObject.PatientId = files[0].Dataset.GetSingleValueOrDefault(DicomTag.PatientID, ""); dicomObject.PatientName = files[0].Dataset.GetSingleValueOrDefault(DicomTag.PatientName, ""); dicomObject.SeriesUid = files[0].Dataset.GetSingleValueOrDefault(DicomTag.SeriesInstanceUID, ""); dicomObject.Modality = files[0].Dataset.GetSingleValueOrDefault(DicomTag.Modality, ""); dicomObject.SeriesDescription = files[0].Dataset.GetSingleValueOrDefault(DicomTag.SeriesDescription, ""); dicomObject.StudyDescription = files[0].Dataset.GetSingleValueOrDefault(DicomTag.StudyDescription, ""); } } catch (Exception e) { //Messenger.Default.Send(new NotificationMessage(e.Message)); } }