Ejemplo n.º 1
0
        /// <summary>
        /// Create image box from DICOM data.
        /// </summary>
        private void CreateImageBox()
        {
            DicomUID classUid = DicomUID.BasicGrayscaleImageBoxSOPClass;

            if (_filmSession.IsColor)
            {
                classUid = DicomUID.BasicColorImageBoxSOPClass;
            }

            DicomUID sopInstance = new DicomUID(
                string.Format("{0}.{1}", SOPInstanceUID.UID, BasicImageBoxes.Count + 1),
                SOPInstanceUID.Name,
                SOPInstanceUID.Type);

            var imageBox = new ImageBox(this, classUid, sopInstance);

            imageBox.ImageBoxPosition = (ushort)(BasicImageBoxes.Count + 1);

            BasicImageBoxes.Add(imageBox);

            var item = new DicomDataset();

            item.Add(DicomTag.ReferencedSOPClassUID, classUid);
            item.Add(DicomTag.ReferencedSOPInstanceUID, sopInstance);

            var seq = Get <DicomSequence>(DicomTag.ReferencedImageBoxSequence);

            seq.Items.Add(item);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create basic film box clone for specfifed film box instance
 /// </summary>
 /// <param name="filmBox">Basic film box instance to clone</param>
 private FilmBox(FilmBox filmBox)
     : this(filmBox._filmSession.CloneFilmSession(), filmBox.SOPInstanceUID, filmBox)
 {
     foreach (var imageBox in filmBox.BasicImageBoxes)
     {
         BasicImageBoxes.Add(imageBox.Clone(this));
     }
 }