本文整理汇总了C#中Dicom.Data.DcmDataset.AddElementWithValueString方法的典型用法代码示例。如果您正苦于以下问题:C# DcmDataset.AddElementWithValueString方法的具体用法?C# DcmDataset.AddElementWithValueString怎么用?C# DcmDataset.AddElementWithValueString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dicom.Data.DcmDataset
的用法示例。
在下文中一共展示了DcmDataset.AddElementWithValueString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transform
public void Transform(DcmDataset dataset) {
if (dataset.Contains(_tag)) {
string value = dataset.GetValueString(_tag);
dataset.AddElementWithValueString(_tag, value.ToLower());
}
}
示例2: MakeGreyDicom
public string MakeGreyDicom(byte[] greybytes, ushort imgwidth, ushort imgheight)
{
DcmUID studyUid = DcmUID.Generate();
DcmUID seriesUid = DcmUID.Generate(studyUid, 1);
DcmUID instUid = DcmUID.Generate(seriesUid, 1);
DcmDataset data = new DcmDataset(DcmTS.ExplicitVRBigEndian);//.ImplicitVRLittleEndian ok
data.AddElementWithValue(DcmTags.SOPClassUID, DcmUIDs.CTImageStorage);//ComputedRadiographyImageStorage ok
//data.AddElementWithValue(DcmTags.SOPClassUID, DcmUIDs .SecondaryCapture);
data.AddElementWithValue(DcmTags.StudyInstanceUID, studyUid);
data.AddElementWithValue(DcmTags.SeriesInstanceUID, seriesUid);
data.AddElementWithValue(DcmTags.SOPInstanceUID, instUid);//"1.3.6.1.4.1.30071.6.635719267134010719.1.1"
//data.AddElementWithValue(DcmTags.MediaStorageSOPClassUID, DcmUIDs.ImplicitVRLittleEndian);
//data.AddElementWithValueString(DcmTags.MediaStorageSOPClassUID, DcmUIDs.ComputedRadiographyImageStorage.ToString());
//type 2 attributes
////data.AddElement(DcmTags.PrinterStatus);
if (tags.ContainsKey("0010,0020"))
data.AddElementWithValueString(DcmTags.PatientID, tags["0010,0020"].Substring(5));
if (tags.ContainsKey("0010,0010"))
data.AddElementWithValueString(DcmTags.PatientsName, tags["0010,0010"].Substring(5));
if (tags.ContainsKey("0010,0030"))
data.AddElementWithValueString(DcmTags.PatientsBirthDate, tags["0010,0030"].Substring(5));
if (tags.ContainsKey("0010,0040"))
data.AddElementWithValueString(DcmTags.PatientsSex, tags["0010,0040"].Substring(5));
if (tags.ContainsKey("0010,1010"))
data.AddElementWithValueString(DcmTags.PatientsAge, tags["0010,1010"].Substring(5));
if (tags.ContainsKey("0008,0005"))
data.AddElementWithValueString(DcmTags.SpecificCharacterSet, tags["0008,0005"].Substring(5));
if (tags.ContainsKey("0008,0008"))
data.AddElementWithValueString(DcmTags.ImageType, tags["0008,0008"].Substring(5));
//if (tags.ContainsKey("0008,0016"))
// data.AddElementWithValueString(DcmTags.ContentTime, DateTime.Now.ToString());
//if (tags.ContainsKey("0008,0018"))
// data.AddElementWithValueString(DcmTags.ContentTime, DateTime.Now.ToString());
if (tags.ContainsKey("0008,0020"))
data.AddElementWithValueString(DcmTags.StudyDate, tags["0008,0020"].Substring(5));
if (tags.ContainsKey("0008,0021"))
data.AddElementWithValueString(DcmTags.SeriesDate, tags["0008,0021"].Substring(5));
if (tags.ContainsKey("0008,0022"))
data.AddElementWithValueString(DcmTags.AcquisitionDate, tags["0008,0022"].Substring(5));
if (tags.ContainsKey("0008,0023"))
data.AddElementWithValueString(DcmTags.ContentDate, tags["0008,0023"].Substring(5));
if (tags.ContainsKey("0008,002a"))
data.AddElementWithValueString(DcmTags.AcquisitionDateTime, tags["0008,002a"].Substring(5));
if (tags.ContainsKey("0008,0030"))
data.AddElementWithValueString(DcmTags.StudyTime, tags["0008,0030"].Substring(5));
if (tags.ContainsKey("0008,0031"))
data.AddElementWithValueString(DcmTags.SeriesTime, tags["0008,0031"].Substring(5));
if (tags.ContainsKey("0008,0032"))
data.AddElementWithValueString(DcmTags.AcquisitionTime, tags["0008,0032"].Substring(5));
if (tags.ContainsKey("0008,0033"))
data.AddElementWithValueString(DcmTags.ContentTime, tags["0008,0033"].Substring(5));
if (tags.ContainsKey("0008,0050"))
data.AddElementWithValueString(DcmTags.AcquisitionNumber, tags["0008,0050"].Substring(5));
if (tags.ContainsKey("0008,0060"))
data.AddElementWithValueString(DcmTags.Modality, tags["0008,0060"].Substring(5));
if (tags.ContainsKey("0008,0070"))
data.AddElementWithValueString(DcmTags.Manufacturer, tags["0008,0070"].Substring(5));
if (tags.ContainsKey("0008,0080"))
data.AddElementWithValueString(DcmTags.InstitutionName, tags["0008,0080"].Substring(5));
if (tags.ContainsKey("0008,0081"))
data.AddElementWithValueString(DcmTags.InstitutionAddress, tags["0008,0081"].Substring(5));
if (tags.ContainsKey("0008,0090"))
data.AddElementWithValueString(DcmTags.ReferringPhysiciansName, tags["0008,0090"].Substring(5));
if (tags.ContainsKey("0008,1010"))
data.AddElementWithValueString(DcmTags.StationName, tags["0008,1010"].Substring(5));
if (tags.ContainsKey("0008,1030"))
data.AddElementWithValueString(DcmTags.StudyDescription, tags["0008,1030"].Substring(5));
if (tags.ContainsKey("0008,103e"))
data.AddElementWithValueString(DcmTags.SeriesDescription, tags["0008,103e"].Substring(5));
if (tags.ContainsKey("0008,1090"))
data.AddElementWithValueString(DcmTags.ManufacturersModelName, tags["0008,1090"].Substring(5));
if (tags.ContainsKey("0018,0010"))
data.AddElementWithValueString(DcmTags.ContrastBolusAgent, tags["0018,0010"].Substring(5));
if (tags.ContainsKey("0018,0015"))
data.AddElementWithValueString(DcmTags.BodyPartExamined, tags["0018,0015"].Substring(5));
if (tags.ContainsKey("0018,0050"))
data.AddElementWithValueString(DcmTags.SliceThickness, tags["0018,0050"].Substring(5));
if (tags.ContainsKey("0018,0060"))
data.AddElementWithValueString(DcmTags.KVP, tags["0018,0060"].Substring(5));
if (tags.ContainsKey("0018,0090"))
data.AddElementWithValueString(DcmTags.DataCollectionDiameter, tags["0018,0090"].Substring(5));
if (tags.ContainsKey("0018,1000"))
data.AddElementWithValueString(DcmTags.DeviceSerialNumber, tags["0018,1000"].Substring(5));
if (tags.ContainsKey("0018,1020"))
data.AddElementWithValueString(DcmTags.SoftwareVersions, tags["0018,1020"].Substring(5));
if (tags.ContainsKey("0018,1030"))
data.AddElementWithValueString(DcmTags.ProtocolName, tags["0018,1030"].Substring(5));
if (tags.ContainsKey("0018,1041"))
data.AddElementWithValueString(DcmTags.ContrastBolusVolume, tags["0018,1041"].Substring(5));
if (tags.ContainsKey("0018,1042"))
data.AddElementWithValueString(DcmTags.ContrastBolusStartTime, tags["0018,1042"].Substring(5));
if (tags.ContainsKey("0018,1043"))
data.AddElementWithValueString(DcmTags.ContrastBolusStopTime, tags["0018,1043"].Substring(5));
if (tags.ContainsKey("0018,1044"))
data.AddElementWithValueString(DcmTags.ContrastBolusTotalDose, tags["0018,1044"].Substring(5));
//.........这里部分代码省略.........