Exemplo n.º 1
0
        public static DicomDataset Write(DicomRTReferencedSeries series)
        {
            var ds = new DicomDataset();

            ds.Add(DicomTag.SeriesInstanceUID, series.SeriesInstanceUID);

            var listOfContour = new List <DicomDataset>();

            foreach (var contour in series.ContourImages)
            {
                var newDS = DicomRTContourImageItem.Write(contour);
                listOfContour.Add(newDS);
            }

            ds.Add(new DicomSequence(DicomTag.ContourImageSequence, listOfContour.ToArray()));
            return(ds);
        }
Exemplo n.º 2
0
        public static DicomRTReferencedStudy Read(DicomDataset ds)
        {
            var refSOPClass    = ds.GetStringOrEmpty(DicomTag.ReferencedSOPClassUID);
            var refSOPInstance = ds.GetStringOrEmpty(DicomTag.ReferencedSOPInstanceUID);
            var listSeries     = new List <DicomRTReferencedSeries>();

            if (ds.Contains(DicomTag.RTReferencedSeriesSequence))
            {
                // Changed for new OSS fo-dicom-desktop
                var seq = ds.GetSequence(DicomTag.RTReferencedSeriesSequence);
                //var seq = ds.Get<DicomSequence>(DicomTag.RTReferencedSeriesSequence);
                foreach (var item in seq)
                {
                    listSeries.Add(DicomRTReferencedSeries.Read(item));
                }
            }
            return(new DicomRTReferencedStudy(refSOPClass, refSOPInstance, listSeries));
        }
Exemplo n.º 3
0
        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);
        }