示例#1
0
 /// <summary>
 /// Contructor from a <see cref="DicomCompressedPixelData"/> instance.
 /// </summary>
 /// <param name="compressedPixelData"></param>
 public DicomUncompressedPixelData(DicomCompressedPixelData compressedPixelData)
     : base(compressedPixelData)
 {
     if (BitsAllocated > 8)
     {
         _pd = new DicomAttributeOW(DicomTags.PixelData);
     }
     else
     {
         var pdTag = DicomTagDictionary.GetDicomTag(DicomTags.PixelData);
         var obTag = new DicomTag(DicomTags.PixelData, pdTag.Name, pdTag.VariableName, DicomVr.OBvr, pdTag.MultiVR, pdTag.VMLow, pdTag.VMHigh, pdTag.Retired);
         _pd = new DicomAttributeOB(obTag);
     }
     InitializeFrameData(this, _pd);
 }
示例#2
0
        private void InitializeFrameData(DicomUncompressedPixelData owner, DicomAttribute pixelDataAttribute)
        {
            var obAttrib = pixelDataAttribute as DicomAttributeOB;

            if (obAttrib != null && obAttrib.StreamLength > 0)
            {
                for (var n = 0; n < NumberOfFrames; ++n)
                {
                    _fd.Add(new FrameDataOB(owner, obAttrib, n));
                }
            }

            var owAttrib = pixelDataAttribute as DicomAttributeOW;

            if (owAttrib != null && owAttrib.StreamLength > 0)
            {
                for (var n = 0; n < NumberOfFrames; ++n)
                {
                    _fd.Add(new FrameDataOW(owner, owAttrib, n));
                }
            }
        }
示例#3
0
 /// <summary>
 /// Internal constructor used when copying an attribute from a pre-existing attribute instance.
 /// </summary>
 /// <param name="attrib">The attribute that is being copied.</param>
 internal DicomAttribute(DicomAttribute attrib)
 {
     Tag         = attrib.Tag;
     _valueCount = attrib.Count;
     _length     = attrib.StreamLength;
 }
示例#4
0
 /// <summary>
 /// Constructor from an <see cref="DicomAttributeCollection"/> instance.
 /// </summary>
 /// <param name="collection"></param>
 public DicomUncompressedPixelData(DicomAttributeCollection collection)
     : base(collection)
 {
     _pd = collection[DicomTags.PixelData];
     InitializeFrameData(this, _pd);
 }
示例#5
0
 /// <summary>
 /// Initializes a <see cref="DicomUncompressedPixelData"/> from the attributes in a DICOM file/message.
 /// </summary>
 /// <param name="dicomMessage">A DICOM file/message from which to initialize the properties of the <see cref="DicomUncompressedPixelData"/>.</param>
 public DicomUncompressedPixelData(DicomMessageBase dicomMessage)
     : base(dicomMessage)
 {
     _pd = dicomMessage.DataSet[DicomTags.PixelData];
     InitializeFrameData(this, _pd);
 }