Class PixelData
Namespace: Aspose.Medical.Dicom.Imaging
Assembly: Aspose.Medical.dll (25.11.0)
Encapsulated base functionality for reading and writing DICOM images pixel data according to the specified transfer syntax.
public abstract class PixelDataInheritance
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
PixelData(Dataset)
Encapsulated base functionality for reading and writing DICOM images pixel data according to the specified transfer syntax.
protected PixelData(Dataset dataset)Parameters
dataset Dataset
Properties
BitDepth
The Aspose.Medical.Dicom.Imaging.PixelData.BitDepth information for image rendering. Read-only Aspose.Medical.Dicom.Imaging.PixelData.BitDepth.
public BitDepth BitDepth { get; }Property Value
BitsAllocated
The number of bits allocated per pixel sample (0028,0100). Read-only System.UInt16.
public ushort BitsAllocated { get; }Property Value
BitsStored
The number of bits stored per pixel sample (0028,0101). Read/Write System.UInt16.
public ushort BitsStored { get; set; }Property Value
Exceptions
Value > Bits Allocated.
BytesAllocated
The number of bytes allocated per pixel sample. Read-only System.Int32.
public int BytesAllocated { get; }Property Value
Dataset
The DICOM Dataset containing the pixel data. Read-only Aspose.Medical.Dicom.Imaging.PixelData.Dataset.
public Dataset Dataset { get; }Property Value
Height
The DICOM image height (rows) in pixels. Read/Write System.UInt16.
public ushort Height { get; set; }Property Value
HighBit
The index of the most significant bit (MSB) of pixel sample (0028,0102). Read/Write System.UInt16.
public ushort HighBit { get; set; }Property Value
Exceptions
Value > Bits Allocated.
IsLossy
The lossy image compression (0028,2110) status (true if stored value is “01”). Read-only System.Boolean.
public bool IsLossy { get; }Property Value
LossyCompressionMethod
The lossy image compression method (0028,2114). Read-only System.String.
public string LossyCompressionMethod { get; }Property Value
LossyCompressionRatio
The lossy image compression ratio (0028,2112). Read-only System.Decimal.
public decimal LossyCompressionRatio { get; }Property Value
Remarks
Default value is System.Decimal.MinValue.
NumberOfFrames
The DICOM image Number of frames. This value usually equals 1 for single frame images. Read/Write System.Int32.
public int NumberOfFrames { get; set; }Property Value
PaletteColorLut
The palette color LUT, valid for PALETTE COLOR Aspose.Medical.Dicom.Imaging.PixelData.PhotometricInterpretation. Read-only Aspose.Medical.Imaging.PixelFormats.Bgra32 array.
public Bgra32[] PaletteColorLut { get; }Property Value
Bgra32 []
Exceptions
Invalid photometric interpretation or palette color LUT is missing in dataset.
PhotometricInterpretation
The photometric Interpretation. Read/Write Aspose.Medical.Dicom.Imaging.PhotometricInterpretation.
public PhotometricInterpretation? PhotometricInterpretation { get; set; }Property Value
PixelRepresentation
The pixel Representation (0028,0103), represents signed/unsigned data of the pixel samples. Read/Write Aspose.Medical.Dicom.Imaging.PixelRepresentation.
public PixelRepresentation PixelRepresentation { get; set; }Property Value
PlanarConfiguration
The planar Configuration (0028,0006), indicates whether the color pixel data are sent color-by-plane or color-by-pixel. Read/Write Aspose.Medical.Dicom.Imaging.PixelRepresentation.
public PlanarConfiguration PlanarConfiguration { get; set; }Property Value
SamplesPerPixel
The number of samples per pixel (0028,0002), usually 1 for grayscale and 3 for color for RGB and YBR. Read/Write System.UInt16.
public ushort SamplesPerPixel { get; set; }Property Value
Syntax
The transfer syntax used to encode the DICOM image pixel data. Read-only Aspose.Medical.Dicom.TransferSyntax.
public TransferSyntax Syntax { get; }Property Value
UncompressedFrameSize
The uncompressed frame size in bytes. Read-only System.Int32.
public int UncompressedFrameSize { get; }Property Value
Width
The DICOM image width (columns) in pixels. Read/Write System.UInt16.
public ushort Width { get; set; }Property Value
Methods
AddFrame(Span<byte>)
Adds new frame into pixel data. New frame will be appended to existing frames.
public abstract void AddFrame(Span<byte> data)Parameters
Frame System.Byte buffer to be added.
Create(Dataset)
Creates a new instance of the Aspose.Medical.Dicom.Imaging.PixelData and
creates Pixel Data element for the given dataset.
public static PixelData Create(Dataset dataset)Parameters
dataset Dataset
The DICOM dataset.
Returns
The Aspose.Medical.Dicom.Imaging.PixelData.
Exceptions
Unable to create Pixel Data.
GetFrame(int)
Extracts byte frame at the specified position (index).
public abstract Span<byte> GetFrame(int index)Parameters
index int
The index of a frame to be extracted.
Returns
The System.Byte’s array frame.
GetPhotometricInterpretation()
Returns Aspose.Medical.Dicom.Imaging.PhotometricInterpretation stored in the Aspose.Medical.Dicom.Imaging.PixelData.Dataset (if specified). If ‘Photometric Interpretation’ isn’t explicitly specified in the Dataset, the calculates default Aspose.Medical.Dicom.Imaging.PhotometricInterpretation for the given Aspose.Medical.Dicom.Imaging.PixelData.Dataset based on the Aspose.Medical.Dicom.Tags.Tag.SamplesPerPixel and Aspose.Medical.Dicom.Tags.Tag.RedPaletteColorLookupTableData.
public PhotometricInterpretation GetPhotometricInterpretation()Returns
The Aspose.Medical.Dicom.Imaging.PixelData.PhotometricInterpretation applicable for this pixel data.
GetRawData()
Returns raw pixel data in internal format.
public abstract Span<byte> GetRawData()Returns
The raw pixel data in internal format.
Read(Dataset)
Creates a new instance of the Aspose.Medical.Dicom.Imaging.PixelData by reading
existing Pixel Data element from the given dataset.
public static PixelData Read(Dataset dataset)Parameters
dataset Dataset
The DICOM dataset.
Returns
The Aspose.Medical.Dicom.Imaging.PixelData.
Exceptions
Unable to create Pixel Data. </byte>