ImageGear for C and C++ on Windows v19.1 - Updated
MED_DCM_DS_bits_get
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Data Set Functions > MED_DCM_DS_bits_get

This function returns three critical DE values from the Data Set: the number of Bits Allocated (0028,0100), the number of Bits Stored (0028,0101), and the position of the High Bit (0028,0102). These values are stored in the HDS structure pointed to by the HIGEAR.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_DCM_DS_bits_get(
       const HIGEAR hIGear, 
       LPUINT lpBitsAllocated, 
       LPUINT lpBitsStored, 
       LPUINT lpHighBit, 
       LPUINT lpSamplesPerPix);

Arguments:

Name Type Description
hIGear const HIGEAR HIGEAR handle of the image containing a DICOM Data Set.
lpBitsAllocated LPUINT A far pointer that returns the number of Bits Allocated (0028,0100) for each pixel in the image. Set this to NULL if you do not need this information.
lpBitsStored LPUINT A far pointer that returns the number of Bits Stored (0028,0101) for each pixel in the image. Set this to NULL if you do not need this information.
lpHighBit LPUINT A far pointer that returns the position of the High Bit (0028,0102) of the pixels in a DICOM image. Set this to NULL if you do not need this information.
lpSamplePerPix LPUINT A far pointer that returns the number of Samples Per Pixel (0028,0002) for the DICOM image. Set this to NULL if you do not need this information.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

This function does not process image pixels.

The image must have a DICOM DataSet attached to it. Use MED_DCM_DS_exists to check whether the image contains a DataSet.

Remarks:

The value returned by lpBitsAllocated is not always the same as the number of bits per pixel for the image's DIB. It is the number of bits allocated per sample for each pixel. A 24-bit RGB image would return a Bits Allocated of 8 since each of the 3 samples has 8 bits allocated for it.

The Bits Stored is the number of bits actually used out of the total available (Bits Allocated). You can have a 16-bit grayscale image that only actually uses 12-bits. In this case, the Bits Allocated would be 16 and Bits Stored would be 12. The Bits Stored is always less than or equal to the Bits Allocated.

The High Bit shows where the Bits Stored are placed in the Bits Allocated WORD or DWORD. Since the Bits Stored can be less than the Bits Allocated, the Bits Stored can be placed in the Bits Allocated with different starting points. This value tells you where the Bits Stored actually resides. High Bits is always less than Bits Allocated.

See Also

MED_IP_high_bit_transform

MED_IP_reduce_depth_with_LUT

MED_IP_reduce_depth_with_downshift