Class BitDepth
- Namespace
- FellowOakDicom.Imaging
- Assembly
- fo-dicom.core.dll
Extract image bit depth infomation from dataset and provide information for image rendering process
public class BitDepth
- Inheritance
-
BitDepth
- Inherited Members
- Extension Methods
Constructors
BitDepth(int, int, int, bool)
Initialize the bit depth information using passed parameters
public BitDepth(int allocated, int stored, int highBit, bool signed)
Parameters
allocated
intNumber of bits allocated per pixel sample (8,16,32)
stored
intNumber of bits stored per pixel sample (from LSB to MSB)
highBit
intThe high bit zero based index
signed
boolTrue if pixel data signed (sign will be stored in the high bit)
Properties
BitsAllocated
Number of bits allocated per sample. Generally 1, 4, 8, or 16.
public int BitsAllocated { get; }
Property Value
BitsStored
Number of bits stored per sample.
public int BitsStored { get; }
Property Value
HighBit
Highest value bit in sample.
public int HighBit { get; }
Property Value
IsSigned
Samples are signed values if true.
public bool IsSigned { get; }
Property Value
MaximumValue
The maximum possible pixel value from stored bits
public int MaximumValue { get; }
Property Value
MinimumValue
The minimum possible pixel value from stored bits
public int MinimumValue { get; }
Property Value
Methods
FromDataset(DicomDataset)
Create new instance of BitDepth from input dataset
public static BitDepth FromDataset(DicomDataset dataset)
Parameters
dataset
DicomDatasetInput dataset to extract bit depth information from
Returns
GetHighBit(int, bool)
Return the high data bit index (excluding sign bit if data is signed)
public static int GetHighBit(int bitsStored, bool isSigned)
Parameters
Returns
- int
Index of high data bit (excluding sign bit if data is signed)
GetMaximumValue(int, bool)
Calculate the maximum value for specified bits and sign
public static int GetMaximumValue(int bitsStored, bool isSigned)
Parameters
Returns
- int
The maximum value
GetMinimumValue(int, bool)
Calculate the minimum value for specified bits and sign
public static int GetMinimumValue(int bitsStored, bool isSigned)
Parameters
Returns
- int
The minimum value
GetNextPowerOf2(int)
Rounds up to the next power of 2.
public static int GetNextPowerOf2(int value)
Parameters
value
int
Returns
- int
Next power of 2 or current value if already power of 2.
ToString()
public override string ToString()