public static DicomDataset Write(DicomRTFrameOFReference dicomRtFrameOfReference) { var ds = new DicomDataset(); ds.Add(DicomTag.FrameOfReferenceUID, dicomRtFrameOfReference.FrameOfRefUID); var lisOfStudies = new List <DicomDataset>(); foreach (var refStudy in dicomRtFrameOfReference.ReferencedStudies) { var newDS = DicomRTReferencedStudy.Write(refStudy); lisOfStudies.Add(newDS); } if (lisOfStudies.Count > 0) { ds.Add(new DicomSequence(DicomTag.RTReferencedStudySequence, lisOfStudies.ToArray())); } return(ds); }
public static DicomDataset Write(DicomRTReferencedStudy refStudy) { var ds = new DicomDataset(); ds.Add(DicomTag.ReferencedSOPClassUID, refStudy.ReferencedSOPClassUID); ds.Add(DicomTag.ReferencedSOPInstanceUID, refStudy.ReferencedSOPInstanceUID); var listOfContour = new List <DicomDataset>(); foreach (var series in refStudy.ReferencedSeries) { var newDS = DicomRTReferencedSeries.Write(series); listOfContour.Add(newDS); } if (listOfContour.Count > 0) { ds.Add(new DicomSequence(DicomTag.RTReferencedSeriesSequence, listOfContour.ToArray())); } return(ds); }
public static DicomRTFrameOFReference Read(DicomDataset ds) { // Changed for new OSS fo-dicom-desktop var frameReferencedUID = ds.GetString(DicomTag.FrameOfReferenceUID); //var frameReferencedUID = ds.Get(DicomTag.FrameOfReferenceUID, string.Empty); var referencedStudies = new List <DicomRTReferencedStudy>(); if (ds.Contains(DicomTag.RTReferencedStudySequence)) { // Changed for new OSS fo-dicom-desktop var seq = ds.GetSequence(DicomTag.RTReferencedStudySequence); //var seq = ds.Get<DicomSequence>(DicomTag.RTReferencedStudySequence); foreach (var item in seq) { referencedStudies.Add(DicomRTReferencedStudy.Read(item)); } } return(new DicomRTFrameOFReference( frameReferencedUID, referencedStudies)); }